/* ─────────────────────────────────────────────────────────────
   01. DESIGN TOKENS
───────────────────────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --primary:        #10b981;
  --primary-dark:   #059669;
  --primary-light:  #34d399;
  --primary-pale:   #d1fae5;
  --primary-ultra:  #ecfdf5;

  --secondary:      #6366f1;
  --secondary-dark: #4f46e5;
  --secondary-pale: #eef2ff;

  --accent:         #f59e0b;
  --accent-dark:    #d97706;
  --accent-pale:    #fef3c7;

  --danger:         #ef4444;
  --danger-dark:    #dc2626;
  --danger-pale:    #fee2e2;

  --success:        #10b981;
  --warning:        #f59e0b;
  --info:           #3b82f6;

  /* Neutral Palette */
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-300:  #d1d5db;
  --gray-400:  #9ca3af;
  --gray-500:  #6b7280;
  --gray-600:  #4b5563;
  --gray-700:  #374151;
  --gray-800:  #1f2937;
  --gray-900:  #111827;

  /* Semantic Colors – Light Mode */
  --bg:             #ffffff;
  --bg-secondary:   #f9fafb;
  --bg-tertiary:    #f3f4f6;
  --surface:        #ffffff;
  --surface-2:      #f9fafb;
  --surface-3:      #f3f4f6;
  --border:         #e5e7eb;
  --border-strong:  #d1d5db;

  --text:           #111827;
  --text-secondary: #4b5563;
  --text-muted:     #6b7280;
  --text-faint:     #9ca3af;
  --text-inverse:   #ffffff;

  /* Year Card Gradients */
  --year-1: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --year-2: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --year-3: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --year-4: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.04);
  --shadow-xl:  0 20px 25px rgba(0,0,0,.10), 0 10px 10px rgba(0,0,0,.04);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,.15);
  --shadow-primary: 0 8px 25px rgba(16,185,129,.35);
  --shadow-focus:   0 0 0 3px rgba(16,185,129,.25);

  /* Border Radius */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-2xl:  28px;
  --radius-full: 9999px;

  /* Spacing */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
  --space-16:  64px;
  --space-20:  80px;
  --space-24:  96px;

  /* Typography */
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'Fira Code', 'Cascadia Code', monospace;

  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-lg:    1.125rem;   /* 18px */
  --text-xl:    1.25rem;    /* 20px */
  --text-2xl:   1.5rem;     /* 24px */
  --text-3xl:   1.875rem;   /* 30px */
  --text-4xl:   2.25rem;    /* 36px */
  --text-5xl:   3rem;       /* 48px */

  /* Layout */
  --nav-height:       68px;
  --mobile-nav-h:     64px;
  --container-max:    1200px;
  --container-pad:    24px;

  /* Transitions */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:   cubic-bezier(0, 0, 0.2, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast:   120ms;
  --duration-base:   200ms;
  --duration-slow:   350ms;
  --duration-slower: 500ms;
}


/* ─────────────────────────────────────────────────────────────
   02. RESET & BASE STYLES
───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Push content below fixed nav */
  padding-top: var(--nav-height);
  /* Push content above mobile bottom nav */
  padding-bottom: var(--mobile-nav-h);
}

img, video, svg { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}

button { font-family: inherit; cursor: pointer; }

ul, ol { list-style: none; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--primary-pale);
  color: var(--primary-dark);
}


/* ─────────────────────────────────────────────────────────────
   03. TYPOGRAPHY
───────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

strong { font-weight: 600; color: var(--text); }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger);  }
.text-muted   { color: var(--text-muted); }


/* ─────────────────────────────────────────────────────────────
   04. LAYOUT & CONTAINERS
───────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.section-title i {
  color: var(--primary);
  font-size: 0.9em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: var(--text-lg);
  max-width: 560px;
  margin: 0 auto;
}


/* ─────────────────────────────────────────────────────────────
   05. NAVIGATION (DESKTOP)
───────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-base) var(--ease),
              box-shadow var(--duration-base) var(--ease);
}

.navbar.scrolled {
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: var(--container-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity var(--duration-fast) var(--ease);
}
.nav-logo:hover { opacity: 0.85; }

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-primary);
  flex-shrink: 0;
}

.logo-text {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}
.logo-highlight { color: var(--primary); }

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
  white-space: nowrap;
}
.nav-link i { font-size: var(--text-sm); }
.nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}
.nav-link.active {
  background: var(--primary-pale);
  color: var(--primary-dark);
  font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--text-base);
  transition: all var(--duration-fast) var(--ease);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text);
  border-color: var(--border-strong);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: var(--space-2);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: var(--radius-full);
  transition: transform var(--duration-base) var(--ease),
              opacity var(--duration-fast) var(--ease),
              width var(--duration-base) var(--ease);
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ─────────────────────────────────────────────────────────────
   06. NAVIGATION SEARCH
───────────────────────────────────────────────────────────── */
.nav-search {
  flex: 1;
  max-width: 380px;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--text-sm);
  pointer-events: none;
  z-index: 1;
}

.nav-search input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast) var(--ease),
              background var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
  outline: none;
}
.nav-search input::placeholder { color: var(--text-faint); }
.nav-search input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-focus);
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.search-results.visible { display: block; animation: fadeSlideDown 150ms var(--ease) both; }

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-secondary); }

.search-result-item .result-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-pale);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  flex-shrink: 0;
}
.search-result-item .result-text strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
}
.search-result-item .result-text span {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

mark {
  background: #fef9c3;
  color: #78350f;
  border-radius: 2px;
  padding: 0 2px;
}


/* ─────────────────────────────────────────────────────────────
   07. MOBILE BOTTOM NAVIGATION
───────────────────────────────────────────────────────────── */
.mobile-bottom-nav {
  display: none; /* shown via media query */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--mobile-nav-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav nav,
.mobile-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-2) var(--space-1);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
  min-height: 100%;
}
.bottom-nav-item i { font-size: 20px; transition: transform var(--duration-fast) var(--ease-spring); }
.bottom-nav-item:hover i  { transform: translateY(-2px); }
.bottom-nav-item.active   { color: var(--primary); }
.bottom-nav-item.active i { transform: scale(1.1); }

/* Quick Start center button */
.quick-start-btn { flex: 1.2; }
.quick-start-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: var(--shadow-primary);
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast) var(--ease);
  margin-top: -16px;
}
.quick-start-btn:hover .quick-start-circle {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 30px rgba(16,185,129,.45);
}
.quick-start-btn { color: var(--primary); }


/* ─────────────────────────────────────────────────────────────
   08. HERO SECTION
───────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(
    135deg,
    var(--primary-ultra) 0%,
    #f0fdf9 40%,
    #eff6ff 100%
  );
  overflow: hidden;
  padding: var(--space-20) 0 var(--space-16);
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(16,185,129,.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(99,102,241,.10) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2310b981' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-12);
}

/* Hero Content */
.hero-content { max-width: 580px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--primary-pale);
  color: var(--primary-dark);
  border: 1px solid rgba(16,185,129,.25);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-5);
  animation: fadeSlideDown var(--duration-slow) var(--ease) both;
}
.hero-badge i { font-size: var(--text-sm); }

.hero-title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-5);
  animation: fadeSlideDown var(--duration-slow) 80ms var(--ease) both;
}
.hero-subtitle-text {
  color: var(--primary);
  display: inline-block;
}

