/*========================================
Base Style Reset
========================================*/
* {
 margin: 0;
 padding: 0;
 box-sizing: border-box;
}
html, body {
 font-family: "Playfair Display";
 line-height: 1.5;
 -webkit-font-smoothing: antialiased;
 color: #ccc;
background:
  /* scratch layer */
  repeating-linear-gradient(
    -8deg,
    rgba(255,255,255,0.015) 0,
    rgba(255,255,255,0.01) 1px,
    transparent 3px
  ),
  radial-gradient(circle at center,
    rgba(50,50,50,0.75), 
    rgba(5,5,5,0.95) 80%),
  linear-gradient(to bottom, 
    #252525, 
    #151515);
 background-blend-mode: overlay, overlay, multiply, normal;
 overflow-x: hidden;
 height: 100%;
}
button {
  border: unset;
  background: unset;
  font-size:  unset;
  font-family: unset;
  color: unset;
  text-align: unset;
}
:root {
 --color-subdued-white: #bbb;
 --color-active: #9ef0f9;
 --border-1px: 1px groove #333;
 --box-shadow-header:   0px 1px 6px rgba(0, 0, 0, 0.4),
                        2px 6px 8px rgba(20, 25, 30, 0.25),
                        inset 0 1px 2px rgba(255, 255, 255, 0.25),
                        inset 0 -1px 3px rgba(0,0,0,0.4);
 --box-shadow-modal: 0 18px 40px rgba(0, 0, 0, 0.7),
                     0 6px 20px rgba(0, 0, 0, 0.5),
                     0 0 10px rgba(90, 120, 150, 0.25),
                     inset 0 2px 6px rgba(255, 255, 255, 0.05),
                     inset 0 -4px 10px rgba(0, 0, 0, 0.6); 
                        --dark-gradient: linear-gradient(30deg,    
                        hsla(0, 0%, 0%),    
                        hsla(225, 30%, 10%),    
                        hsla(200, 5%, 5%));
 --dark-blue-gradient: linear-gradient(30deg,    
                             hsla(0, 0%, 0%, .8),    
                             hsla(225, 15%, 12%, .85),    
                             hsla(200, 5%, 15%, .9));
 --action-button-gradient: linear-gradient(5deg,
                                hsla(215, 8%, 8%),
                                hsl(210, 12%, 8%),
                                hsl(217, 25%, 12%),
                                hsl(215, 28%, 12%), 
                                #333);
 --card-gradient: linear-gradient(30deg,    
                        hsla(0, 0%, 0%, .5),    
                        hsla(225, 15%, 12%, .65),    
                        hsla(200, 5%, 15%, .5));
 --green-gradient: linear-gradient(to right, 
                         #4caf50,
                         #81c784, 
                         #4caf50);
 --red-gradient: linear-gradient(to right,
                       #f44336, 
                       #e57373, 
                       #f44336);
}
@font-face {
  font-family: "Portmanteau";
  src: 
    url("../fonts/portmanteau.woff") format("woff2"),
    url("../fonts/portmanteau.woff2") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* ===============================
   Account Dashboard Styles 
================================== */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}
.dashboard-container .dashboard-main {
  flex: 1;
  padding: 20px;
  padding-top: 25px;
  margin-left: 260px;
  position: relative;
}
/* 
//      Section Headings 
*/
.dashboard-container .dashboard-main h2 {
  margin-bottom: 4px;
  font-size: 1.4rem;
}
/* 
//      Sidebar 
*/
.dashboard-container .sidebar {
  width: 260px;
  background: var(--dark-gradient);
  border-right: var(--border-1px);
  overflow-y: auto;
  position: fixed;
  left: 0;
  top: 85px;
  bottom: 0;
  height: calc(100vh - 85px);
}
.dashboard-container .sidebar::before {
   background: linear-gradient(
   50deg, transparent 30%,
   rgba(255,255,255,0.6) 50%,
   transparent 70%);
   backdrop-filter: blur(150px);
}
.dashboard-container .sidebar::after {
   background: radial-gradient(
     circle at 30% 50%,
     rgba(255,255,255,0.1),
     transparent 70%);
   backdrop-filter: blur(100px);
}
.dashboard-container .sidebar-header {
  padding: 20px;
  padding-bottom: 4px;
  border-bottom: var(--border-1px);
}

/* Sidebar Profile Section */
.dashboard-container .sidebar-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dashboard-container .sidebar-avatar-container {
  position: relative;
}

.dashboard-container .sidebar-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(158, 240, 249, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
}

.dashboard-container .sidebar-avatar:hover {
  border-color: var(--color-active);
  box-shadow: 0 0 20px rgba(158, 240, 249, 0.4);
  transform: scale(1.05);
}

.dashboard-container .sidebar-settings-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: linear-gradient(135deg, var(--color-active), #7dd3db);
  border: 2px solid rgba(0, 0, 0, 0.8);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0a0a0a;
  transition: all 0.3s ease;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dashboard-container .sidebar-user-info {
  text-align: center;
  width: 100%;
}

.dashboard-container .sidebar-user-info h3 {
  color: var(--color-subdued-white);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.dashboard-container .sidebar-user-info p {
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
  margin: 0 0 12px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.dashboard-container .sidebar-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #888;
  font-size: 0.8rem;
}

.dashboard-container .sidebar-meta svg {
  color: var(--color-active);
  opacity: 0.7;
}

/* Hide mobile-only elements on desktop */
.dashboard-container .sidebar-tab,
.dashboard-container .sidebar-close,
.dashboard-container .sidebar-panel,
.dashboard-container .sidebar-panel-header {
  display: none;
}

.dashboard-container .sidebar-nav ul {
  list-style: none;
}
.dashboard-container .sidebar-nav li {
  margin: 10px 0;
}
.dashboard-container .sidebar-nav a {
  text-decoration: none;
  color: var(--color-subdued-white);
  padding: 10px 20px;
  display: block;
  border-radius: 5px;
  background-color: transparent;
  border: inherit;
  font-size: inherit;
  font-family: inherit;
  text-align: inherit;
  cursor: pointer;
}
.dashboard-container .sidebar-nav a svg {
  display: inline;
  right: -75px;
  position: relative;
  opacity: 0;
  transition: all 0.3s ease;
}
.dashboard-container .sidebar-nav a:hover svg {
  opacity: 1;
}
.dashboard-container .sidebar-nav a:hover {
  background-color: #374151;
  border-left: 4px groove var(--color-active);
  transform: translateX(8px);
  box-shadow: var(--box-shadow-header);
  transition: all 0.2s ease;
  width: 100%;
}
.dashboard-container .sidebar-nav a.active {
  border-left: 4px groove var(--color-active);
  background-color: #2d3748;
  box-shadow: var(--box-shadow-header);
}
.dashboard-container .drawer {
  position: fixed;
  top: 93px;
  left: -260px; 
  width: 260px;
  height: calc(100vh - 93px);
  background: var(--action-button-gradient);
  transition: left 0.6s ease;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  border-right: var(--border-1px);
  overflow-y: auto;
}
.dashboard-container .drawer.open {
  left: 0px; 
}
.dashboard-container .drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: var(--border-1px);
}
.dashboard-container .drawer-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--color-subdued-white);
}
.dashboard-container .drawer-header .close {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}
.dashboard-container .drawer ul {
  margin: 0;
  padding: 1rem;
  list-style: none;
  flex: 1;
  overflow-y: auto;
}
.dashboard-container .drawer li {
  margin-bottom: 1rem;
}
/* 
//      Overview Section 
*/
.dashboard-container .dashboard-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 2rem;
}

.dashboard-container .overview-card {
  background: linear-gradient(135deg,    
    hsla(220, 30%, 8%, 0.95),    
    hsla(220, 25%, 12%, 0.90),    
    hsla(215, 20%, 10%, 0.95));  
  backdrop-filter: blur(50px);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  min-height: 320px;
  transition: all 0.3s ease;
}

.dashboard-container .overview-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(158, 240, 249, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Two-column cards take full width */
.dashboard-container .two-column-card {
  grid-column: span 1;
}

/* Card Headers */
.dashboard-container .overview-card .card-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(158, 240, 249, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-container .overview-card .card-header h3 {
  color: var(--color-active);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
}

.dashboard-container .overview-card .card-header h3 svg {
  color: var(--color-active);
  opacity: 0.8;
}

.dashboard-container .card-action-btn {
  background: rgba(158, 240, 249, 0.1);
  border: 1px solid rgba(158, 240, 249, 0.2);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--color-subdued-white);
}

.dashboard-container .card-action-btn:hover {
  background: rgba(158, 240, 249, 0.2);
  border-color: var(--color-active);
  color: var(--color-active);
  transform: translateX(2px);
}

.dashboard-container .section-subtitle {
  color: #888;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Clickable elements */
.dashboard-container .clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.dashboard-container .clickable:hover {
  transform: translateY(-2px);
}

/* Progress Summary Card */
.dashboard-container #progress-summary .progress-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
}

.dashboard-container #progress-summary .progress-left {
  min-width: 200px;
}

.dashboard-container #progress-summary .progress-right {
  flex: 1;
  min-width: 0;
}

.dashboard-container #progress-summary .milestone-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-container #progress-summary .stat-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  transition: all 0.3s ease;
  gap: 12px;
}