.hero-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  animation: fadeSlideDown var(--duration-slow) 160ms var(--ease) both;
}
.hero-description strong { color: var(--primary-dark); }

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
  animation: fadeSlideDown var(--duration-slow) 240ms var(--ease) both;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  animation: fadeSlideDown var(--duration-slow) 320ms var(--ease) both;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  box-shadow: var(--shadow-sm);
  width: fit-content;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 var(--space-6);
}
.stat-item:first-child { padding-left: 0; }
.stat-item:last-child  { padding-right: 0; }

.stat-number {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}


/* ─────────────────────────────────────────────────────────────
   09. FLOATING CARDS & MCQ PREVIEW
───────────────────────────────────────────────────────────── */
.hero-illustration {
  position: relative;
  height: 480px;
  animation: fadeIn var(--duration-slow) 200ms var(--ease) both;
}

/* MCQ Preview card */
.hero-mcq-preview {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-5);
  z-index: 2;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.preview-badge {
  background: var(--primary-pale);
  color: var(--primary-dark);
  border-radius: var(--radius-full);
  padding: 3px var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.preview-q {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.preview-question {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

.preview-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.preview-option {
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
}
.preview-option.correct {
  background: var(--primary-pale);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}

/* Floating notification cards */
.floating-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  z-index: 3;
}
.floating-card i { font-size: var(--text-lg); flex-shrink: 0; }

.card-1 {
  top: 12%;
  right: 0;
  animation: floatY 3.5s ease-in-out infinite;
}
.card-2 {
  bottom: 18%;
  right: 0;
  animation: floatY 4s 1s ease-in-out infinite;
}
.card-3 {
  top: 38%;
  left: 0;
  animation: floatY 3s 0.5s ease-in-out infinite;
}


/* ─────────────────────────────────────────────────────────────
   10. DAILY PROGRESS BANNER
───────────────────────────────────────────────────────────── */
.daily-progress-banner {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  padding: var(--space-4) 0;
  position: sticky;
  top: var(--nav-height);
  z-index: 90;
}

.daily-progress-content {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.daily-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255,255,255,.85);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.daily-info i { font-size: var(--text-base); }

.daily-bar-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 200px;
}

.daily-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.25);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.daily-bar-fill {
  height: 100%;
  background: #ffffff;
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease);
}

.daily-count {
  color: rgba(255,255,255,.9);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-premium {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.btn-premium:hover {
  background: rgba(255,255,255,.3);
  color: #fff;
}


/* ─────────────────────────────────────────────────────────────
   11. YEAR CARDS SECTION
───────────────────────────────────────────────────────────── */
.years-section {
  padding: var(--space-16) 0;
  background: var(--bg-secondary);
}

.years-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

/* Wide card spans 2 cols on large screens — handled below */
.year-card-wide {
  grid-column: span 3;
}

/* Year Card Base */
.year-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease);
}
.year-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Year Card Header */
.year-card-header {
  padding: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.year-card-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}

.year-1 { background: var(--year-1); }
.year-2 { background: var(--year-2); }
.year-3 { background: var(--year-3); }
.year-4 { background: var(--year-4); }

.year-number {
  font-size: var(--text-4xl);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
}
.year-number sup {
  font-size: 0.4em;
  vertical-align: super;
}

.year-phase {
  font-size: var(--text-xs);
  font-weight: 700;
  color: rgba(255,255,255,.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: right;
}

/* Year Card Body */
.year-card-body {
  padding: var(--space-5) var(--space-5) var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.year-card-body h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.year-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Year Progress */
.year-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.progress-bar-mini {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease);
  width: 0%;
}

.progress-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

/* Year Card Footer */
.year-card-footer {
  padding: var(--space-4) var(--space-5) var(--space-5);
}
.btn-block { width: 100%; }

/* Wide card subjects layout */
.year-card-wide .year-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}


/* ─────────────────────────────────────────────────────────────
   12. QUIZ MODES SECTION
───────────────────────────────────────────────────────────── */
.modes-section {
  padding: var(--space-16) 0;
  background: var(--bg);
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.mode-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease),
              border-color var(--duration-fast) var(--ease);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.mode-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.mode-card h3 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
}
.mode-card p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}

/* Featured card */
.mode-card-featured {
  background: linear-gradient(135deg, var(--primary-ultra), #eff6ff);
  border-color: rgba(16,185,129,.3);
}
.mode-card-featured:hover { border-color: var(--primary); }

.mode-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 2px var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Mode Icons */
.mode-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  color: #fff;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-spring);
}
.mode-card:hover .mode-icon { transform: scale(1.1) rotate(-3deg); }

.mode-random   { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.mode-weak     { background: linear-gradient(135deg, #ef4444, #f97316); }
.mode-bookmark { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.mode-timed    { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.mode-daily    { background: linear-gradient(135deg, #10b981, #34d399); }
.mode-mock     { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }


/* ─────────────────────────────────────────────────────────────
   13. FEATURES SECTION
───────────────────────────────────────────────────────────── */
.features-section {
  padding: var(--space-16) 0;
  background: var(--bg-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--primary-pale);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  transition: transform var(--duration-fast) var(--ease-spring),
              background var(--duration-fast) var(--ease);
}
.feature-card:hover .feature-icon {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1) rotate(-5deg);
}

.feature-card h3 {
  font-size: var(--text-base);
  font-weight: 700;
}
.feature-card p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}


/* ─────────────────────────────────────────────────────────────
   14. FOOTER
───────────────────────────────────────────────────────────── */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-16) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-brand p {
  color: var(--gray-400);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}

/* Footer logo overrides */
.footer-brand .nav-logo .logo-text { color: #fff; }
.footer-brand .logo-highlight { color: var(--primary-light); }

.footer-countries {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.footer-countries span {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-full);
  padding: 4px var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--gray-300);
}

.footer-links h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-5);
}
.footer-links a {
  display: block;
  color: var(--gray-400);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
  transition: color var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease);
}
.footer-links a:hover {
  color: var(--primary-light);
  transform: translateX(3px);
}

.footer-bottom {
  padding: var(--space-6) 0;
  text-align: center;
}
.footer-bottom p {
  font-size: var(--text-sm);
  color: var(--gray-500);
}


/* ─────────────────────────────────────────────────────────────
   15. MODALS
───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  transition: transform var(--duration-slow) var(--ease-spring),
              opacity var(--duration-base) var(--ease);
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.modal-header h3 i { color: var(--primary); }

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  font-size: var(--text-xl);
  line-height: 1;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease);
}
.modal-close:hover {
  background: var(--danger-pale);
  color: var(--danger);
  border-color: transparent;
}

.modal-body {
  padding: var(--space-6);
}
.modal-body > p { margin-bottom: var(--space-5); color: var(--text-secondary); }

/* Quick Start Options */
.quick-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.quick-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  text-decoration: none;
}
.quick-option i {
  font-size: var(--text-2xl);
  color: var(--primary);
}
.quick-option:hover {
  border-color: var(--primary);
  background: var(--primary-pale);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Paywall Modal */
.paywall-modal { max-width: 420px; text-align: center; }

.paywall-header {
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6) var(--space-5);
  background: linear-gradient(135deg, var(--accent-pale), #fef9c3);
  border-bottom: 1px solid var(--border);
}
.paywall-header h3 {
  font-size: var(--text-2xl);
}
.paywall-header .modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}
.paywall-header { position: relative; }

.paywall-crown {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-3xl);
  color: #fff;
  box-shadow: 0 8px 24px rgba(245,158,11,.35);
  animation: scaleIn var(--duration-slow) var(--ease-spring) both;
}