.dashboard-container #progress-summary .stat-item.clickable:hover {
  background: rgba(158, 240, 249, 0.05);
  border-color: rgba(158, 240, 249, 0.3);
  transform: translateX(4px);
}

.dashboard-container #progress-summary .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-container #progress-summary .stat-icon.courses {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.dashboard-container #progress-summary .stat-icon.completed {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.dashboard-container #progress-summary .stat-icon.points {
  background: linear-gradient(135deg, #ffd700, #daa520);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.dashboard-container #progress-summary .stat-icon svg {
  color: #fff;
}

.dashboard-container #progress-summary .stat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-container #progress-summary .stat-value {
  color: var(--color-active);
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  line-height: 1;
}

.dashboard-container #progress-summary .stat-label {
  color: #888;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#active-courses-list {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 8px;
}

#active-courses-list::-webkit-scrollbar {
  width: 6px;
}

#active-courses-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

#active-courses-list::-webkit-scrollbar-thumb {
  background: rgba(158, 240, 249, 0.3);
  border-radius: 3px;
}

#active-courses-list::-webkit-scrollbar-thumb:hover {
  background: rgba(158, 240, 249, 0.5);
}

/* Progress Card - Compact Stats */
.dashboard-container #progress-summary .milestone-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-container #progress-summary .stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(158, 240, 249, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
}

.dashboard-container #progress-summary .stat-item.clickable:hover {
  background: rgba(158, 240, 249, 0.05);
  border-color: rgba(158, 240, 249, 0.2);
  transform: translateX(2px);
}

.dashboard-container #progress-summary .stat-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(158, 240, 249, 0.1);
}

.dashboard-container #progress-summary .stat-icon svg {
  width: 18px;
  height: 18px;
  color: var(--color-active);
}

.dashboard-container #progress-summary .stat-text {
  flex: 1;
  min-width: 0;
}

.dashboard-container #progress-summary .stat-value {
  color: var(--color-subdued-white);
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}

.dashboard-container #progress-summary .stat-label {
  color: #888;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

/* Training Goal Card - Top row: Points + Streak + View Badges Button (all same size) */
.dashboard-container #quick-actions .training-goal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Top Row: Points, Streak, View Badges - all side by side, equal size */
.dashboard-container #quick-actions .goal-top-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dashboard-container #quick-actions .stat-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 70px;
}

.dashboard-container #quick-actions .stat-box.points-box {
  background: rgba(158, 240, 249, 0.08);
  border: 1px solid rgba(158, 240, 249, 0.15);
}

.dashboard-container #quick-actions .stat-box.points-box:hover {
  background: rgba(158, 240, 249, 0.12);
  border-color: rgba(158, 240, 249, 0.3);
  transform: translateY(-2px);
}

.dashboard-container #quick-actions .stat-box.streak-box {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.1), rgba(255, 69, 0, 0.08));
  border: 1px solid rgba(255, 140, 0, 0.2);
}

.dashboard-container #quick-actions .stat-box.streak-box:hover {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.15), rgba(255, 69, 0, 0.12));
  border-color: rgba(255, 140, 0, 0.35);
  transform: translateY(-2px);
}

.dashboard-container #quick-actions .stat-box .stat-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.dashboard-container #quick-actions .stat-box.points-box .stat-icon {
  background: rgba(158, 240, 249, 0.15);
}

.dashboard-container #quick-actions .stat-box.points-box .stat-icon svg {
  color: var(--color-active);
}

.dashboard-container #quick-actions .stat-box.streak-box .stat-icon {
  background: rgba(255, 140, 0, 0.15);
}

.dashboard-container #quick-actions .stat-box.streak-box .stat-icon svg {
  color: #ff8c00;
  animation: flameFlicker 2s ease-in-out infinite;
}

.dashboard-container #quick-actions .stat-box .stat-info {
  flex: 1;
  min-width: 0;
}

.dashboard-container #quick-actions .stat-box .stat-value {
  color: var(--color-subdued-white);
  font-size: 1.4rem;
  font-weight: 700;
  display: block;
  line-height: 1.1;
}

.dashboard-container #quick-actions .stat-box.streak-box .stat-value {
  color: #ff8c00;
  text-shadow: 0 0 12px rgba(255, 140, 0, 0.4);
}

.dashboard-container #quick-actions .stat-box .stat-label {
  color: #888;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-top: 2px;
}

/* View Badges Button - same dimensions as stat boxes */
.dashboard-container #quick-actions .view-badges-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(158, 240, 249, 0.08);
  border: 1px solid rgba(158, 240, 249, 0.15);
  color: var(--color-subdued-white);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 70px;
}

.dashboard-container #quick-actions .view-badges-btn:hover {
  background: rgba(158, 240, 249, 0.12);
  border-color: rgba(158, 240, 249, 0.3);
  transform: translateY(-2px);
}

.dashboard-container #quick-actions .view-badges-btn svg {
  color: var(--color-active);
  flex-shrink: 0;
}

/* Training Goal Display (bottom, full width) */
.dashboard-container #quick-actions .goal-display-container {
  width: 100%;
}

.dashboard-container #quick-actions .goal-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  transition: all 0.3s ease;
  text-align: center;
  min-height: 100px;
  position: relative;
}

.dashboard-container #quick-actions .goal-display.clickable:hover {
  background: rgba(158, 240, 249, 0.05);
  border-color: rgba(158, 240, 249, 0.3);
  transform: translateY(-2px);
}

.dashboard-container #quick-actions .goal-icon {
  margin-bottom: 8px;
}

.dashboard-container #quick-actions .goal-icon svg {
  color: var(--color-active);
  filter: drop-shadow(0 0 8px rgba(158, 240, 249, 0.5));
}

.dashboard-container #quick-actions .goal-info {
  width: 100%;
}

.dashboard-container #quick-actions .goal-label {
  color: #888;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
  transition: opacity 0.5s ease;
}

.dashboard-container #quick-actions .goal-value {
  color: var(--color-subdued-white);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  line-height: 1.3;
  transition: opacity 0.5s ease;
}

/* Goal attribute cycling animation */
.dashboard-container #quick-actions .goal-info.fade-out .goal-label,
.dashboard-container #quick-actions .goal-info.fade-out .goal-value {
  opacity: 0;
}

.dashboard-container #quick-actions .section-subtitle {
  margin: 0 0 8px 0;
  color: #888;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.dashboard-container #quick-actions .badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 8px;
}

.dashboard-container #quick-actions .badges-grid::-webkit-scrollbar {
  width: 6px;
}

.dashboard-container #quick-actions .badges-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.dashboard-container #quick-actions .badges-grid::-webkit-scrollbar-thumb {
  background: rgba(158, 240, 249, 0.3);
  border-radius: 3px;
}

.dashboard-container #quick-actions .badges-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(158, 240, 249, 0.5);
}

.dashboard-container #quick-actions .view-all-btn {
  width: 100%;
  padding: 10px 16px;
  background: rgba(158, 240, 249, 0.1);
  border: 1px solid rgba(158, 240, 249, 0.2);
  border-radius: 8px;
  color: var(--color-active);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dashboard-container #quick-actions .view-all-btn:hover {
  background: rgba(158, 240, 249, 0.15);
  border-color: rgba(158, 240, 249, 0.4);
  transform: translateY(-1px);
}
.dashboard-container .progress-item {
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(158, 240, 249, 0.05);
  transition: all 0.3s ease;
}

.dashboard-container .progress-item:hover {
  background: rgba(158, 240, 249, 0.05);
  border-color: rgba(158, 240, 249, 0.2);
}

.dashboard-container .progress-item a {
  text-decoration: none;
  color: var(--color-subdued-white);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  display: block;
  margin-bottom: 8px;
  position: static;
  left: auto;
  bottom: auto;
}

.dashboard-container .progress-item a:hover {
  color: var(--color-active);
}