.paywall-price {
  margin: var(--space-5) 0;
}
.price-tag {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  background: var(--primary-pale);
  border: 1px solid rgba(16,185,129,.25);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-6);
}
.price-currency { font-size: var(--text-lg); font-weight: 700; color: var(--primary-dark); }
.price-amount   { font-size: var(--text-4xl); font-weight: 900; color: var(--primary-dark); line-height: 1; }
.price-period   { font-size: var(--text-sm);  font-weight: 500; color: var(--primary); }

.paywall-features {
  text-align: left;
  margin-bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.paywall-features li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.paywall-features li i {
  color: var(--primary);
  font-size: var(--text-base);
  flex-shrink: 0;
}

.paywall-note {
  margin-top: var(--space-4) !important;
  font-size: var(--text-xs) !important;
  color: var(--text-faint) !important;
}


/* ─────────────────────────────────────────────────────────────
   16. TOAST NOTIFICATIONS
───────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--mobile-nav-h) + var(--space-4));
  right: var(--space-5);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
  max-width: 360px;
  width: calc(100% - var(--space-10));
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  pointer-events: all;
  font-size: var(--text-sm);
  font-weight: 500;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity var(--duration-base) var(--ease),
              transform var(--duration-base) var(--ease);
  border-left: 4px solid;
}
.toast.show {
  opacity: 1;
  transform: translateX(0);
}
.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger);  }
.toast-warning { border-left-color: var(--warning); }
.toast-info    { border-left-color: var(--info);    }

.toast-icon { font-size: var(--text-xl); flex-shrink: 0; line-height: 1; }
.toast-msg  { flex: 1; color: var(--text); line-height: 1.4; }

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease);
  line-height: 1;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text); }


/* ─────────────────────────────────────────────────────────────
   17. BUTTONS
───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease);
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.0);
  transition: background var(--duration-fast) var(--ease);
  border-radius: inherit;
}
.btn:hover::after { background: rgba(255,255,255,.08); }
.btn:active::after { background: rgba(0,0,0,.06); }

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,.35);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(16,185,129,.5);
  transform: translateY(-1px);
  color: #fff;
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}
.btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

/* Sizes */
.btn-sm { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); border-radius: var(--radius-md); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--text-base); border-radius: var(--radius-xl); }


/* ─────────────────────────────────────────────────────────────
   18. SUBJECT CHIPS
───────────────────────────────────────────────────────────── */
.year-subjects {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.subject-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease);
}
.subject-chip i {
  font-size: 0.9em;
  color: var(--primary);
  flex-shrink: 0;
}
.subject-chip:hover {
  background: var(--primary-pale);
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateX(3px);
}


/* ─────────────────────────────────────────────────────────────
   19. UTILITY CLASSES
───────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden { visibility: hidden; }

.d-none    { display: none !important; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

.text-center { text-align: center; }
.text-right  { text-align: right; }

.mt-auto { margin-top: auto; }
.mb-0    { margin-bottom: 0; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}


/* ─────────────────────────────────────────────────────────────
   20. ANIMATIONS & KEYFRAMES
───────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeSlideRight {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1);   }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { opacity: 1; transform: scale(1.05); }
  70%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* Scroll-triggered fade-in class (add via JS) */
.animate-in {
  animation: fadeSlideUp 0.5s var(--ease) both;
}


/* ─────────────────────────────────────────────────────────────
   21. DARK MODE
───────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:             #0a0f1e;
  --bg-secondary:   #0f172a;
  --bg-tertiary:    #1a2540;
  --surface:        #111827;
  --surface-2:      #1a2540;
  --surface-3:      #243050;
  --border:         #1e2d4a;
  --border-strong:  #2a3d5e;

  --text:           #f0f4ff;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-faint:     #4b5563;
  --text-inverse:   #0a0f1e;

  --primary-pale:   rgba(16,185,129,.12);
  --primary-ultra:  rgba(16,185,129,.06);
  --secondary-pale: rgba(99,102,241,.12);
  --accent-pale:    rgba(245,158,11,.10);
  --danger-pale:    rgba(239,68,68,.10);
  --success-pale:   rgba(16,185,129,.10);

  --shadow-sm:  0 1px 3px rgba(0,0,0,.5),  0 1px 2px rgba(0,0,0,.3);
  --shadow-md:  0 4px 6px rgba(0,0,0,.5),  0 2px 4px rgba(0,0,0,.3);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.5), 0 4px 6px rgba(0,0,0,.3);
  --shadow-xl:  0 20px 25px rgba(0,0,0,.6), 0 10px 10px rgba(0,0,0,.3);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,.7);
  --shadow-primary: 0 8px 25px rgba(16,185,129,.25);
  --shadow-focus:   0 0 0 3px rgba(16,185,129,.3);
}

/* Dark mode overrides */
[data-theme="dark"] .navbar {
  background: rgba(10,15,30,.95);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .navbar.scrolled {
  background: rgba(10,15,30,.98);
}

[data-theme="dark"] .hero {
  background: linear-gradient(
    135deg,
    rgba(16,185,129,.06) 0%,
    rgba(10,15,30,1) 60%,
    rgba(10,15,30,1) 100%
  );
}

[data-theme="dark"] .hero-stats {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .hero-mcq-preview {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .preview-option {
  border-color: var(--border);
  color: var(--text-secondary);
}
[data-theme="dark"] .preview-option.correct {
  background: var(--primary-pale);
  border-color: var(--primary);
  color: var(--primary-light);
}

[data-theme="dark"] .floating-card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(10,15,30,.97);
  border-top-color: var(--border);
}

[data-theme="dark"] .search-results {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .modal {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .paywall-header {
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(251,191,36,.05));
}

[data-theme="dark"] .year-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .mode-card {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .mode-card-featured {
  background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(99,102,241,.06));
}

[data-theme="dark"] .feature-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .subject-chip {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .quick-option {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .toast {
  background: var(--surface-2);
  border-color: var(--border);
}

[data-theme="dark"] .btn-outline {
  border-color: var(--border-strong);
  color: var(--text);
}
[data-theme="dark"] .btn-outline:hover {
  border-color: var(--primary);
  background: var(--primary-pale);
}

[data-theme="dark"] .footer {
  background: #06090f;
}
[data-theme="dark"] .footer-grid {
  border-bottom-color: rgba(255,255,255,.05);
}

[data-theme="dark"] mark {
  background: rgba(251,191,36,.2);
  color: #fcd34d;
}


/* ─────────────────────────────────────────────────────────────
   22. RESPONSIVE – TABLET (≤ 1024px)
───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Nav search shrinks */
  .nav-search { max-width: 260px; }

  /* Hero layout stacks */
  .hero .container {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    text-align: center;
  }
  .hero-content { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-stats   { margin: 0 auto; }

  /* Hero illustration repositioned */
  .hero-illustration {
    height: 340px;
    max-width: 500px;
    margin: 0 auto;
  }

  /* Year grid → 2 cols + wide spanning 2 */
  .years-grid { grid-template-columns: repeat(2, 1fr); }
  .year-card-wide { grid-column: span 2; }

  /* Modes grid → 2 cols */
  .modes-grid { grid-template-columns: repeat(2, 1fr); }

  /* Features → 2 cols */
  .features-grid { grid-template-columns: repeat(2, 1fr); }

  /* Footer → 2 cols */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .footer-brand { grid-column: span 2; }
}


/* ─────────────────────────────────────────────────────────────
   23. RESPONSIVE – MOBILE (≤ 768px)
───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --nav-height:    58px;
    --mobile-nav-h: 66px;
    --container-pad: 16px;
  }

  /* Show mobile bottom nav */
  .mobile-bottom-nav {
    display: flex;
  }

  /* Hide desktop nav links; show hamburger */
  .nav-search { display: none; }
  .nav-hamburger { display: flex; }
  .theme-toggle { display: none; } /* moved into mobile menu */

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4);
    gap: var(--space-1);
    box-shadow: var(--shadow-lg);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform var(--duration-base) var(--ease),
                opacity var(--duration-base) var(--ease);
    z-index: 999;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }
  .nav-link {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    justify-content: flex-start;
  }

  /* Hero */
  .hero {
    padding: var(--space-10) 0 var(--space-8);
  }
  .hero-title { font-size: var(--text-3xl); }
  .hero-description { font-size: var(--text-base); }

  .hero-illustration {
    height: 280px;
    width: 100%;
  }
  .hero-mcq-preview {
    width: 280px;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
  }
  .stat-divider { display: none; }
  .stat-item {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    min-width: 80px;
  }

  /* Daily banner */
  .daily-progress-content { gap: var(--space-3); }
  .daily-bar-wrapper { min-width: 120px; }

  /* Years grid → 1 col */
  .years-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .year-card-wide { grid-column: span 1; }

  /* Year subjects in wide card stay wrapped */
  .year-card-wide .year-subjects { flex-direction: row; flex-wrap: wrap; }

  /* Modes → 2 cols */
  .modes-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .mode-card  { padding: var(--space-4); }
  .mode-icon  { width: 48px; height: 48px; font-size: var(--text-xl); }

  /* Features → 1 col */
  .features-grid { grid-template-columns: 1fr; }

  /* Section spacing */
  .years-section,
  .modes-section,
  .features-section { padding: var(--space-10) 0; }

  .section-title { font-size: var(--text-2xl); }

  /* Hero actions stacked */
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 320px; justify-content: center; }

  /* Buttons */
  .btn-lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .footer-brand { grid-column: span 1; }

  /* Modal */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    max-height: 88dvh;
    transform: translateY(100%);
    max-width: 100%;
  }
  .modal-overlay.open .modal { transform: translateY(0); }

  /* Toasts */
  .toast-container {
    bottom: calc(var(--mobile-nav-h) + var(--space-3));
    left: var(--space-3);
    right: var(--space-3);
    max-width: 100%;
    width: auto;
  }

  /* Floating cards (simplify) */
  .card-2 { display: none; }
  .card-1 { top: 4%; right: 0; }
  .card-3 { bottom: 8%; left: 0; top: auto; }
}


/* ─────────────────────────────────────────────────────────────
   24. RESPONSIVE – SMALL MOBILE (≤ 480px)
───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  :root { --container-pad: 14px; }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl);  }

  /* Hero */
  .hero { padding: var(--space-8) 0 var(--space-6); }
  .hero-title { font-size: var(--text-2xl); }
  .hero-badge { font-size: var(--text-xs); }

  .hero-illustration { height: 220px; }
  .hero-mcq-preview  { width: 240px; }
  .preview-question  { font-size: var(--text-xs); }
  .preview-option    { font-size: 11px; padding: 6px 10px; }

  /* Float cards off on very small screens */
  .floating-card { display: none; }

  /* Modes → 1 col on tiny screens */
  .modes-grid { grid-template-columns: 1fr; }

  /* Year card */
  .year-number { font-size: var(--text-3xl); }
  .year-card-header { padding: var(--space-4) var(--space-5); }

  /* Daily banner compact */
  .daily-info span { display: none; }
  .daily-bar-wrapper { min-width: 80px; }

  /* Quick start modal */
  .quick-options { grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .quick-option  { padding: var(--space-4) var(--space-3); }

  /* Paywall compact */
  .paywall-crown { width: 56px; height: 56px; font-size: var(--text-2xl); }
  .price-amount  { font-size: var(--text-3xl); }
}


/* ─────────────────────────────────────────────────────────────
   25. PRINT STYLES
───────────────────────────────────────────────────────────── */
@media print {
  .navbar,
  .mobile-bottom-nav,
  .daily-progress-banner,
  .hero-actions,
  .toast-container,
  .modal-overlay,
  .floating-card { display: none !important; }

  body { padding: 0; background: #fff; color: #000; }
  .hero { background: #fff; padding: var(--space-6) 0; }
  .year-card, .mode-card, .feature-card { box-shadow: none; border: 1px solid #ccc; }
}


/* ─────────────────────────────────────────────────────────────
   26. REDUCED MOTION
───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .floating-card { animation: none; }
}
/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGE
═══════════════════════════════════════════════════════════════ */
.profile-page {
  padding-bottom: var(--space-16);
  min-height: 100dvh;
}

/* Profile Cover + Header */
.profile-header-section {
  position: relative;
  margin-bottom: var(--space-8);
}

.profile-cover {
  height: 180px;
  background: linear-gradient(135deg, var(--primary), #059669, var(--secondary));
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  position: relative;
  overflow: hidden;
}
.profile-cover-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255,255,255,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(0,0,0,.1) 0%, transparent 50%);
}

.profile-header-content {
  display: flex;
  align-items: flex-end;
  gap: var(--space-5);
  padding: 0 var(--space-6);
  margin-top: -54px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

/* Avatar */
.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-pale), var(--primary-ultra));
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--primary);
  overflow: hidden;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-edit {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-spring);
  box-shadow: var(--shadow-sm);
}
.profile-avatar-edit:hover { transform: scale(1.15); }

.profile-status {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--surface);
}
.profile-status.online  { background: var(--success); }
.profile-status.offline { background: var(--gray-400); }

/* Profile Info */
.profile-info {
  flex: 1;
  min-width: 0;
  padding-bottom: var(--space-3);
}
.profile-name {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-1);
  line-height: 1.2;
}
.profile-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.profile-subtitle i { font-size: 0.85em; color: var(--primary); }

.profile-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid;
}
.badge-streak {
  background: rgba(245,158,11,.1);
  border-color: rgba(245,158,11,.3);
  color: var(--accent-dark);
}
.badge-rank {
  background: rgba(99,102,241,.08);
  border-color: rgba(99,102,241,.25);
  color: var(--secondary);
}
.badge-plan {
  background: var(--primary-pale);
  border-color: rgba(16,185,129,.25);
  color: var(--primary-dark);
}

/* Quick Stats */
.profile-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.pqs-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast) var(--ease);
}
.pqs-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pqs-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
}
.pqs-total   { background: var(--primary-pale);    color: var(--primary); }
.pqs-correct { background: var(--secondary-pale);  color: var(--secondary); }
.pqs-time    { background: var(--accent-pale);     color: var(--accent-dark); }
.pqs-saved   { background: var(--danger-pale);     color: var(--danger); }

.pqs-data {
  display: flex;
  flex-direction: column;
}
.pqs-value {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.pqs-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

/* Tabs */
.profile-tabs-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.profile-tab {
  flex: 1;
  padding: var(--space-4) var(--space-5);
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--duration-fast) var(--ease);
  white-space: nowrap;
}
.profile-tab:hover { color: var(--text); background: var(--bg-secondary); }
.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-ultra);
}

.profile-tab-content {
  display: none;
  padding: var(--space-6);
}
.profile-tab-content.active { display: block; animation: fadeIn 200ms var(--ease); }