.dashboard-container .progress-item .progress-bar {
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
  height: 8px;
  margin-top: 8px;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.dashboard-container .progress {
  background: linear-gradient(90deg,
   #376cdd,
   #5a8eec,
   #376cdd);
  height: 100%;
  width: 0;
  position: relative;
  border-radius: 8px;
  background-size: 200% 200%;
  animation: fillBar 2s forwards 0.3s, fillBarSweep 4s linear infinite;
  box-shadow: 0 0 8px rgba(55, 108, 221, 0.5);
}

@keyframes fillBar {
  to { width: var(--progress-width);}
}

@keyframes fillBarSweep {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* 
//      Badges Section 
*/
.dashboard-container .badges-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  margin-bottom: 16px;
}

.dashboard-container .badge {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(40, 40, 40, 0.5));
  padding: 8px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(158, 240, 249, 0.2);
  position: relative;
  overflow: visible;
  width: 70px;
  height: 70px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dashboard-container .badge:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(158, 240, 249, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: var(--color-active);
}

.dashboard-container .badge .title {
  font-weight: 600;
  font-size: 0.7rem;
  display: block;
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-subdued-white);
  font-style: normal;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-container .badge-icons {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.9;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
}

.dashboard-container .badge:hover .badge-icons {
  opacity: 1;
  transform: translateX(-50%) scale(1.1);
}

.dashboard-container .view-all-btn {
  color: var(--color-subdued-white);
  background: linear-gradient(135deg, rgba(158, 240, 249, 0.1), rgba(158, 240, 249, 0.05));
  border: 1px solid rgba(158, 240, 249, 0.3);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  position: static;
  left: auto;
  bottom: auto;
}

.dashboard-container .view-all-btn svg {
  transition: transform 0.3s ease;
}

.dashboard-container .view-all-btn:hover {
  color: var(--color-active);
  background: linear-gradient(135deg, rgba(158, 240, 249, 0.2), rgba(158, 240, 249, 0.1));
  border-color: var(--color-active);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(158, 240, 249, 0.3);
}

.dashboard-container .view-all-btn:hover svg {
  transform: rotate(15deg);
}

.dashboard-container .decay-bar {
  background: var(--color-subdued-white);
  border-radius: 4px;
  height: 6px;
  position: absolute;
  overflow: hidden;
  bottom: 22px;
  left: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dashboard-container .badge:hover .decay-bar {
  opacity: 1;
}

.dashboard-container .remaining {
  background: var(--green-gradient);
  height: 100%;
  width: 100%;
  border-radius: 3px;
  position: relative;
  background-size: 200% 200%;
  animation: remainingTimeBar 1.5s forwards 0.3s, 
             remainingTimeSweep 8s linear infinite;
}

.dashboard-container .short {
  background: var(--red-gradient);
  border-radius: 3px;
}

.dashboard-container .expiry {
  font-size: 0.75rem;
  display: block;
  opacity: 0;
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  transition: all .3s ease-in-out;
  white-space: nowrap;
  color: #888;
}

@keyframes remainingTimeBar {
  to { width: var(--remaining-time);}
}

@keyframes remainingTimeSweep {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.dashboard-container .badge:hover .expiry {
  opacity: 1;
  bottom: -24px;
}

.dashboard-container .expiring {
  animation: badgeFlash 3s ease-in-out infinite;
}

@keyframes badgeFlash {
  0%, 70%, 100% {
    box-shadow: 
      0 2px 8px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(158, 240, 249, 0.2);
  }
  35% {
    box-shadow: 
      0 0 16px rgba(255, 0, 0, 0.6),
      0 0 24px rgba(255, 0, 0, 0.3),
      inset 0 0 16px rgba(255, 0, 0, 0.2);
    border-color: #ff0000;
  }
}
/* 
//      Learning Plan Section 
*/
.dashboard-container .learning-plan-list {
  list-style: disc;
  margin-left: 20px;
  margin-top: 10px;
}
.dashboard-container .learning-plan-list li {
  position: relative;
  padding-left: 25px;
  margin-bottom: 15px;
  list-style: none;
}
.dashboard-container #training-roadmap {
  overflow-x: scroll;
  width: calc(95vw - 260px);
  justify-self: center;
  display: flex;
  padding: 20px;
}
.dashboard-container .roadmap {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.dashboard-container .module {
  padding: 1rem;
  border-radius: 8px;
  min-width: 120px;
  background: var(--color-subdued-white);
  text-align: center;
  box-shadow: var(--box-shadow-header);
  border: var(--border-1px);
  overflow: hidden;
  position: relative;
  color: #000;
}
.dashboard-container .module-lesson {
  padding: 1rem;
  border-radius: 8px;
  min-width: 120px;
  background: var(--color-subdued-white);
  text-align: center;
  box-shadow: var(--box-shadow-header);
  border: var(--border-1px);
  overflow: hidden;
  position: relative;
  color: #000;
  display: none;
}
.dashboard-container .completed { 
  background:#c8e6c9;
  box-shadow: var(--box-shadow-header); 
  border: var(--border-1px);
  overflow: hidden;
  position: relative;
  text-decoration: line-through;
  font-style: italic;
  font-weight: bold;
  color: #444;
  opacity: .75;
}
.dashboard-container .current { 
  background:#333; 
  box-shadow:var(--box-shadow-header);
  border: var(--border-1px);
  overflow: hidden;
  position: relative;
  font-weight: bold;
  text-shadow: 0px 1px 2px #666;
  display: block;
  color: var(--color-active);
}
.dashboard-container .locked { 
  background: var(--color-subdued-white); 
  opacity:0.25;
  box-shadow: var(--box-shadow-header);
  border: var(--border-1px);
  overflow: hidden;
  position: relative;
  color: #222;
  text-shadow: 0px 1px 0px #000;
  font-weight: bold;
}
.dashboard-container .lock-icon {
  position: absolute;
  left: 20%;
  top: 5%;
  opacity: .75;
}
.dashboard-container .connector { 
  flex:1; 
  height:4px; 
  width: 70px;
  background: linear-gradient(3deg,    
  hsla(0, 0%, 0%, 0.85),    
  hsla(225, 30%, 20%, 0.85),    
  hsla(200, 5%, 10%, 0.85)); 
  box-shadow: var(--box-shadow-header); 
  border-radius: 3px;
}
.dashboard-container .quizzes {
  position: relative;
}
/* 
//      Resources Section 
*/
.dashboard-container .dashboard-resources ul {
  margin-top: 10px;
  list-style: none;
  margin-left: 0;
  padding: 0;
}

.saved-resource-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.saved-resource-item:hover {
  background: #222;
  border-color: var(--color-active);
  transform: translateX(4px);
}

.saved-resource-item .resource-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.saved-resource-item .resource-info {
  flex: 1;
  min-width: 0;
}

.saved-resource-item .resource-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  color: #fff;
}

.saved-resource-item .resource-preview,
.saved-resource-item .resource-course {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: #aaa;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.saved-resource-item .resource-date {
  font-size: 0.75rem;
  color: #666;
}

.note-modal .modal-header,
.note-modal .modal-footer {
  padding: 1rem;
}

.note-modal .modal-body {
  padding: 1rem;
  overflow-y: auto;
}

.note-modal .modal-header {
  border-bottom: 1px solid #333;
}

.note-modal .modal-footer {
  border-top: 1px solid #333;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.note-modal .btn-primary,
.note-modal .btn-secondary {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

.note-modal .btn-primary {
  background: var(--color-active);
  color: #fff;
}

.note-modal .btn-secondary {
  background: #333;
  color: #fff;
}

.note-modal .modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
}

/* 
//      Challenges Section 
*/
.dashboard-container .challenge-feed { 
  display: grid; 
  gap: 1rem; 
  margin-top: 1.5rem;
}
.dashboard-container .challenge-feed h2 {
  margin-top: 1.5rem;
  font-size: 1.2rem;
  margin-left: 1rem;
}
.dashboard-container .challenge {
  padding: .25rem;
  border-radius: 6px;
  background: #333;
  border: var(--border-1px);
  box-shadow:var(--box-shadow-header); 
  width: 90%;
  margin-left: 3%;
  transition: all 0.3 ease;
}
.dashboard-container .challenge:hover {
  transform: translateY(-4px);
}
.dashboard-container .challenge-feed .active { 
  border-left: 8px solid #4caf50; 
}
.dashboard-container .upcoming {
  border-left: 8px solid #ff9800; 
}
.dashboard-container .ended {
  font-style: italic;
  color: #444;
  opacity: .5;
  border-left: 8px solid #ddd; 
}
.dashboard-container .reward {
  font-weight: bold;
}
.dashboard-container .time-left {
  color: #666;
  font-style: italic;
  font-size: .9rem;
  margin-left: .5rem;
}
.dashboard-container .challenge-btn {
  cursor: pointer;
}
/* 
//      Modal overlay 
*/
.dashboard-container .challenge-modal,
.dashboard-container .badges-modal,
#account-settings-modal,
#account-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, 
                  rgba(0,0,0,0.8) 0%, 
                  rgba(0,0,0,0.6) 100%);
  backdrop-filter: blur(4px);
  display: none; 
  align-items: center;
  justify-content: center;
  z-index: 20000; /* ensure overlay sits above header and other page elements */
  padding-top: calc(var(--site-header-height, 85px) + 12px); /* avoid header overlap */
}
.dashboard-container .challenge-modal.active,
.dashboard-container .badges-modal.active,
#account-settings-modal.active,
#account-settings-modal.active {
  display: flex !important;
}
/* 
//      Modal content box 
*/
.dashboard-container .challenge-modal .modal-content,
.dashboard-container .badges-modal .modal-content,
#account-settings-modal .modal-content {
  background: linear-gradient(165deg, 
                  #1c1c1c 0%, 
                  #232323 100%);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 600px;
  width: 90%;
  padding: 1.5rem;
  padding-top: .75rem;
  box-shadow:var(--box-shadow-modal);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - (var(--site-header-height, 85px) + 56px));
  animation: fadeIn 0.3s ease-out;
  color: #eee;
  z-index: 200;
  position: relative; /* let overlay center the content */
  justify-self: center;
  top: unset;
  left: unset;
  margin: 0 auto; /* center horizontally */
  z-index: 20001; /* keep above overlay */
  overflow-y: auto;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 
//      Header 
*/
.dashboard-container .challenge-modal .modal-content header,
.dashboard-container .badges-modal .modal-content header,
#account-settings-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}
.dashboard-container .challenge-modal .modal-content header h2,
.dashboard-container .badges-modal .modal-content header h2,
#account-settings-modal .modal-header h2 {
  margin: 0;
  text-shadow: 1px 1px 1px #111;
}
.dashboard-container .challenge-modal .modal-content header .close-challenge,
.dashboard-container .badges-modal .modal-content header .close-badges,
#account-settings-modal .modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}
/* 
//      Challenge details 
*/
.dashboard-container .challenge-modal .challenge-details p {
  margin: 0.5rem 0;
}
/* 
//      Footer actions 
*/
.dashboard-container .challenge-modal .modal-content footer,
#account-settings-modal .modal-footer {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  border-top: var(--border-1px);
  padding: 1rem 1.25rem;
}
.dashboard-container .challenge-modal .action,
#account-settings-modal .btn-primary {
  padding: 0.5rem 1rem;
  border: var(--border-1px);
  border-radius: 6px;
  background: var(--action-button-gradient);
  color: var(--color-subdued-white);
  cursor: pointer;
  box-shadow: var(--box-shadow-header);
  text-shadow: 1px 1px 1px #000;
  transition: all .2s ease;
}
.dashboard-container .challenge-modal .action:hover {
  filter: brightness(1.5);
  color: var(--color-active);
  transform: translateY(-4px);
}
.dashboard-container .challenge-modal .secondary {
  background: transparent;
  color: #bbb;
  border: none;
  box-shadow: none;
  text-shadow: none;
  transition: all .2s ease;
}
.dashboard-container .challenge-modal .secondary:hover {
  color: var(--color-active);
  transform: translateY(-4px);
}
#account-settings-modal .btn-primary {
  max-width: 300px;
  text-align: center;
  position: relative;
  right: -250px;
  margin: .5rem;
  transition: all .2s ease;
}
#account-settings-modal .modal-footer .btn-primary {
  position: relative;
  right: 0;
}
#account-settings-modal .tab-panel {
  display: none;
  position: relative;
}
#account-settings-modal .active {
  display: block;
  position: relative;
}
#account-settings-modal .tab-panel label {
  display: block;
  margin-bottom: 0.75rem;
}
#account-settings-modal .tab-panel input[type="textarea"] {
  height: 150px;
}
/* 
//      Activity log 
*/
#account-settings-modal .activity-log {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
#account-settings-modal .activity-log li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
/* 
//      Security warning 
*/
#account-settings-modal .warning-text {
  color: #b22222;
  font-size: 0.9rem;
  margin: 0.75rem 0;
}
#account-settings-modal .deactivate {
  margin-top: 3rem;
}
#account-settings-modal .danger {
  background: #d9534f;
  border: var(--border-1px);
  color: var(--color-subdued-white);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: Playfair Display;
  text-shadow: 0 1px 1px #111;
  box-shadow: var(--box-shadow-header);
}
#account-settings-modal .modal-body {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
}
#account-settings-modal .account-info-current {
  position: relative;
}
#account-settings-modal .profile-img {
  position: relative;
  display: inline-block;
}
#account-settings-modal .profile-img img.avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
}
#account-settings-modal .profile-img #upload-avatar-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37 0%, #f4e4a6 100%);
  border: 2px solid rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #000;
  padding: 0;
}
#account-settings-modal .profile-img #upload-avatar-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}
#account-settings-modal .profile-img #upload-avatar-btn svg {
  width: 18px;
  height: 18px;
}
#account-settings-modal .profile-current-info {
  position: absolute;
  top: 10px;
  left: 125px;
  font-size: .85rem;
}
#account-settings-modal .profile-current-info h4 {
  font-size: 1.25rem;
}
#account-settings-modal .modal-tabs {
  display: flex;
  border-bottom: var(--border-1px);
  background: transparent;
}
#account-settings-modal .modal-tabs .tab {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 500;
  font-family: Playfair Display;
}
#account-settings-modal .modal-tabs .tab.active {
  background: var(--action-button-gradient);
  border-bottom: 3px groove #112547;
  color: var(--color-active);
  border-radius: 6px 6px 0px 0;
}
#account-settings-modal .modal-status {
  display: none; 
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
}
#account-settings-modal .status-message {
  display: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