/* Settings Form */
.settings-group {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
}
.settings-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.settings-group-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
}
.settings-group-title i { color: var(--primary); font-size: 0.9em; }

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.form-group { display: flex; flex-direction: column; gap: var(--space-1); }
.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  outline: none;
}
.form-input::placeholder { color: var(--text-faint); }
.form-input:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  background: var(--surface);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Toggle Switches */
.settings-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.settings-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.settings-toggle-item:last-child { border-bottom: none; }

.toggle-info { display: flex; flex-direction: column; gap: 2px; }
.toggle-info strong { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
.toggle-info span   { font-size: var(--text-xs); color: var(--text-muted); }

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  transition: background var(--duration-fast) var(--ease);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-spring);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* Danger Zone */
.settings-danger { border-color: var(--danger-pale); }
.settings-danger .settings-group-title i { color: var(--danger); }
.settings-danger-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.btn-danger-outline {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}
.btn-danger-outline:hover {
  background: var(--danger-pale) !important;
}

.settings-save {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--space-6);
}

/* Activity Timeline */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.activity-empty {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.activity-empty i { font-size: 3rem; opacity: 0.3; }
.activity-empty h3 { color: var(--text); }

.timeline-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: box-shadow var(--duration-fast);
}
.timeline-item:hover { box-shadow: var(--shadow-md); }

.timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  flex-shrink: 0;
}
.timeline-icon.quiz    { background: var(--primary-pale);   color: var(--primary); }
.timeline-icon.streak  { background: var(--accent-pale);    color: var(--accent-dark); }
.timeline-icon.achieve { background: var(--secondary-pale); color: var(--secondary); }

.timeline-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.timeline-info strong { font-size: var(--text-sm); }
.timeline-info span   { font-size: var(--text-xs); color: var(--text-muted); }

/* Achievements Grid */
.achievements-container {
  padding: var(--space-4) 0;
}

.achievements-overview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.achievements-ring {
  position: relative;
  width: 120px;
  height: 120px;
}
.achievements-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ach-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}
.ach-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease);
}
.ach-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ach-ring-count { font-size: var(--text-2xl); font-weight: 800; color: var(--primary); line-height: 1; }
.ach-ring-total { font-size: var(--text-xs); color: var(--text-muted); }

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-4);
}

.ach-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  border-radius: var(--radius-xl);
  text-align: center;
  border: 1.5px solid var(--border);
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast) var(--ease);
  position: relative;
  overflow: hidden;
}
.ach-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.ach-card.unlocked {
  background: linear-gradient(135deg, var(--primary-ultra), var(--secondary-pale));
  border-color: rgba(16,185,129,.3);
}
.ach-card.locked {
  background: var(--bg-secondary);
  opacity: 0.55;
  filter: grayscale(0.4);
}

.ach-icon { font-size: 2.2rem; line-height: 1; }
.ach-title { font-size: var(--text-sm); font-weight: 700; color: var(--text); }
.ach-desc  { font-size: var(--text-xs); color: var(--text-muted); line-height: 1.3; }

.ach-locked-overlay {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-faint);
}


/* ═══════════════════════════════════════════════════════════════
   DASHBOARD PAGE
═══════════════════════════════════════════════════════════════ */
.dashboard-page {
  padding-bottom: var(--space-16);
  min-height: 100dvh;
  background: var(--bg-secondary);
}

.dash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-8) 0 var(--space-6);
  flex-wrap: wrap;
}
.dash-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.dash-title i { color: var(--primary); }
.dash-subtitle { color: var(--text-muted); font-size: var(--text-base); }

.dash-period-select {
  min-width: 160px;
  font-weight: 500;
}

/* Stat Cards Row */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.dash-stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast) var(--ease);
}
.dash-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.dash-stat-primary::before { background: var(--primary); }
.dash-stat-success::before { background: var(--success); }
.dash-stat-warning::before { background: var(--warning); }
.dash-stat-info::before    { background: var(--info);    }

.dash-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  flex-shrink: 0;
}
.dash-stat-primary .dash-stat-icon { background: var(--primary-pale); color: var(--primary); }
.dash-stat-success .dash-stat-icon { background: #dcfce7;             color: var(--success); }
.dash-stat-warning .dash-stat-icon { background: var(--accent-pale);  color: var(--accent-dark); }
.dash-stat-info    .dash-stat-icon { background: #dbeafe;             color: var(--info); }

.dash-stat-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.dash-stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.dash-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.dash-stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-stat-trend.up {
  background: #dcfce7;
  color: #166534;
}
.dash-stat-trend.down {
  background: var(--danger-pale);
  color: #991b1b;
}
.dash-stat-trend:not(.up):not(.down) {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* Charts Row */
.dash-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.dash-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: var(--space-3);
}
.dash-card-header h3 {
  font-size: var(--text-base);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.dash-card-header h3 i { color: var(--primary); font-size: 0.9em; }

.dash-card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.link-more {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: gap var(--duration-fast);
}
.link-more:hover { gap: var(--space-2); }

.dash-chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}
.legend-dot.correct   { background: var(--primary); }
.legend-dot.incorrect { background: var(--danger);  }

.dash-chart-body {
  padding: var(--space-5);
  min-height: 200px;
}

/* CSS Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding-bottom: var(--space-2);
}
.bar-chart .bar-group {
  flex: 1;
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 100%;
}
.bar-chart .bar {
  flex: 1;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  min-height: 4px;
  transition: height 0.6s var(--ease);
  cursor: pointer;
  position: relative;
}
.bar-chart .bar:hover { opacity: 0.85; }
.bar-chart .bar.correct   { background: var(--primary); }
.bar-chart .bar.incorrect { background: var(--danger);  }

.bar-chart .bar::after {
  content: attr(data-value);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--duration-fast);
}
.bar-chart .bar:hover::after { opacity: 1; }

.bar-chart-labels {
  display: flex;
  gap: 6px;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}
.bar-chart-labels span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
}

/* Accuracy Ring */
.dash-ring-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.dash-accuracy-ring {
  position: relative;
  width: 140px;
  height: 140px;
}
.dash-accuracy-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}
.ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease);
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-pct   { font-size: var(--text-2xl); font-weight: 800; color: var(--text); line-height: 1; }
.ring-label { font-size: var(--text-xs); color: var(--text-muted); }

.dash-accuracy-breakdown {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.ab-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.ab-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ab-dot.correct   { background: var(--primary); }
.ab-dot.incorrect { background: var(--danger);  }
.ab-dot.skipped   { background: var(--gray-300); }

/* Subject Performance */
.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
  overflow: hidden;
}
.dash-section > .dash-card-header {
  padding: var(--space-5);
}

.subject-perf-grid {
  padding: var(--space-5);
  padding-top: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.subj-perf-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  transition: box-shadow var(--duration-fast);
}
.subj-perf-item:hover { box-shadow: var(--shadow-md); }

.subj-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  flex-shrink: 0;
  background: var(--primary-pale);
  color: var(--primary);
}

.subj-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.subj-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.subj-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.subj-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease);
}
.subj-bar-fill.good    { background: var(--primary); }
.subj-bar-fill.average { background: var(--warning); }
.subj-bar-fill.weak    { background: var(--danger);  }

.subj-pct {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
}

/* Two Col Section (Weak + Recent) */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.dash-card-body { padding: var(--space-5); }

/* Weak Topics */
.weak-topics-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.weak-topic-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--danger-pale);
  border: 1px solid rgba(239,68,68,.15);
}
.weak-topic-item .wt-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.weak-topic-item .wt-info { flex: 1; }
.weak-topic-item .wt-name { font-size: var(--text-sm); font-weight: 600; }
.weak-topic-item .wt-detail { font-size: var(--text-xs); color: var(--text-muted); }
.weak-topic-item .wt-pct { font-size: var(--text-sm); font-weight: 700; color: var(--danger); }

/* Recent Quizzes */
.recent-quizzes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.recent-quiz-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: box-shadow var(--duration-fast);
}
.recent-quiz-item:hover { box-shadow: var(--shadow-md); }

.rq-grade {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.rq-grade.a { background: var(--success); }
.rq-grade.b { background: var(--info);    }
.rq-grade.c { background: var(--warning); }
.rq-grade.d { background: var(--danger);  }

.rq-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rq-name { font-size: var(--text-sm); font-weight: 600; }
.rq-meta { font-size: var(--text-xs); color: var(--text-muted); }

.rq-score { font-size: var(--text-sm); font-weight: 700; color: var(--text); white-space: nowrap; }

/* Streak Calendar */
/* ═══════════════════════════════════════════════════════════════
   STREAK CALENDAR & STREAK SYSTEM
   Complete styles for:
   - Streak header with fire animation
   - Calendar grid (monthly view)
   - Day cells with activity states
   - Streak milestones & badges
   - Weekly heatmap (mini view)
   - Streak modal / details view
   - Responsive behavior
   - Dark mode support
═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   STREAK SECTION (Container)
───────────────────────────────────────────────────────────── */
.streak-section {
  padding: var(--space-16) 0;
  background: var(--bg);
}

.streak-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* ─────────────────────────────────────────────────────────────
   STREAK HEADER (Top bar with fire icon & count)
───────────────────────────────────────────────────────────── */
.streak-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(135deg, #ff6b35 0%, #f7421e 50%, #ff9500 100%);
  position: relative;
  overflow: hidden;
}

/* Subtle flame pattern overlay */
.streak-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ccircle cx='40' cy='40' r='30' fill='none' stroke='rgba(255,255,255,.06)' stroke-width='1'/%3E%3Ccircle cx='40' cy='40' r='16' fill='none' stroke='rgba(255,255,255,.04)' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}

.streak-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  position: relative;
  z-index: 1;
}

.streak-fire {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.streak-fire-icon {
  font-size: 2.25rem;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(255,107,53,.6));
  animation: fireFlicker 1.5s ease-in-out infinite alternate;
  z-index: 2;
  position: relative;
}

.streak-fire-glow {
  position: absolute;
  inset: -6px;
  background: radial-gradient(circle, rgba(255,165,0,.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: firePulse 2s ease-in-out infinite;
  z-index: 1;
}

.streak-count {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-number {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.streak-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255,255,255,.85);
  letter-spacing: 0.02em;
}

.streak-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}

/* Streak best badge */
.streak-best {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.streak-best-icon {
  font-size: var(--text-sm);
  color: #fbbf24;
}

.streak-best-text {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.9);
  font-weight: 600;
  white-space: nowrap;
}
.streak-best-text strong {
  color: #fff;
}

/* Streak stats mini row */
.streak-stats-mini {
  display: flex;
  gap: var(--space-4);
}

.streak-stat-mini {
  text-align: center;
}

.streak-stat-mini-value {
  display: block;
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.streak-stat-mini-label {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-top: 3px;
}

/* ─────────────────────────────────────────────────────────────
   CALENDAR NAVIGATION
───────────────────────────────────────────────────────────── */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease);
}
.calendar-nav-btn:hover {
  background: var(--primary-pale);
  border-color: var(--primary);
  color: var(--primary);
}
.calendar-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.calendar-month-label {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.calendar-month-label i {
  font-size: var(--text-sm);
  color: var(--primary);
}

.calendar-today-btn {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-pale);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.calendar-today-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ─────────────────────────────────────────────────────────────
   CALENDAR GRID
───────────────────────────────────────────────────────────── */
.calendar-grid-wrapper {
  padding: var(--space-4) var(--space-6) var(--space-6);
}

/* Day-of-week headers */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.calendar-weekday {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-2) 0;
}

.calendar-weekday.weekend {
  color: var(--danger);
  opacity: 0.6;
}

/* Calendar Days Grid */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-1);
}

/* ─────────────────────────────────────────────────────────────
   CALENDAR DAY CELL
───────────────────────────────────────────────────────────── */
.calendar-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  border: 1.5px solid transparent;
  min-height: 44px;
}
.calendar-day:hover {
  background: var(--bg-secondary);
  border-color: var(--border);
}

/* Day Number */
.calendar-day-number {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  z-index: 1;
  transition: color var(--duration-fast) var(--ease);
}

/* Activity Indicator (dot below number) */
.calendar-day-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 4px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease-spring);
}

/* MCQ Count Badge (appears on hover/tap) */
.calendar-day-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease-spring);
  box-shadow: 0 2px 6px rgba(16,185,129,.35);
  z-index: 3;
}
.calendar-day:hover .calendar-day-badge,
.calendar-day.has-activity:hover .calendar-day-badge {
  opacity: 1;
  transform: scale(1);
}

/* ─────────────────────────────────────────────────────────────
   DAY STATES
───────────────────────────────────────────────────────────── */

/* Empty (no date / padding cell) */
.calendar-day.empty {
  visibility: hidden;
  pointer-events: none;
}

/* Other month (grayed out) */
.calendar-day.other-month {
  opacity: 0.3;
  pointer-events: none;
}
.calendar-day.other-month .calendar-day-number {
  color: var(--text-faint);
}

/* Today */
.calendar-day.today {
  border-color: var(--primary);
  background: var(--primary-ultra);
}
.calendar-day.today .calendar-day-number {
  color: var(--primary);
  font-weight: 800;
}

/* Today pulsing ring */
.calendar-day.today::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-md);
  border: 2px solid var(--primary);
  opacity: 0.3;
  animation: todayPulse 2s ease-in-out infinite;
  pointer-events: none;
}

/* Weekend */
.calendar-day.weekend .calendar-day-number {
  color: var(--text-muted);
}

/* ─── ACTIVITY LEVELS ─── */

/* Has any activity (base) */
.calendar-day.has-activity .calendar-day-indicator {
  opacity: 1;
}

/* Level 1 – light activity (1-5 MCQs) */
.calendar-day.activity-1 {
  background: rgba(16,185,129,.08);
}
.calendar-day.activity-1 .calendar-day-indicator {
  background: rgba(16,185,129,.3);
}

/* Level 2 – moderate (6-10 MCQs) */
.calendar-day.activity-2 {
  background: rgba(16,185,129,.15);
}
.calendar-day.activity-2 .calendar-day-indicator {
  background: rgba(16,185,129,.5);
}

/* Level 3 – good (11-15 MCQs) */
.calendar-day.activity-3 {
  background: rgba(16,185,129,.22);
}
.calendar-day.activity-3 .calendar-day-indicator {
  background: rgba(16,185,129,.7);
}

/* Level 4 – excellent (16-19 MCQs) */
.calendar-day.activity-4 {
  background: rgba(16,185,129,.30);
}
.calendar-day.activity-4 .calendar-day-indicator {
  background: var(--primary);
}
.calendar-day.activity-4 .calendar-day-number {
  color: var(--primary-dark);
}

/* Level 5 – daily goal met (20+ MCQs / streak day) */
.calendar-day.activity-5 {
  background: var(--primary);
}
.calendar-day.activity-5 .calendar-day-number {
  color: #fff;
  font-weight: 800;
}
.calendar-day.activity-5 .calendar-day-indicator {
  background: rgba(255,255,255,.6);
}
.calendar-day.activity-5:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Streak day (completed daily goal — glowing) */
.calendar-day.streak-day {
  background: var(--primary);
  box-shadow: 0 2px 10px rgba(16,185,129,.35);
}
.calendar-day.streak-day .calendar-day-number {
  color: #fff;
}
.calendar-day.streak-day::before {
  content: '🔥';
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 10px;
  line-height: 1;
  z-index: 2;
}