#account-settings-modal .unsaved {
  background: #fff3cd;
  border: 1px solid #ccc;
  color: #856404;
}
#account-settings-modal .success {
  background: #d4edda;
  border: 1px solid #ccc;
  color: #155724;
}
#account-settings-modal .error {
  background: #ccc;
  border: 1px solid #f5c6cb;
  color: #721c24;
}
#account-settings-modal .modal-header {
  padding: 1rem 1.25rem;
  background: transparent;
}
#account-settings-modal h3 {
  text-align: center;
  color: #333;
  margin-bottom: .5rem;
  margin-top: 5rem;
}

/* ===============================
   Edit Goal Modal
================================== */
#edit-goal-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10000;
  overflow-y: auto;
  padding: 20px;
}

#edit-goal-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#edit-goal-modal .goal-modal-content {
  background: linear-gradient(135deg, #1a1f2e, #252b3b);
  border: 1px solid rgba(158, 240, 249, 0.2);
  border-radius: 12px;
  padding: 32px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  position: relative;
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#edit-goal-modal h2 {
  color: var(--color-subdued-white);
  font-size: 1.5rem;
  margin: 0 0 24px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(158, 240, 249, 0.1);
}

#edit-goal-modal .form-group {
  margin-bottom: 20px;
}

#edit-goal-modal .form-group label {
  display: block;
  color: var(--color-subdued-white);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
}

#edit-goal-modal .field-description {
  color: #888;
  font-size: 0.8rem;
  margin: -4px 0 8px 0;
  font-style: italic;
}

#edit-goal-modal select,
#edit-goal-modal textarea {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(158, 240, 249, 0.2);
  border-radius: 8px;
  color: var(--color-subdued-white);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

#edit-goal-modal select:focus,
#edit-goal-modal textarea:focus {
  outline: none;
  border-color: var(--color-active);
  background: rgba(158, 240, 249, 0.05);
  box-shadow: 0 0 0 2px rgba(158, 240, 249, 0.1);
}

#edit-goal-modal select option {
  background: #1a1f2e;
  color: var(--color-subdued-white);
}

#edit-goal-modal textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

#edit-goal-modal .modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(158, 240, 249, 0.1);
}

#edit-goal-modal .btn-secondary,
#edit-goal-modal .btn-primary {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

#edit-goal-modal .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-subdued-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#edit-goal-modal .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

#edit-goal-modal .btn-primary {
  background: linear-gradient(135deg, var(--color-active), #06b6d4);
  color: #1a1f2e;
  box-shadow: 0 4px 12px rgba(158, 240, 249, 0.3);
}