/* Missed day */
.calendar-day.missed {
  background: rgba(239,68,68,.06);
}
.calendar-day.missed .calendar-day-number {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(239,68,68,.4);
}
.calendar-day.missed .calendar-day-indicator {
  opacity: 1;
  background: var(--danger);
  width: 4px;
  height: 4px;
}

/* Selected day (clicked for detail) */
.calendar-day.selected {
  border-color: var(--secondary);
  background: var(--secondary-pale);
  box-shadow: var(--shadow-focus);
}
.calendar-day.selected .calendar-day-number {
  color: var(--secondary);
}

/* Future dates */
.calendar-day.future {
  opacity: 0.35;
  cursor: default;
}
.calendar-day.future:hover {
  background: transparent;
  border-color: transparent;
}

/* ─────────────────────────────────────────────────────────────
   STREAK CONNECTION LINES
   Visually connects consecutive streak days
───────────────────────────────────────────────────────────── */
.calendar-day.streak-day.streak-connect-right::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  width: 8px;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
  transform: translateY(-50%);
  z-index: 0;
  animation: none;
}
/* Override the today pulse for streak days */
.calendar-day.streak-day.today::after {
  content: '';
  border: 2px solid #fff;
  inset: -2px;
  opacity: 0.5;
}

/* ─────────────────────────────────────────────────────────────
   CALENDAR LEGEND
───────────────────────────────────────────────────────────── */
.calendar-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.legend-color.level-0 { background: var(--bg-tertiary); }
.legend-color.level-1 { background: rgba(16,185,129,.12); }
.legend-color.level-2 { background: rgba(16,185,129,.22); }
.legend-color.level-3 { background: rgba(16,185,129,.38); }
.legend-color.level-4 { background: rgba(16,185,129,.58); }
.legend-color.level-5 { background: var(--primary); border-color: var(--primary); }

.legend-label-less,
.legend-label-more {
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   WEEKLY MINI HEATMAP
   GitHub-style mini view for compact spaces
───────────────────────────────────────────────────────────── */
.streak-mini-heatmap {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.mini-heatmap-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.mini-heatmap-grid {
  display: flex;
  gap: 3px;
  flex: 1;
  justify-content: flex-end;
}

.mini-heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mini-heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  transition: transform var(--duration-fast) var(--ease-spring);
  cursor: pointer;
  position: relative;
}
.mini-heatmap-cell:hover {
  transform: scale(1.6);
  z-index: 2;
}

/* Heatmap cell levels */
.mini-heatmap-cell.h-0 { background: var(--bg-tertiary); }
.mini-heatmap-cell.h-1 { background: rgba(16,185,129,.15); }
.mini-heatmap-cell.h-2 { background: rgba(16,185,129,.30); }
.mini-heatmap-cell.h-3 { background: rgba(16,185,129,.50); }
.mini-heatmap-cell.h-4 { background: rgba(16,185,129,.70); }
.mini-heatmap-cell.h-5 { background: var(--primary); }

/* Heatmap tooltip */
.mini-heatmap-cell[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease);
  z-index: 10;
}
.mini-heatmap-cell[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--gray-900);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease);
  z-index: 10;
}
.mini-heatmap-cell[data-tooltip]:hover::after,
.mini-heatmap-cell[data-tooltip]:hover::before {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────
   STREAK MILESTONES
───────────────────────────────────────────────────────────── */
.streak-milestones {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.milestones-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.milestones-title i { color: var(--accent); }

.milestones-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  padding: var(--space-2) 0;
}

/* The line connecting milestones */
.milestones-line {
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-full);
  transform: translateY(-50%);
  z-index: 0;
}

.milestones-line-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease);
}

/* Individual milestone node */
.milestone {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.milestone-node {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  border: 3px solid var(--border);
  background: var(--surface);
  transition: all var(--duration-base) var(--ease-spring);
  cursor: pointer;
  position: relative;
}
.milestone-node:hover {
  transform: scale(1.15);
}

/* Locked milestone */
.milestone.locked .milestone-node {
  background: var(--bg-tertiary);
  color: var(--text-faint);
  border-color: var(--border);
}

/* Unlocked / active */
.milestone.unlocked .milestone-node {
  background: var(--primary-pale);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(16,185,129,.25);
}

/* Current milestone (in progress) */
.milestone.current .milestone-node {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245,158,11,.15);
  animation: milestonePulse 2s ease-in-out infinite;
}

/* Completed milestone */
.milestone.completed .milestone-node {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.milestone-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}
.milestone.unlocked .milestone-label,
.milestone.completed .milestone-label {
  color: var(--text);
}
.milestone.current .milestone-label {
  color: var(--accent-dark);
  font-weight: 700;
}

.milestone-days {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   DAY DETAIL PANEL
   Slides up when a calendar day is clicked
───────────────────────────────────────────────────────────── */
.day-detail-panel {
  padding: 0 var(--space-6);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease),
              padding var(--duration-slow) var(--ease);
  border-top: 0 solid var(--border);
}
.day-detail-panel.open {
  max-height: 300px;
  padding: var(--space-5) var(--space-6);
  border-top-width: 1px;
}

.day-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.day-detail-date {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
}

.day-detail-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  transition: background var(--duration-fast) var(--ease);
}
.day-detail-close:hover { background: var(--bg-tertiary); }

.day-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.day-stat {
  text-align: center;
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.day-stat-value {
  display: block;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.day-stat-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-detail-subjects {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.day-subject-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-3);
  background: var(--primary-pale);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary-dark);
}
.day-subject-tag i { font-size: 10px; }

/* ─────────────────────────────────────────────────────────────
   STREAK FREEZE / SHIELD
───────────────────────────────────────────────────────────── */
.streak-freeze-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--info);
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-top: 1px solid rgba(255,255,255,.15);
}

.streak-freeze-icon {
  font-size: var(--text-xl);
  color: rgba(255,255,255,.9);
}

.streak-freeze-text {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255,255,255,.9);
}
.streak-freeze-text strong { color: #fff; }

.streak-freeze-count {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(8px);
}

/* Calendar day with freeze used */
.calendar-day.freeze-used {
  background: rgba(59,130,246,.08);
}
.calendar-day.freeze-used .calendar-day-number {
  color: var(--info);
}
.calendar-day.freeze-used::before {
  content: '🛡️';
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 10px;
  line-height: 1;
}

/* ─────────────────────────────────────────────────────────────
   STREAK CELEBRATION OVERLAY
───────────────────────────────────────────────────────────── */
.streak-celebration {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease);
}
.streak-celebration.active {
  opacity: 1;
  pointer-events: all;
}

.celebration-card {
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-8);
  max-width: 400px;
  width: 100%;
  margin: var(--space-4);
  box-shadow: var(--shadow-2xl);
  transform: scale(0.85);
  transition: transform var(--duration-slow) var(--ease-spring);
}
.streak-celebration.active .celebration-card {
  transform: scale(1);
}

.celebration-emoji {
  font-size: 5rem;
  animation: bounceIn 0.8s var(--ease-spring) both;
}

.celebration-title {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--text);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}
.celebration-title .text-primary { color: var(--primary); }