#edit-goal-modal .btn-primary:hover {
  box-shadow: 0 6px 16px rgba(158, 240, 249, 0.4);
  transform: translateY(-1px);
}

#edit-goal-modal .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 4px 8px;
}

#edit-goal-modal .modal-close:hover {
  color: var(--color-active);
  transform: scale(1.1);
}

/* ===============================
   Responsive Design Media Queries
================================== */

/* Notification animations */
@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Desktop Large (1367px+) - Normal fixed sidebar */
/* (Base styles already defined above) */

/* ===== UNIFIED COLLAPSIBLE SIDEBAR (ALL SCREENS ≤ 1366px) ===== */
@media (max-width: 1366px) {
  .dashboard-container {
    display: grid;
    grid-template-columns: 40px 1fr;
    min-height: calc(100vh - 70px);
    margin-top: 100px;
  }

  /* Sidebar - Column 1 (40px reserved space) */
  .dashboard-container .sidebar {
    position: relative;
    width: 40px;
    height: 100%;
    background: transparent;
    border: none;
    overflow: visible;
  }

  /* Hide desktop sidebar header/nav */
  .dashboard-container .sidebar-header {
    display: none;
  }

  .dashboard-container .sidebar > .sidebar-nav {
    display: none;
  }

  /* Collapsed Vertical Tab - Always 40px wide */
  .dashboard-container .sidebar-tab {
    display: block;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    min-height: 150px;
    background-color: #222;
    color: var(--color-subdued-white);
    padding: 16px 2px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-style: italic;
    font-size: 1.1rem;
    border-radius: 0 8px 8px 0;
    border: 2px groove rgba(40, 45, 50, 0.5);
    border-left: none;
    box-shadow: var(--box-shadow-header);
    transition: opacity 0.6s ease;
    user-select: none;
    z-index: 1001;
  }

  /* Panel - Slides in from left edge */
  .dashboard-container .sidebar-panel {
    display: block;
    position: fixed;
    left: -260px;
    top: 70px;
    bottom: 0;
    width: 260px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0 8px 8px 0;
    background-color: #222;
    border: 1px groove rgba(40, 45, 50, 0.5);
    border-left: none;
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--box-shadow-header);
    z-index: 1002;
  }

  /* Panel header */
  .dashboard-container .sidebar-panel-header {
    display: block;
    font-style: italic;
    font-size: 1.2rem;
    padding: 16px;
    margin-bottom: 8px;
    color: var(--color-subdued-white);
    border-bottom: var(--border-1px);
    position: relative;
  }

  .dashboard-container .sidebar-close {
    display: block;
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 1.5rem;
    line-height: 1;
    padding: 4px 8px;
    transition: all 0.2s ease;
  }

  .dashboard-container .sidebar-close:hover {
    color: var(--color-active);
    transform: scale(1.1);
  }

  /* Open State - Panel slides in AND tab hides */
  .dashboard-container .sidebar.collapsed-open .sidebar-tab {
    opacity: 0;
    pointer-events: none;
  }

  .dashboard-container .sidebar.collapsed-open .sidebar-panel {
    left: 0;
  }

  /* Hide tab when drawer is open */
  .dashboard-container .drawer.open ~ .sidebar .sidebar-tab {
    opacity: 0;
    pointer-events: none;
  }

  /* Nav in panel */
  .dashboard-container .sidebar-panel .sidebar-nav {
    padding: 0 8px 16px 8px;
    display: block;
  }

  .dashboard-container .sidebar-panel .sidebar-nav ul {
    list-style: none;
  }

  .dashboard-container .sidebar-panel .sidebar-nav li {
    margin: 8px 0;
  }

  .dashboard-container .sidebar-panel .sidebar-nav a {
    text-decoration: none;
    color: var(--color-subdued-white);
    padding: 10px 16px;
    display: block;
    border-radius: 5px;
    background-color: transparent;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    cursor: pointer;
  }

  .dashboard-container .sidebar-panel .sidebar-nav a:hover {
    background-color: #374151;
    border-left: 4px groove var(--color-active);
    transform: translateX(4px);
  }

  .dashboard-container .sidebar-panel .sidebar-nav a.active {
    border-left: 4px groove var(--color-active);
    background-color: #2d3748;
    box-shadow: var(--box-shadow-header);
  }

  /* Main content - Column 2 (takes remaining space) */
  .dashboard-container .dashboard-main {
    margin: 0;
    padding: 20px;
    width: 100%;
    position: relative;
    z-index: 1;
  }

  /* Drawers stay below sidebar */
  .dashboard-container .drawer {
    z-index: 999;
  }
}

/* Cards side-by-side on wider screens */
@media (min-width: 1200px) and (max-width: 1366px) {
  .dashboard-container .dashboard-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Cards stack vertically below 1200px */
@media (max-width: 1199px) {
  .dashboard-container .dashboard-overview {
    grid-template-columns: 1fr;
  }

  .dashboard-container .overview-card {
    max-width: 100%;
  }
}

/* Tablet adjustments for card internals */
@media (max-width: 899px) {
  /* Reduce padding on smaller screens */
  .dashboard-container .dashboard-main {
    padding: 12px;
  }
  
  /* Switch to vertical layout inside cards */
  #progress-summary .progress-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  #progress-summary .progress-left {
    min-width: auto;
  }
  
  #progress-summary .milestone-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  #progress-summary .stat-item {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
  }
  
  /* Training goal card responsive */
  #quick-actions .training-goal-content {
    flex-direction: column;
  }

  #quick-actions .goal-top-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #quick-actions .goal-display-container {
    width: 100%;
  }
  
  .dashboard-container .overview-card {
    min-height: auto;
  }
}

/* Mobile (below 768px) - Full vertical layout */
@media (max-width: 767px) {
  .dashboard-container .dashboard-overview {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .dashboard-container .overview-card {
    padding: 16px;
  }
  
  /* Progress card mobile - full vertical */
  #progress-summary .progress-content {
    grid-template-columns: 1fr;
  }
  
  #progress-summary .milestone-stats {
    flex-direction: column;
  }
  
  #progress-summary .stat-item {
    flex-direction: row;
    justify-content: flex-start;
  }
  
  #progress-summary .stat-icon {
    width: 40px;
    height: 40px;
  }
  
  #progress-summary .stat-value {
    font-size: 1.5rem;
  }
  
  /* Training goal mobile - stack everything vertically */
  #quick-actions .training-goal-content {
    flex-direction: column;
    gap: 10px;
  }

  #quick-actions .goal-top-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #quick-actions .goal-display-container {
    width: 100%;
  }

  #quick-actions .stat-box {
    min-height: 80px;
    padding: 12px;
  }

  #quick-actions .stat-box .stat-icon {
    width: 32px;
    height: 32px;
  }

  #quick-actions .stat-box .stat-value {
    font-size: 1.4rem;
  }

  #quick-actions .goal-display {
    min-height: 120px;
    padding: 12px;
  }
  
  #quick-actions .goal-icon svg {
    width: 24px;
    height: 24px;
  }
  
  #quick-actions .goal-value {
    font-size: 0.9rem;
  }

  #quick-actions .goal-right {
    order: 3;
  }
  
  /* Badges grid mobile */
  #quick-actions .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 6px;
    max-height: 140px;
  }
  
  .dashboard-container .badges-grid {
    gap: 8px;
    justify-content: center;
  }
  
  .dashboard-container .badge {
    width: 65px;
    height: 65px;
  }
  
  .dashboard-container .badge .title {
    font-size: 0.65rem;
  }
}