.celebration-subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.celebration-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, #ff6b35, #f7421e);
  color: #fff;
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-lg);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(247,66,30,.3);
  margin-bottom: var(--space-6);
}

.celebration-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ─────────────────────────────────────────────────────────────
   STREAK ANIMATIONS
───────────────────────────────────────────────────────────── */
@keyframes fireFlicker {
  0%   { transform: scale(1)   rotate(0deg);   filter: drop-shadow(0 2px 8px rgba(255,107,53,.6)); }
  25%  { transform: scale(1.05) rotate(-2deg); filter: drop-shadow(0 3px 12px rgba(255,165,0,.5)); }
  50%  { transform: scale(1.1)  rotate(1deg);  filter: drop-shadow(0 4px 14px rgba(255,107,53,.7)); }
  75%  { transform: scale(1.03) rotate(-1deg); filter: drop-shadow(0 3px 10px rgba(255,165,0,.4)); }
  100% { transform: scale(1)   rotate(0deg);   filter: drop-shadow(0 2px 8px rgba(255,107,53,.6)); }
}

@keyframes firePulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.2); }
}

@keyframes todayPulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.1; }
}

@keyframes milestonePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245,158,11,.15); }
  50%       { box-shadow: 0 0 0 8px rgba(245,158,11,.08); }
}

@keyframes streakCount {
  0%   { transform: scale(1);   }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1);   }
}

.streak-number.animate {
  animation: streakCount 0.5s var(--ease-spring);
}

/* ─────────────────────────────────────────────────────────────
   DARK MODE – STREAK OVERRIDES
───────────────────────────────────────────────────────────── */
[data-theme="dark"] .streak-container {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .streak-header {
  background: linear-gradient(135deg, #c2410c 0%, #b91c1c 50%, #c2410c 100%);
}

[data-theme="dark"] .calendar-nav {
  background: var(--surface-2);
  border-color: var(--border);
}
[data-theme="dark"] .calendar-nav-btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .calendar-day:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
[data-theme="dark"] .calendar-day.today {
  background: var(--primary-pale);
  border-color: var(--primary);
}
[data-theme="dark"] .calendar-day.activity-5,
[data-theme="dark"] .calendar-day.streak-day {
  background: var(--primary-dark);
}

[data-theme="dark"] .calendar-day.missed {
  background: rgba(239,68,68,.08);
}

[data-theme="dark"] .calendar-legend {
  border-color: var(--border);
}
[data-theme="dark"] .legend-color {
  border-color: var(--border);
}
[data-theme="dark"] .legend-color.level-0 {
  background: var(--surface-2);
}

[data-theme="dark"] .streak-milestones {
  background: var(--surface-2);
  border-color: var(--border);
}
[data-theme="dark"] .milestone-node {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .milestone.locked .milestone-node {
  background: var(--surface-2);
}
[data-theme="dark"] .milestone.completed .milestone-node {
  background: var(--primary);
  border-color: var(--primary);
}
[data-theme="dark"] .milestones-line {
  background: var(--border);
}

[data-theme="dark"] .streak-mini-heatmap {
  background: var(--surface-2);
  border-color: var(--border);
}
[data-theme="dark"] .mini-heatmap-cell.h-0 { background: var(--surface-3); }

[data-theme="dark"] .mini-heatmap-cell[data-tooltip]::after {
  background: #fff;
  color: var(--gray-900);
}
[data-theme="dark"] .mini-heatmap-cell[data-tooltip]::before {
  border-top-color: #fff;
}

[data-theme="dark"] .day-detail-panel {
  border-color: var(--border);
}
[data-theme="dark"] .day-stat {
  background: var(--surface-2);
  border-color: var(--border);
}

[data-theme="dark"] .celebration-card {
  background: var(--surface);
}

[data-theme="dark"] .streak-freeze-banner {
  background: linear-gradient(135deg, #1d4ed8, #0e7490);
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE – STREAK CALENDAR
───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .streak-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
  }

  .streak-header-right {
    align-self: stretch;
    justify-content: space-between;
  }

  .streak-stats-mini { gap: var(--space-6); }

  .calendar-nav { padding: var(--space-3) var(--space-4); }

  .calendar-grid-wrapper { padding: var(--space-3) var(--space-3) var(--space-4); }

  .calendar-day {
    min-height: 38px;
    border-radius: var(--radius-sm);
  }
  .calendar-day-number { font-size: var(--text-xs); }
  .calendar-day-indicator { width: 5px; height: 5px; margin-top: 3px; }
  .calendar-day-badge { min-width: 16px; height: 16px; font-size: 8px; }

  .calendar-day.streak-day::before { font-size: 8px; }
  .calendar-day.freeze-used::before { font-size: 8px; }

  .calendar-legend {
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
  }

  /* Milestones become horizontal scroll */
  .milestones-track {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-3) 0;
    scroll-snap-type: x mandatory;
  }
  .milestone { min-width: 70px; scroll-snap-align: center; }
  .milestone-node { width: 36px; height: 36px; font-size: var(--text-base); }

  /* Day detail */
  .day-detail-stats { grid-template-columns: repeat(2, 1fr); }

  .day-detail-panel { padding: 0 var(--space-4); }
  .day-detail-panel.open { padding: var(--space-4); }

  /* Freeze banner */
  .streak-freeze-banner { padding: var(--space-3) var(--space-4); }

  /* Celebration */
  .celebration-card { padding: var(--space-8) var(--space-5); }
  .celebration-emoji { font-size: 4rem; }
  .celebration-title { font-size: var(--text-2xl); }
}

@media (max-width: 480px) {
  .streak-fire { width: 44px; height: 44px; }
  .streak-fire-icon { font-size: 1.8rem; }
  .streak-number { font-size: var(--text-2xl); }

  .streak-best { padding: var(--space-1) var(--space-2); }
  .streak-best-text { font-size: 10px; }

  .calendar-day { min-height: 34px; }

  /* Legend compact */
  .legend-item span { display: none; }
  .calendar-legend { gap: var(--space-2); }

  /* Milestones compact */
  .milestone-node { width: 32px; height: 32px; font-size: var(--text-sm); }
  .milestone-label { font-size: 10px; }
  .milestone-days { display: none; }

  /* Streak stats hide less-critical ones */
  .streak-stat-mini:nth-child(n+3) { display: none; }

  /* Mini heatmap cells smaller */
  .mini-heatmap-cell { width: 10px; height: 10px; }
}
/* ═══════════════════════════════════════════════════════════════
   Dr.MCQ – Bookmarks Page
   css/bookmarks.css

   TABLE OF CONTENTS
   ─────────────────
   01. Page Header
   02. Toolbar (search + filters + view toggle)
   03. Active Filter Chips
   04. Collection / Folder Tabs
   05. Subject Quick-Filter Chips
   06. Selection Bar (bulk actions)
   07. Progress Banner
   08. Cards Grid & List Layout
   09. Bookmark Card (grid view)
   10. Bookmark Card (list view)
   11. Card States (correct / wrong / unanswered)
   12. Card Options (expanded)
   13. Card Tags
   14. Tag Picker Dropdown
   15. Empty State
   16. No Results State
   17. Skeleton Loader
   18. Load More
   19. Stats Panel (slide-in sidebar)
   20. Donut Chart
   21. Stats FAB
   22. Delete Modal
   23. Animations
   24. Dark Mode
   25. Responsive – Tablet (≤ 1024px)
   26. Responsive – Mobile (≤ 768px)
   27. Responsive – Small (≤ 480px)
═══════════════════════════════════════════════════════════════ */