/* Small/short viewports: anchor modals near the top so they don't appear off-screen */
@media (max-height: 700px) {
  .dashboard-modal {
    align-items: flex-start;
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .points-modal-content,
  .streak-modal-content {
    max-height: calc(100vh - 36px);
  }
}

/* Also apply similar handling for older overlay modal types (challenge, badges, account-settings) */
@media (max-height: 700px) {
  .dashboard-container .challenge-modal,
  .dashboard-container .badges-modal,
  #account-settings-modal {
    align-items: flex-start;
    padding-top: calc(var(--site-header-height, 85px) + 12px);
    padding-bottom: 12px;
  }
  .dashboard-container .challenge-modal .modal-content,
  .dashboard-container .badges-modal .modal-content,
  #account-settings-modal .modal-content {
    max-height: calc(100vh - (var(--site-header-height, 85px) + 48px));
  }
}

/* ===============================
   Points Modal Styles
================================== */
.dashboard-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, 
                  rgba(0,0,0,0.85) 0%, 
                  rgba(0,0,0,0.75) 100%);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  z-index: 10000;
  overflow-y: auto;
  box-sizing: border-box; /* ensure overlay padding doesn't cause overflow */
  padding-top: calc(var(--site-header-height, 85px) + 12px);
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 20px;
}

.dashboard-modal.active {
  display: flex !important;
  animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.points-modal-content,
.streak-modal-content {
  background: linear-gradient(135deg, #1a1f2e, #252b3b);
  border: 1px solid rgba(158, 240, 249, 0.2);
  border-radius: 16px;
  width: clamp(320px, 85vw, 640px);
  max-height: calc(100vh - (var(--site-header-height, 85px) + 56px));
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  animation: slideUpModal 0.4s ease;
  position: relative;
  box-sizing: border-box; /* ensure padding and border are included in width */
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-modal .modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid rgba(158, 240, 249, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, #1a1f2e, #252b3b);
  z-index: 10;
  border-radius: 16px 16px 0 0;
}

.dashboard-modal .modal-header h2 {
  color: var(--color-subdued-white);
  font-size: 1.5rem;
  margin: 0;
  display: flex;
  align-items: center;
}

.dashboard-modal .modal-header h2 svg {
  color: var(--color-active);
}

.dashboard-modal .modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #888;
  font-size: 1.8rem;
  line-height: 1;
  transition: all 0.3s ease;
  padding: 0;
}

.dashboard-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-active);
  transform: scale(1.1);
}

.dashboard-modal .modal-share-buttons {
  display: flex;
  gap: 8px;
}

.dashboard-modal .share-btn {
  background: rgba(158, 240, 249, 0.1);
  border: 1px solid rgba(158, 240, 249, 0.2);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-subdued-white);
  transition: all 0.3s ease;
}

.dashboard-modal .share-btn:hover {
  background: rgba(158, 240, 249, 0.2);
  border-color: var(--color-active);
  color: var(--color-active);
  transform: translateY(-2px);
}

.dashboard-modal .modal-body {
  padding: 28px;
}

/* Points Modal Specific */
.points-hero {
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, rgba(158, 240, 249, 0.05), rgba(158, 240, 249, 0.02));
  border-radius: 12px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  margin-bottom: 28px;
}

.points-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.points-value {
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-active);
  text-shadow: 0 0 30px rgba(158, 240, 249, 0.5);
  line-height: 1;
}

.points-label {
  color: #888;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Milestone Progress */
.milestone-progress {
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  margin-bottom: 28px;
}

.milestone-progress h3 {
  color: var(--color-subdued-white);
  font-size: 1rem;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  font-weight: 600;
}

.milestone-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.milestone-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.milestone-name {
  color: var(--color-active);
  font-weight: 600;
  font-size: 1.1rem;
}

.milestone-points {
  color: #888;
  font-size: 0.9rem;
}

.progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar {
  background: rgba(0, 0, 0, 0.4);
  height: 12px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.progress-fill {
  /* Angled gradient that fills left → right */
  background-image: linear-gradient(var(--progress-angle, 45deg), rgba(6,182,212,0.98) 0%, rgba(3,146,153,0.95) 40%, rgba(0,120,140,0.90) 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: 8px;
  /* Animate width when progress updates and simultaneously pulse the gradient to the right */
  animation: fillProgress 700ms cubic-bezier(.22,.9,.39,1) forwards, pulseMove 3s linear infinite;
  box-shadow: 0 0 12px rgba(158, 240, 249, 0.45);
  transition: width 420ms cubic-bezier(.22,.9,.39,1);
}

@keyframes fillProgress {
  from {
    width: 0;
  }
  to {
    width: var(--progress, 0%);
  }
}

@keyframes pulseMove {
  0% {
    background-position: 0% 50%;
    filter: brightness(1);
  }
  50% {
    background-position: 100% 50%;
    filter: brightness(1.02);
  }
  100% {
    background-position: 0% 50%;
    filter: brightness(1);
  }
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #888;
}

/* Points Actions Reference */
.points-actions-reference {
  margin-bottom: 28px;
}

.points-actions-reference h3 {
  color: var(--color-subdued-white);
  font-size: 1rem;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  font-weight: 600;
}

.points-actions-reference .info-icon {
  color: var(--color-active);
  opacity: 0.7;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.action-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  cursor: help;
}

.action-item:hover {
  background: rgba(158, 240, 249, 0.05);
  border-color: rgba(158, 240, 249, 0.3);
  transform: translateY(-2px);
}

.action-name {
  color: var(--color-subdued-white);
  font-size: 0.9rem;
  font-weight: 500;
}

.action-points {
  color: var(--color-active);
  font-weight: 700;
  font-size: 1rem;
}

/* Points Activity Feed */
.points-activity h3 {
  color: var(--color-subdued-white);
  font-size: 1rem;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  font-weight: 600;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
}

.activity-feed::-webkit-scrollbar {
  width: 6px;
}

.activity-feed::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.activity-feed::-webkit-scrollbar-thumb {
  background: rgba(158, 240, 249, 0.3);
  border-radius: 3px;
}

.activity-feed::-webkit-scrollbar-thumb:hover {
  background: rgba(158, 240, 249, 0.5);
}

.activity-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(158, 240, 249, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.activity-item:hover {
  background: rgba(158, 240, 249, 0.05);
  border-color: rgba(158, 240, 249, 0.2);
}

.activity-info {
  flex: 1;
}

.activity-description {
  color: var(--color-subdued-white);
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.activity-time {
  color: #666;
  font-size: 0.75rem;
  font-style: italic;
}

.activity-points {
  color: var(--color-active);
  font-weight: 700;
  font-size: 1rem;
  margin-left: 12px;
  flex-shrink: 0;
}

/* ===============================
   Streak Modal Styles
================================== */
.streak-hero {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.streak-stat {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2));
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
}

.streak-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(158, 240, 249, 0.3);
}

.streak-stat.current-streak {
  border-color: rgba(255, 140, 0, 0.2);
}

.streak-stat svg {
  filter: drop-shadow(0 0 12px currentColor);
}

.streak-stat .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-active);
  line-height: 1;
}

.streak-stat.current-streak .stat-value {
  color: #ff8c00;
  text-shadow: 0 0 20px rgba(255, 140, 0, 0.5);
}

.streak-stat .stat-label {
  color: #888;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Streak Message */
.streak-message {
  background: linear-gradient(135deg, rgba(158, 240, 249, 0.05), rgba(158, 240, 249, 0.02));
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  text-align: center;
  margin-bottom: 28px;
}

.streak-message p {
  color: var(--color-subdued-white);
  font-size: 0.95rem;
  margin: 0;
  font-style: italic;
}

/* Training Calendar */
.streak-calendar {
  margin-bottom: 28px;
}

.streak-calendar h3 {
  color: var(--color-subdued-white);
  font-size: 1rem;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  font-weight: 600;
}

.calendar-view {
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #666;
  transition: all 0.3s ease;
  cursor: default;
  position: relative;
}

.calendar-day.trained {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.calendar-day.missed {
  background: rgba(255, 255, 255, 0.02);
  color: #444;
}

.calendar-day.today {
  background: linear-gradient(135deg, var(--color-active), #06b6d4);
  color: #1a1f2e;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(158, 240, 249, 0.5);
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.8rem;
  color: #888;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.trained {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.legend-dot.missed {
  background: rgba(255, 255, 255, 0.1);
}

.legend-dot.today {
  background: linear-gradient(135deg, var(--color-active), #06b6d4);
}

/* Streak Stats Grid */
.streak-stats {
  margin-bottom: 28px;
}

.streak-stats h3 {
  color: var(--color-subdued-white);
  font-size: 1rem;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stats-grid .stat-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-grid .stat-label {
  color: #888;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-grid .stat-value {
  color: var(--color-subdued-white);
  font-size: 1.3rem;
  font-weight: 700;
}

/* Streak Milestones */
.streak-milestones h3 {
  color: var(--color-subdued-white);
  font-size: 1rem;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  font-weight: 600;
}

.milestones-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.milestone-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(158, 240, 249, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.milestone-item.achieved {
  border-color: rgba(76, 175, 80, 0.3);
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
}

.milestone-item.locked {
  opacity: 0.5;
}

.milestone-item:hover {
  transform: translateY(-2px);
  border-color: rgba(158, 240, 249, 0.3);
}

.milestone-item svg {
  margin-right: 8px;
  color: var(--color-active);
}

.milestone-item.achieved svg {
  color: #4caf50;
}

.milestone-name {
  color: var(--color-subdued-white);
  font-weight: 500;
}

.milestone-requirement {
  color: #888;
  font-size: 0.85rem;
}

/* Flame flicker animation for streak */
@keyframes flameFlicker {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Responsive for modals */
@media (max-width: 767px) {
  .points-modal-content,
  .streak-modal-content {
    width: calc(100% - 32px);
    max-width: calc(100% - 32px);
    border-radius: 12px;
    max-height: calc(100vh - 40px); /* give mobile room for header + close button */
  }
  
  .dashboard-modal .modal-header {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .dashboard-modal .modal-close {
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
  }
  
  .dashboard-modal .modal-body {
    padding: 20px;
  }
  
  .points-value {
    font-size: 3rem;
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
  }
  
  .streak-hero {
    grid-template-columns: 1fr;
  }
  
  .calendar-view {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
/* ===================================
   Certificates Modal
   =================================== */

.certificates-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, 
                  rgba(0,0,0,0.8) 0%, 
                  rgba(0,0,0,0.6) 100%);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding-top: calc(var(--site-header-height, 85px) + 12px);
}

.certificates-modal.active {
  display: flex !important;
}

.certificates-modal .modal-content {
  background: linear-gradient(165deg, 
                  #1c1c1c 0%, 
                  #232323 100%);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 900px;
  width: 90%;
  padding: 1.5rem;
  padding-top: .75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - (var(--site-header-height, 85px) + 56px));
  animation: fadeIn 0.3s ease-out;
  color: #eee;
  z-index: 20001;
  position: relative;
  overflow-y: auto;
}

.certificates-modal .modal-content header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.certificates-modal .modal-content header h2 {
  margin: 0;
  font-size: 1.5rem;
  text-shadow: 1px 1px 1px #111;
  display: flex;
  align-items: center;
}

.certificates-modal .modal-content header .close-certificates {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
  padding: 0.25rem 0.5rem;
}

.certificates-modal .modal-content header .close-certificates:hover {
  color: #fff;
}

.certificates-info {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.certificates-info p {
  margin: 0;
  color: #aaa;
  font-size: 0.9rem;
}

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.certificates-loading,
.certificates-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
}

.certificates-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.certificates-loading p,
.certificates-empty p {
  color: #999;
  margin: 0;
}

.certificates-empty h3 {
  color: #ccc;
  margin: 0.5rem 0;
}

.certificate-card {
  background: linear-gradient(135deg, 
                  rgba(14, 165, 233, 0.1) 0%, 
                  rgba(14, 165, 233, 0.05) 100%);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.certificate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4);
}

.certificate-card:hover {
  border-color: rgba(14, 165, 233, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.certificate-header {
  margin-bottom: 1rem;
}

.certificate-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #fff;
  line-height: 1.3;
}

.certificate-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #999;
}

.certificate-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.certificate-meta svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.certificate-score {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  font-size: 0.85rem;
  color: #4ade80;
  margin-top: 0.75rem;
}

.certificate-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.certificate-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.certificate-btn svg {
  width: 16px;
  height: 16px;
}

.certificate-btn.btn-download {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: #fff;
}

.certificate-btn.btn-download:hover {
  background: linear-gradient(135deg, #0284c7, #0891b2);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
}

.certificate-btn.btn-verify {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
}

.certificate-btn.btn-verify:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.certificate-id {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: #666;
  font-family: 'Courier New', monospace;
}

/* Responsive */
@media (max-width: 768px) {
  .certificates-grid {
    grid-template-columns: 1fr;
  }
  
  .certificates-modal .modal-content {
    max-width: 95%;
    padding: 1rem;
  }
}
