/* --- Desktop Hide Rules for Mobile Elements --- */
.mobile-hamburger { display: none !important; }
.sidebar-overlay { display: none !important; }

/**
 * style.css - Main Application Stylesheet for Hexorexa
 * 
 * Covers all styling for the app dashboard, sidebar, 
 * curriculum view, study notes, quizzes, modals, and 
 * the premium subscription system.
 * 
 * Design system:
 *   - Dark theme with blue (#3b82f6) and purple (#8b5cf6) accents
 *   - CSS custom properties for theming (--bg, --surface, --text, etc.)
 *   - Responsive breakpoints: 768px (tablet), 480px (mobile)
 *   - Font: Inter (Google Fonts) with system fallbacks
 * 
 * Sections:
 *   1. CSS Variables & Reset
 *   2. Layout (sidebar, main content, mobile header)
 *   3. Dashboard cards & progress rings
 *   4. Curriculum & lecture lists
 *   5. Study Notes & chapter content
 *   6. Quiz cards & answers
 *   7. Modals (YouTube, Notes, Auth)
 *   8. Premium system (blur, overlays)
 *   9. Enhanced content readability
 *   10. Responsive media queries
 */
/* 
   EmbedIQ - Premium Dark Theme v4.0
   
    */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Core backgrounds */
  --bg:          #080c14;
  --bg2:         #0d1220;
  --bg3:         #111827;
  --bg4:         #141e30;
  --sidebar:     #090d18;
  --card:        #0f1624;
  --card2:       #131d2e;
  --card-hover:  #192338;
  --surface:     #141c28;
  --surface-2:   #1a2438;

  /* Borders */
  --border:      rgba(255,255,255,.06);
  --border2:     rgba(255,255,255,.11);
  --border3:     rgba(255,255,255,.18);

  /* Brand colors */
  --accent:      #3b82f6;
  --accent2:     #60a5fa;
  --accent3:     #93c5fd;
  --green:       #10b981;
  --green2:      #34d399;
  --purple:      #8b5cf6;
  --purple2:     #a78bfa;
  --yellow:      #f59e0b;
  --yellow2:     #fbbf24;
  --red:         #ef4444;
  --red2:        #f87171;
  --cyan:        #06b6d4;

  /* Text */
  --text-primary:   #f1f5ff;
  --text-main:      #e2e8f0;
  --text-secondary: #94a3b8;
  --text-sub:       #94a3b8;
  --text-muted:     #55657d;
  --text-xmuted:    #3d5070;

  /* Fonts */
  --font:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:   'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Radii */
  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 5px;

  /* Shadows */
  --shadow:    0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.7);
  --shadow-card: 0 2px 8px rgba(0,0,0,.3), 0 0 1px rgba(255,255,255,.05);

  /* Transitions */
  --transition: all .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .35s cubic-bezier(.4,0,.2,1);

  /* Gradients */
  --grad-blue:   linear-gradient(135deg, #3b82f6, #6366f1);
  --grad-green:  linear-gradient(135deg, #10b981, #06b6d4);
  --grad-purple: linear-gradient(135deg, #8b5cf6, #ec4899);
  --grad-gold:   linear-gradient(135deg, #f59e0b, #ef4444);
  --grad-brand:  linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Ambient glow background component */
body::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
body::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(139,92,246,0.05) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
}

/*  Layout  */
.app-container { display: flex; height: 100vh; overflow: hidden; }

/*  Sidebar  */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: rgba(9, 13, 24, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding-bottom: 5rem;
  position: relative;
}
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad-brand);
  opacity: .6;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Logo / Brand */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.2rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .25rem;
}
.logo-mark {
  width: 36px; height: 36px;
  background: var(--grad-brand);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59,130,246,.35);
}
.logo-name {
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.3px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub {
  font-size: .62rem;
  color: var(--text-muted);
  display: block;
  margin-top: -.05rem;
}

/* Sidebar search */
.sidebar-search {
  padding: .75rem .75rem .25rem;
  position: relative;
}
.search-input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: .45rem .75rem;
  font-size: .8rem;
  color: var(--text-main);
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}
.search-input:focus {
  border-color: rgba(59,130,246,.5);
  background: rgba(59,130,246,.08);
}
.search-input::placeholder { color: var(--text-muted); }

.search-dropdown {
  position: absolute;
  top: 100%;
  left: .75rem; right: .75rem;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

/* Nav */
.nav-section-label {
  font-size: .6rem;
  font-weight: 700;
  color: var(--text-xmuted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  padding: .9rem 1rem .2rem;
}

.nav-links { list-style: none; padding: 0 .6rem; }
.nav-links li a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .52rem .75rem;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: -.1px;
}
.nav-links li a:hover {
  background: rgba(255,255,255,.05);
  color: var(--text-main);
}
.nav-links li.active a {
  background: linear-gradient(135deg, rgba(59,130,246,.18) 0%, rgba(139,92,246,.12) 100%);
  color: var(--accent3);
  border: 1px solid rgba(59,130,246,.22);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59,130,246,.1);
}
.nav-icon { font-size: .9rem; width: 18px; text-align: center; flex-shrink: 0; }

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--sidebar);
}

/*  Content area  */
.content-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#view-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

/*  Progress bar  */
.progress-bar-wrapper {
  width: 160px; height: 6px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--grad-blue);
  border-radius: 99px;
  transition: width .6s ease;
}

/*  Glass Cards  */
.stat-card {
  background: rgba(15, 22, 36, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.1), transparent);
}
.stat-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-card h3 {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: .65rem;
}
.stat-card .value { font-size: 2.1rem; font-weight: 800; color: var(--accent3); line-height: 1; }

/* Course cards */
.course-card {
  background: rgba(15, 22, 36, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.4rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.course-card:hover {
  background: rgba(25, 35, 56, 0.8);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(59, 130, 246, 0.15);
}
.course-card h3 { font-size: .9rem; font-weight: 700; color: var(--text-primary); margin-bottom: .35rem; }
.course-card p { font-size: .78rem; color: var(--text-secondary); line-height: 1.55; }

/* Generic card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.card:hover { border-color: var(--border2); }

/*  Badges  */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .6rem;
  border-radius: 99px;
  font-size: .67rem;
  font-weight: 700;
  background: rgba(255,255,255,.07);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,.1);
  letter-spacing: .2px;
}
.badge.critical { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }
.badge.hard     { background: rgba(245,158,11,.15); color: #fbbf24; border-color: rgba(245,158,11,.3); }
.badge.medium   { background: rgba(59,130,246,.15); color: #93c5fd; border-color: rgba(59,130,246,.3); }
.badge.easy     { background: rgba(16,185,129,.15); color: #34d399; border-color: rgba(16,185,129,.3); }

/* Nav badge */
.nav-badge {
  font-size: .55rem;
  padding: .1rem .3rem;
  background: rgba(239,68,68,.9);
  color: #fff;
  border-radius: 4px;
  margin-left: auto;
  letter-spacing: .03em;
  font-weight: 700;
}

/*  Buttons  */
.btn-small {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .32rem .75rem;
  border-radius: 6px;
  background: rgba(59,130,246,.12);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,.25);
  font-size: .75rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}
.btn-small:hover {
  background: rgba(59,130,246,.22);
  border-color: rgba(59,130,246,.45);
  color: #bfdbfe;
}
.btn-primary {
  background: var(--grad-blue);
  color: white;
  border: none;
  padding: .5rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  box-shadow: 0 4px 12px rgba(59,130,246,.3);
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,.4); }
.btn-secondary {
  background: rgba(255,255,255,.06);
  color: var(--text-secondary);
  border: 1px solid var(--border2);
  padding: .5rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: .82rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}
.btn-secondary:hover { background: rgba(255,255,255,.1); color: var(--text-primary); }
.back-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border2);
  color: var(--text-secondary);
  padding: .38rem .9rem;
  border-radius: 7px;
  font-size: .8rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  font-weight: 500;
}
.back-btn:hover { background: rgba(255,255,255,.1); color: var(--text-main); border-color: var(--border3); }

/*  Dashboard grid  */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }

/*  Lecture list  */
.lecture-list { display: flex; flex-direction: column; gap: .5rem; }
.lecture-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  transition: var(--transition);
}
.lecture-item:hover { background: var(--card-hover); border-color: var(--border2); }
.lecture-item.completed { border-left: 3px solid var(--green); }
.lecture-item.completed .lecture-title { color: var(--text-muted); text-decoration: line-through; }

.checkbox-wrapper { flex-shrink: 0; }
.custom-checkbox { width: 18px; height: 18px; border-radius: 5px; cursor: pointer; accent-color: var(--green); }

.lecture-details { flex: 1; min-width: 0; }
.lecture-title { font-size: .85rem; font-weight: 500; color: var(--text-main); display: block; margin-bottom: .3rem; }
.lecture-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.resource-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.lecture-list-header { margin-bottom: 1rem; }

/*  Circular progress chart  */
.circular-chart { width: 100px; margin: 0 auto .5rem; }
.circle-bg { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 3.8; }
.circle { fill: none; stroke-width: 3.8; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray .8s ease; }
.percentage { fill: var(--text-main); font-size: 6px; font-family: var(--font); font-weight: 700; text-anchor: middle; }

/*  YOUTUBE MODAL - Large near-fullscreen  */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  backdrop-filter: blur(12px);
  z-index: 2001;
  align-items: center;
  justify-content: center;
  animation: fadeInModal .2s ease;
  padding: .5rem .75rem;
}
.modal-overlay.active { display: flex; }
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 1.25rem;
  width: min(1100px, 96vw);
  max-height: 93vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s cubic-bezier(.22,1,.36,1);
  display: flex;
  flex-direction: column;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* YT-specific modal - even larger */
.yt-modal-box {
  width: min(1200px, 96vw);
  max-height: 95vh;
  padding: .5rem .75rem;
}
.yt-iframe-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  flex: 1;
}
.yt-iframe-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: .75rem;
}
.modal-header h3 { font-size: .95rem; font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  font-family: var(--font);
}
.modal-close:hover { background: rgba(239,68,68,.2); color: #f87171; border-color: rgba(239,68,68,.3); }

/* Godbolt modal */
.godbolt-modal-box { max-width: 96vw; width: 1200px; max-height: 92vh; }
.notes-modal-box   { max-width: 820px; width: 95vw; }
.notes-modal-body  { padding: 1.25rem; max-height: 75vh; overflow-y: auto; }
.test-modal-box    { max-width: 700px; width: 95vw; }
.test-modal-body   { padding: 1.25rem; max-height: 72vh; overflow-y: auto; }

/*  Code Editor  */
.code-editor-container { display: flex; flex-direction: column; height: calc(100vh - 120px); gap: .75rem; }
.editor-toolbar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .75rem 1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.lang-select {
  background: rgba(255,255,255,.07); border: 1px solid var(--border2);
  color: var(--text-main); padding: .35rem .75rem; border-radius: 6px; cursor: pointer;
  font-family: var(--font); font-size: .8rem;
}
.run-btn {
  background: var(--grad-green); color: white; border: none; padding: .4rem 1rem; border-radius: 6px;
  font-weight: 600; font-size: .82rem; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: .4rem; font-family: var(--font);
  box-shadow: 0 3px 10px rgba(16,185,129,.25);
}
.run-btn:hover { opacity: .9; transform: translateY(-1px); }
.run-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.snippet-btn {
  background: rgba(139,92,246,.15); border: 1px solid rgba(139,92,246,.3);
  color: #a78bfa; padding: .3rem .7rem; border-radius: 6px;
  font-size: .75rem; cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.snippet-btn:hover { background: rgba(139,92,246,.25); }
#monaco-editor-mount { flex: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 300px; }
.output-panel {
  background: #08101a; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; font-family: var(--mono); font-size: .78rem; color: #e2e8f0;
  min-height: 80px; max-height: 180px; overflow-y: auto; white-space: pre-wrap; line-height: 1.7;
}
.output-panel .out-success { color: #34d399; }
.output-panel .out-error   { color: #f87171; }
.output-panel .out-meta    { color: var(--text-muted); font-size: .72rem; }

/*  Chapter tabs  */
.chapter-tabs-bar { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.chapter-tab {
  padding: .35rem .95rem; border-radius: 20px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text-muted); font-size: .78rem; font-weight: 500;
  cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.chapter-tab:hover { background: rgba(255,255,255,.06); color: var(--text-main); }
.chapter-tab.active { background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.4); color: #93c5fd; font-weight: 600; }
.chapter-tab.quiz-tab { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #fbbf24; }
.chapter-tab.quiz-tab.active { background: rgba(245,158,11,.2); }

/*  Study notes typography  */
.study-notes { font-size: .9rem; line-height: 1.85; color: var(--text-secondary); max-width: 820px; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.study-notes .md-h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 2rem 0 .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.study-notes .md-h4 { font-size: .95rem; font-weight: 600; color: var(--accent2); margin: 1.25rem 0 .5rem; }
.study-notes p, .study-notes .md-para { color: var(--text-secondary); line-height: 1.85; margin: .6rem 0; }
.study-notes strong { color: var(--text-primary); font-weight: 600; }

/* Code blocks */
.code-block { background: #060e1a; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; margin: 1rem 0; overflow-x: auto; position: relative; }
.code-block-header { padding: .5rem 1rem; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.07); font-size: .7rem; color: var(--text-muted); font-family: var(--mono); display: flex; align-items: center; justify-content: space-between; }
.code-block code { display: block; padding: 1rem 1.25rem; font-family: var(--mono); font-size: .78rem; line-height: 1.7; color: #e2e8f0; white-space: pre; }
.code-block code .kw  { color: #ff7b72; }
.code-block code .cm  { color: #8b949e; font-style: italic; }
.code-block code .str { color: #a5d6ff; }
.inline-code { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); border-radius: 4px; padding: .1em .45em; font-family: var(--mono); font-size: .82em; color: #fcd34d; }

/* Tables */
.md-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .83rem; border-radius: 10px; overflow: hidden; }
.md-table th, .md-table td { padding: .65rem .9rem; text-align: left; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.md-table th { background: rgba(255,255,255,.05); color: var(--text-primary); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
.md-table tr:hover td { background: rgba(255,255,255,.03); }

/*  Quiz cards  */
.quiz-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .875rem;
  transition: var(--transition);
}
.quiz-card:hover { border-color: var(--border2); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.quiz-question { font-size: 1rem; font-weight: 600; color: var(--text-primary); line-height: 1.75; letter-spacing: -0.01em; }
.quiz-num { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; flex-shrink: 0; }
.quiz-diff-badge { font-size: .65rem; padding: .12rem .45rem; border-radius: 99px; font-weight: 600; }
.diff-basic  { background: rgba(16,185,129,.15);  color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.diff-inter  { background: rgba(245,158,11,.15);  color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.diff-expert { background: rgba(239,68,68,.15);   color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.quiz-ans {
  background: rgba(16,185,129,.04);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  font-size: .92rem;
  color: var(--text-main);
  line-height: 1.85;
  display: none;
  border-left: 4px solid var(--accent);
  animation: fadeIn .2s ease;
  letter-spacing: -0.005em;
}
.quiz-ans.visible { display:block!important; }
.quiz-btn {
  align-self: flex-start;
  padding: .45rem 1.1rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  border: 1px solid;
  background: transparent;
}
.quiz-btn:hover { opacity: .85; transform: translateY(-1px); }

/*  Expert tip callout  */
.expert-tip {
  border-radius: 10px; padding: .875rem 1.1rem; margin-bottom: 1.25rem;
  font-size: .83rem; line-height: 1.6; display: flex; gap: .75rem; align-items: flex-start;
}
.expert-tip-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.expert-tip-text { color: var(--text-secondary); }
.expert-tip-text strong { font-weight: 600; }

/*  Global search  */
.global-search {
  display: flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.06); border: 1px solid var(--border2);
  border-radius: 8px; padding: .4rem .75rem; margin: 0 .5rem .75rem;
}
.global-search input { background: none; border: none; outline: none; color: var(--text-main); font-size: .82rem; font-family: var(--font); width: 100%; }
.global-search input::placeholder { color: var(--text-muted); }

/*  Premium Streak UI  */
.streak-bar { background: var(--surface-2); border: 1px solid rgba(255,255,255,.05); border-radius: 14px; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; box-shadow: 0 4px 15px rgba(0,0,0,.2); }
.streak-days { display: flex; gap: .4rem; }
.streak-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); border: 1px solid rgba(255,255,255,.1); transition: all .3s ease; }
.streak-dot.done { background: linear-gradient(135deg, #10b981, #059669); border-color: #34d399; box-shadow: 0 0 8px rgba(16,185,129,.3); }
.streak-dot.today { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: #fbbf24; box-shadow: 0 0 12px rgba(245,158,11,.6); transform: scale(1.2); }
.streak-widget { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }

/*  Scrollbar  */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }

/*  LeetCode input  */
.lc-input { width: 55px; padding: .3rem .5rem; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--border2); color: var(--text-main); text-align: center; font-family: var(--mono); font-size: .82rem; }

/*  Course meta / tags  */
.course-meta { display: flex; gap: .5rem; flex-wrap: wrap; }

/*  Phase 3 - Section-specific styles  */
/* Interview Hub / Roadmap */
.co-btn:hover { opacity:.85; transform:translateY(-1px); }
.cat-btn { transition:all .2s; cursor:pointer; border:none; font-family:var(--font); }

/* Fun Mode flashcards */
.fc-card-flip { animation: cardFlip .3s ease; }
@keyframes cardFlip { 0%{transform:scaleY(1)} 50%{transform:scaleY(.95)} 100%{transform:scaleY(1)} }

/* Notes modal sizes */
#notes-modal .modal-box { max-width:820px; width:95vw; }
#notes-modal .study-notes { font-size:.88rem; }

/* Salary charts */
.salary-legend { display:flex; gap:1.25rem; font-size:.72rem; color:var(--text-muted); margin-top:.5rem; }
.salary-table { width:100%;border-collapse:collapse;font-size:.8rem; }
.salary-table th { padding:.55rem .9rem;background:rgba(255,255,255,.05);font-weight:600;text-align:left;border-bottom:1px solid var(--border2);font-size:.72rem;text-transform:uppercase;letter-spacing:.5px; }
.salary-table td { padding:.55rem .9rem;border-bottom:1px solid var(--border);color:var(--text-secondary); }
.salary-table tr:hover td { background:rgba(255,255,255,.03); }

/* Speed quiz */
@keyframes pulse-red { 0%,100%{opacity:1} 50%{opacity:.7} }
.timer-pulse { animation:pulse-red .6s infinite; }
#fc-card:hover { box-shadow:0 8px 32px rgba(0,0,0,.4); }
.roulette-card-enter { animation:slideUp .4s cubic-bezier(.22,1,.36,1); }

/* Difficulty colors */
.diff-medium { background:rgba(245,158,11,.15); color:#fbbf24; border:1px solid rgba(245,158,11,.3); }
.salary-row:hover .salary-bar { filter:brightness(1.2); }

/* Hidden/Visible */
.hidden { display:none!important; }
.joke-ans.visible { display:block!important; }

/* Match game */
.match-card { user-select:none; }
.match-card[data-matched] { pointer-events:none; opacity:.8; }

/* Page header */
.page-header { margin-bottom:1.75rem; }
.page-title { font-size:1.4rem; font-weight:800; margin:0 0 .3rem; color:var(--text-primary); letter-spacing:-.3px; }
.page-sub { font-size:.85rem; color:var(--text-muted); margin:0; }

/* Skill dots */
.skill-dot { display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:2px; }

/* Fill blanks */
.fb-btn { font-family:var(--font); transition:all .2s; }

/* App footer */
.app-footer { padding:.75rem 2rem; text-align:center; font-size:.72rem; color:var(--text-muted); border-top:1px solid var(--border); background:var(--bg2); }
.app-footer a { color:var(--accent2); text-decoration:none; }
.app-footer strong { color:var(--text-secondary); }

/* Copy button */
.btn-copy { font-size:.72rem; padding:.25rem .6rem; border-radius:5px; }

/* Notes btn */
.notes-btn { transition:all .2s; }
.notes-btn:hover { background:rgba(59,130,246,.25)!important; }



/*  Premium Sidebar Footer & Streak  */
.sidebar-footer {
  margin-top: auto;
  padding: 1.25rem 1rem;
  background: var(--sidebar);
  z-index: 10;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.streak-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 1.5rem 0.5rem 1.5rem;
  padding: 0.6rem 0.8rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 10px;
}

.streak-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fbbf24;
  margin: 0;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.streak-label span { font-size: .95rem; }

.streak-widget {
  display: flex;
  gap: 4px;
  margin: 0;
}
.streak-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-3); border: 1px solid rgba(255,255,255,.1); transition: all .3s cubic-bezier(0.4, 0, 0.2, 1); }
.streak-dot.done { background: linear-gradient(135deg, #10b981, #059669); border-color: #34d399; box-shadow: 0 0 6px rgba(16,185,129,.4); }
.streak-dot.today { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: #fbbf24; box-shadow: 0 0 10px rgba(245,158,11,.8); transform: scale(1.3); }

/* Fix overlapping sidebar bug */
.sidebar-nav {
  padding-bottom: 200px !important;
}
.sidebar-footer {
  box-shadow: 0 -10px 20px rgba(0,0,0,0.5);
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.1); }
  50% { transform: scale(1); }
  75% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* --- MARKDOWN STUDY NOTES STYLING --- */
.study-notes {
  color: var(--text-main);
  line-height: 1.85;
  font-size: 1rem;
  max-width: 850px;
  word-spacing: 0.02em;
}
.md-h3 {
  font-size: 1.5rem;
  color: #fff;
  margin-top: 2.75rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  letter-spacing: -0.02em;
}
.md-h4 {
  font-size: 1.2rem;
  color: #60a5fa;
  margin-top: 1.75rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
}
.md-para {
  margin-bottom: 1.35rem;
  color: var(--text-secondary);
  line-height: 1.9;
}
.md-para strong {
  color: #fff;
  font-weight: 600;
}
.inline-code {
  background: rgba(255, 255, 255, 0.1);
  color: #fca5a5;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.9em;
}
.code-block {
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.code-block-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--mono);
}
.code-block code {
  display: block;
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: #e5e5e5;
  white-space: pre-wrap;
  overflow-x: auto;
  line-height: 1.5;
}
.md-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.5rem;
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.md-table td, .md-table th {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.md-table td:last-child {
  border-right: none;
}
.md-table tr:first-child td {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.md-table tr:last-child td {
  border-bottom: none;
}


/*  Premium System  */
.premium-blur-active {
  position: relative;
  overflow: hidden;
}
.premium-blur-active > *:not(.premium-overlay) {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.premium-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 13, 0.6);
  backdrop-filter: blur(2px);
  z-index: 50;
  border-radius: var(--radius);
}
.premium-badge-sidebar {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .65rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(239,68,68,.15));
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,.25);
}


/*  Enhanced Content Readability  */
/* Optimized typography for long-form reading. Uses research-backed
   line-height, spacing, and contrast ratios for comfortable study sessions */
.study-notes,
.notes-modal-content,
.lecture-notes-content {
  font-size: 1rem;
  line-height: 1.9;
  color: #d4d8e0;
  letter-spacing: 0.01em;
  word-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings within notes - clear hierarchy for scanability */
.study-notes h2,
.notes-modal-content h2,
.lecture-notes-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.study-notes h3,
.notes-modal-content h3,
.lecture-notes-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #93c5fd;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.study-notes h4,
.notes-modal-content h4,
.lecture-notes-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

/* Paragraphs - generous breathing room for comfort reading */
.study-notes p,
.notes-modal-content p,
.lecture-notes-content p {
  margin-bottom: 1rem;
  text-align: left;
}

/* Lists - clearly spaced for easy scanning */
.study-notes ul, .study-notes ol,
.notes-modal-content ul, .notes-modal-content ol,
.lecture-notes-content ul, .lecture-notes-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.study-notes li, .notes-modal-content li, .lecture-notes-content li {
  margin-bottom: 0.45rem;
  line-height: 1.75;
}

/* Inline code - subtle highlight that doesn't distract */
.study-notes code, .notes-modal-content code, .lecture-notes-content code {
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

/* Code blocks - high-contrast dark background for readability */
.study-notes pre, .notes-modal-content pre, .lecture-notes-content pre {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
  line-height: 1.5;
}

.study-notes pre code, .notes-modal-content pre code, .lecture-notes-content pre code {
  background: none;
  color: #c9d1d9;
  padding: 0;
  font-size: 0.85rem;
}

/* Tables - clean, scannable data presentation */
.study-notes table, .notes-modal-content table, .lecture-notes-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.study-notes th, .notes-modal-content th, .lecture-notes-content th {
  background: rgba(59, 130, 246, 0.08);
  color: #93c5fd;
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.study-notes td, .notes-modal-content td, .lecture-notes-content td {
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.04);
  color: #d1d5db;
}

.study-notes tr:nth-child(even) td {
  background: rgba(255,255,255,0.015);
}

/* Bold text - premium blue tint for emphasis */
.study-notes strong, .notes-modal-content strong, .lecture-notes-content strong {
  color: #f1f5f9;
  font-weight: 700;
}

/* Blockquotes - callout style for important notes */
.study-notes blockquote, .notes-modal-content blockquote {
  border-left: 3px solid #3b82f6;
  background: rgba(59, 130, 246, 0.05);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
  color: #cbd5e1;
  font-style: italic;
}

for Hexorexa
 * 
 * Covers all styling for the app dashboard, sidebar, 
 * curriculum view, study notes, quizzes, modals, and 
 * the premium subscription system.
 * 
 * Design system:
 *   - Dark theme with blue (#3b82f6) and purple (#8b5cf6) accents
 *   - CSS custom properties for theming (--bg, --surface, --text, etc.)
 *   - Responsive breakpoints: 768px (tablet), 480px (mobile)
 *   - Font: Inter (Google Fonts) with system fallbacks
 * 
 * Sections:
 *   1. CSS Variables & Reset
 *   2. Layout (sidebar, main content, mobile header)
 *   3. Dashboard cards & progress rings
 *   4. Curriculum & lecture lists
 *   5. Study Notes & chapter content
 *   6. Quiz cards & answers
 *   7. Modals (YouTube, Notes, Auth)
 *   8. Premium system (blur, overlays)
 *   9. Enhanced content readability
 *   10. Responsive media queries
 */
/* 
   EmbedIQ - Premium Dark Theme v4.0
   
    */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Core backgrounds */
  --bg:          #080c14;
  --bg2:         #0d1220;
  --bg3:         #111827;
  --bg4:         #141e30;
  --sidebar:     #090d18;
  --card:        #0f1624;
  --card2:       #131d2e;
  --card-hover:  #192338;
  --surface:     #141c28;
  --surface-2:   #1a2438;

  /* Borders */
  --border:      rgba(255,255,255,.06);
  --border2:     rgba(255,255,255,.11);
  --border3:     rgba(255,255,255,.18);

  /* Brand colors */
  --accent:      #3b82f6;
  --accent2:     #60a5fa;
  --accent3:     #93c5fd;
  --green:       #10b981;
  --green2:      #34d399;
  --purple:      #8b5cf6;
  --purple2:     #a78bfa;
  --yellow:      #f59e0b;
  --yellow2:     #fbbf24;
  --red:         #ef4444;
  --red2:        #f87171;
  --cyan:        #06b6d4;

  /* Text */
  --text-primary:   #f1f5ff;
  --text-main:      #e2e8f0;
  --text-secondary: #94a3b8;
  --text-sub:       #94a3b8;
  --text-muted:     #55657d;
  --text-xmuted:    #3d5070;

  /* Fonts */
  --font:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:   'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Radii */
  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 5px;

  /* Shadows */
  --shadow:    0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.7);
  --shadow-card: 0 2px 8px rgba(0,0,0,.3), 0 0 1px rgba(255,255,255,.05);

  /* Transitions */
  --transition: all .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .35s cubic-bezier(.4,0,.2,1);

  /* Gradients */
  --grad-blue:   linear-gradient(135deg, #3b82f6, #6366f1);
  --grad-green:  linear-gradient(135deg, #10b981, #06b6d4);
  --grad-purple: linear-gradient(135deg, #8b5cf6, #ec4899);
  --grad-gold:   linear-gradient(135deg, #f59e0b, #ef4444);
  --grad-brand:  linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Ambient glow background component */
body::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
body::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(139,92,246,0.05) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
}

/*  Layout  */
.app-container { display: flex; height: 100vh; overflow: hidden; }

/*  Sidebar  */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: rgba(9, 13, 24, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding-bottom: 5rem;
  position: relative;
}
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad-brand);
  opacity: .6;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Logo / Brand */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.2rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .25rem;
}
.logo-mark {
  width: 36px; height: 36px;
  background: var(--grad-brand);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59,130,246,.35);
}
.logo-name {
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.3px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub {
  font-size: .62rem;
  color: var(--text-muted);
  display: block;
  margin-top: -.05rem;
}

/* Sidebar search */
.sidebar-search {
  padding: .75rem .75rem .25rem;
  position: relative;
}
.search-input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: .45rem .75rem;
  font-size: .8rem;
  color: var(--text-main);
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}
.search-input:focus {
  border-color: rgba(59,130,246,.5);
  background: rgba(59,130,246,.08);
}
.search-input::placeholder { color: var(--text-muted); }

.search-dropdown {
  position: absolute;
  top: 100%;
  left: .75rem; right: .75rem;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

/* Nav */
.nav-section-label {
  font-size: .6rem;
  font-weight: 700;
  color: var(--text-xmuted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  padding: .9rem 1rem .2rem;
}

.nav-links { list-style: none; padding: 0 .6rem; }
.nav-links li a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .52rem .75rem;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: -.1px;
}
.nav-links li a:hover {
  background: rgba(255,255,255,.05);
  color: var(--text-main);
}
.nav-links li.active a {
  background: linear-gradient(135deg, rgba(59,130,246,.18) 0%, rgba(139,92,246,.12) 100%);
  color: var(--accent3);
  border: 1px solid rgba(59,130,246,.22);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59,130,246,.1);
}
.nav-icon { font-size: .9rem; width: 18px; text-align: center; flex-shrink: 0; }

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--sidebar);
}

/*  Content area  */
.content-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#view-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

/*  Progress bar  */
.progress-bar-wrapper {
  width: 160px; height: 6px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--grad-blue);
  border-radius: 99px;
  transition: width .6s ease;
}

/*  Glass Cards  */
.stat-card {
  background: rgba(15, 22, 36, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.1), transparent);
}
.stat-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-card h3 {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: .65rem;
}
.stat-card .value { font-size: 2.1rem; font-weight: 800; color: var(--accent3); line-height: 1; }

/* Course cards */
.course-card {
  background: rgba(15, 22, 36, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.4rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.course-card:hover {
  background: rgba(25, 35, 56, 0.8);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(59, 130, 246, 0.15);
}
.course-card h3 { font-size: .9rem; font-weight: 700; color: var(--text-primary); margin-bottom: .35rem; }
.course-card p { font-size: .78rem; color: var(--text-secondary); line-height: 1.55; }

/* Generic card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.card:hover { border-color: var(--border2); }

/*  Badges  */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .6rem;
  border-radius: 99px;
  font-size: .67rem;
  font-weight: 700;
  background: rgba(255,255,255,.07);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,.1);
  letter-spacing: .2px;
}
.badge.critical { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }
.badge.hard     { background: rgba(245,158,11,.15); color: #fbbf24; border-color: rgba(245,158,11,.3); }
.badge.medium   { background: rgba(59,130,246,.15); color: #93c5fd; border-color: rgba(59,130,246,.3); }
.badge.easy     { background: rgba(16,185,129,.15); color: #34d399; border-color: rgba(16,185,129,.3); }

/* Nav badge */
.nav-badge {
  font-size: .55rem;
  padding: .1rem .3rem;
  background: rgba(239,68,68,.9);
  color: #fff;
  border-radius: 4px;
  margin-left: auto;
  letter-spacing: .03em;
  font-weight: 700;
}

/*  Buttons  */
.btn-small {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .32rem .75rem;
  border-radius: 6px;
  background: rgba(59,130,246,.12);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,.25);
  font-size: .75rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}
.btn-small:hover {
  background: rgba(59,130,246,.22);
  border-color: rgba(59,130,246,.45);
  color: #bfdbfe;
}
.btn-primary {
  background: var(--grad-blue);
  color: white;
  border: none;
  padding: .5rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  box-shadow: 0 4px 12px rgba(59,130,246,.3);
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,.4); }
.btn-secondary {
  background: rgba(255,255,255,.06);
  color: var(--text-secondary);
  border: 1px solid var(--border2);
  padding: .5rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: .82rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}
.btn-secondary:hover { background: rgba(255,255,255,.1); color: var(--text-primary); }
.back-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border2);
  color: var(--text-secondary);
  padding: .38rem .9rem;
  border-radius: 7px;
  font-size: .8rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  font-weight: 500;
}
.back-btn:hover { background: rgba(255,255,255,.1); color: var(--text-main); border-color: var(--border3); }

/*  Dashboard grid  */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }

/*  Lecture list  */
.lecture-list { display: flex; flex-direction: column; gap: .5rem; }
.lecture-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  transition: var(--transition);
}
.lecture-item:hover { background: var(--card-hover); border-color: var(--border2); }
.lecture-item.completed { border-left: 3px solid var(--green); }
.lecture-item.completed .lecture-title { color: var(--text-muted); text-decoration: line-through; }

.checkbox-wrapper { flex-shrink: 0; }
.custom-checkbox { width: 18px; height: 18px; border-radius: 5px; cursor: pointer; accent-color: var(--green); }

.lecture-details { flex: 1; min-width: 0; }
.lecture-title { font-size: .85rem; font-weight: 500; color: var(--text-main); display: block; margin-bottom: .3rem; }
.lecture-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.resource-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.lecture-list-header { margin-bottom: 1rem; }

/*  Circular progress chart  */
.circular-chart { width: 100px; margin: 0 auto .5rem; }
.circle-bg { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 3.8; }
.circle { fill: none; stroke-width: 3.8; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray .8s ease; }
.percentage { fill: var(--text-main); font-size: 6px; font-family: var(--font); font-weight: 700; text-anchor: middle; }

/*  YOUTUBE MODAL - Large near-fullscreen  */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  backdrop-filter: blur(12px);
  z-index: 2001;
  align-items: center;
  justify-content: center;
  animation: fadeInModal .2s ease;
  padding: .5rem .75rem;
}
.modal-overlay.active { display: flex; }
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 1.25rem;
  width: min(1100px, 96vw);
  max-height: 93vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s cubic-bezier(.22,1,.36,1);
  display: flex;
  flex-direction: column;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* YT-specific modal - even larger */
.yt-modal-box {
  width: min(1200px, 96vw);
  max-height: 95vh;
  padding: .5rem .75rem;
}
.yt-iframe-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  flex: 1;
}
.yt-iframe-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: .75rem;
}
.modal-header h3 { font-size: .95rem; font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  font-family: var(--font);
}
.modal-close:hover { background: rgba(239,68,68,.2); color: #f87171; border-color: rgba(239,68,68,.3); }

/* Godbolt modal */
.godbolt-modal-box { max-width: 96vw; width: 1200px; max-height: 92vh; }
.notes-modal-box   { max-width: 820px; width: 95vw; }
.notes-modal-body  { padding: 1.25rem; max-height: 75vh; overflow-y: auto; }
.test-modal-box    { max-width: 700px; width: 95vw; }
.test-modal-body   { padding: 1.25rem; max-height: 72vh; overflow-y: auto; }

/*  Code Editor  */
.code-editor-container { display: flex; flex-direction: column; height: calc(100vh - 120px); gap: .75rem; }
.editor-toolbar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .75rem 1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.lang-select {
  background: rgba(255,255,255,.07); border: 1px solid var(--border2);
  color: var(--text-main); padding: .35rem .75rem; border-radius: 6px; cursor: pointer;
  font-family: var(--font); font-size: .8rem;
}
.run-btn {
  background: var(--grad-green); color: white; border: none; padding: .4rem 1rem; border-radius: 6px;
  font-weight: 600; font-size: .82rem; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: .4rem; font-family: var(--font);
  box-shadow: 0 3px 10px rgba(16,185,129,.25);
}
.run-btn:hover { opacity: .9; transform: translateY(-1px); }
.run-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.snippet-btn {
  background: rgba(139,92,246,.15); border: 1px solid rgba(139,92,246,.3);
  color: #a78bfa; padding: .3rem .7rem; border-radius: 6px;
  font-size: .75rem; cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.snippet-btn:hover { background: rgba(139,92,246,.25); }
#monaco-editor-mount { flex: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 300px; }
.output-panel {
  background: #08101a; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; font-family: var(--mono); font-size: .78rem; color: #e2e8f0;
  min-height: 80px; max-height: 180px; overflow-y: auto; white-space: pre-wrap; line-height: 1.7;
}
.output-panel .out-success { color: #34d399; }
.output-panel .out-error   { color: #f87171; }
.output-panel .out-meta    { color: var(--text-muted); font-size: .72rem; }

/*  Chapter tabs  */
.chapter-tabs-bar { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.chapter-tab {
  padding: .35rem .95rem; border-radius: 20px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text-muted); font-size: .78rem; font-weight: 500;
  cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.chapter-tab:hover { background: rgba(255,255,255,.06); color: var(--text-main); }
.chapter-tab.active { background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.4); color: #93c5fd; font-weight: 600; }
.chapter-tab.quiz-tab { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #fbbf24; }
.chapter-tab.quiz-tab.active { background: rgba(245,158,11,.2); }

/*  Study notes typography  */
.study-notes { font-size: .9rem; line-height: 1.85; color: var(--text-secondary); max-width: 820px; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.study-notes .md-h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 2rem 0 .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.study-notes .md-h4 { font-size: .95rem; font-weight: 600; color: var(--accent2); margin: 1.25rem 0 .5rem; }
.study-notes p, .study-notes .md-para { color: var(--text-secondary); line-height: 1.85; margin: .6rem 0; }
.study-notes strong { color: var(--text-primary); font-weight: 600; }

/* Code blocks */
.code-block { background: #060e1a; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; margin: 1rem 0; overflow-x: auto; position: relative; }
.code-block-header { padding: .5rem 1rem; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.07); font-size: .7rem; color: var(--text-muted); font-family: var(--mono); display: flex; align-items: center; justify-content: space-between; }
.code-block code { display: block; padding: 1rem 1.25rem; font-family: var(--mono); font-size: .78rem; line-height: 1.7; color: #e2e8f0; white-space: pre; }
.code-block code .kw  { color: #ff7b72; }
.code-block code .cm  { color: #8b949e; font-style: italic; }
.code-block code .str { color: #a5d6ff; }
.inline-code { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); border-radius: 4px; padding: .1em .45em; font-family: var(--mono); font-size: .82em; color: #fcd34d; }

/* Tables */
.md-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .83rem; border-radius: 10px; overflow: hidden; }
.md-table th, .md-table td { padding: .65rem .9rem; text-align: left; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.md-table th { background: rgba(255,255,255,.05); color: var(--text-primary); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
.md-table tr:hover td { background: rgba(255,255,255,.03); }

/*  Quiz cards  */
.quiz-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .875rem;
  transition: var(--transition);
}
.quiz-card:hover { border-color: var(--border2); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.quiz-question { font-size: 1rem; font-weight: 600; color: var(--text-primary); line-height: 1.75; letter-spacing: -0.01em; }
.quiz-num { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; flex-shrink: 0; }
.quiz-diff-badge { font-size: .65rem; padding: .12rem .45rem; border-radius: 99px; font-weight: 600; }
.diff-basic  { background: rgba(16,185,129,.15);  color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.diff-inter  { background: rgba(245,158,11,.15);  color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.diff-expert { background: rgba(239,68,68,.15);   color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.quiz-ans {
  background: rgba(16,185,129,.04);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  font-size: .92rem;
  color: var(--text-main);
  line-height: 1.85;
  display: none;
  border-left: 4px solid var(--accent);
  animation: fadeIn .2s ease;
  letter-spacing: -0.005em;
}
.quiz-ans.visible { display:block!important; }
.quiz-btn {
  align-self: flex-start;
  padding: .45rem 1.1rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  border: 1px solid;
  background: transparent;
}
.quiz-btn:hover { opacity: .85; transform: translateY(-1px); }

/*  Expert tip callout  */
.expert-tip {
  border-radius: 10px; padding: .875rem 1.1rem; margin-bottom: 1.25rem;
  font-size: .83rem; line-height: 1.6; display: flex; gap: .75rem; align-items: flex-start;
}
.expert-tip-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.expert-tip-text { color: var(--text-secondary); }
.expert-tip-text strong { font-weight: 600; }

/*  Global search  */
.global-search {
  display: flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.06); border: 1px solid var(--border2);
  border-radius: 8px; padding: .4rem .75rem; margin: 0 .5rem .75rem;
}
.global-search input { background: none; border: none; outline: none; color: var(--text-main); font-size: .82rem; font-family: var(--font); width: 100%; }
.global-search input::placeholder { color: var(--text-muted); }

/*  Premium Streak UI  */
.streak-bar { background: var(--surface-2); border: 1px solid rgba(255,255,255,.05); border-radius: 14px; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; box-shadow: 0 4px 15px rgba(0,0,0,.2); }
.streak-days { display: flex; gap: .4rem; }
.streak-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); border: 1px solid rgba(255,255,255,.1); transition: all .3s ease; }
.streak-dot.done { background: linear-gradient(135deg, #10b981, #059669); border-color: #34d399; box-shadow: 0 0 8px rgba(16,185,129,.3); }
.streak-dot.today { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: #fbbf24; box-shadow: 0 0 12px rgba(245,158,11,.6); transform: scale(1.2); }
.streak-widget { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }

/*  Scrollbar  */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }

/*  LeetCode input  */
.lc-input { width: 55px; padding: .3rem .5rem; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--border2); color: var(--text-main); text-align: center; font-family: var(--mono); font-size: .82rem; }

/*  Course meta / tags  */
.course-meta { display: flex; gap: .5rem; flex-wrap: wrap; }

/*  Phase 3 - Section-specific styles  */
/* Interview Hub / Roadmap */
.co-btn:hover { opacity:.85; transform:translateY(-1px); }
.cat-btn { transition:all .2s; cursor:pointer; border:none; font-family:var(--font); }

/* Fun Mode flashcards */
.fc-card-flip { animation: cardFlip .3s ease; }
@keyframes cardFlip { 0%{transform:scaleY(1)} 50%{transform:scaleY(.95)} 100%{transform:scaleY(1)} }

/* Notes modal sizes */
#notes-modal .modal-box { max-width:820px; width:95vw; }
#notes-modal .study-notes { font-size:.88rem; }

/* Salary charts */
.salary-legend { display:flex; gap:1.25rem; font-size:.72rem; color:var(--text-muted); margin-top:.5rem; }
.salary-table { width:100%;border-collapse:collapse;font-size:.8rem; }
.salary-table th { padding:.55rem .9rem;background:rgba(255,255,255,.05);font-weight:600;text-align:left;border-bottom:1px solid var(--border2);font-size:.72rem;text-transform:uppercase;letter-spacing:.5px; }
.salary-table td { padding:.55rem .9rem;border-bottom:1px solid var(--border);color:var(--text-secondary); }
.salary-table tr:hover td { background:rgba(255,255,255,.03); }

/* Speed quiz */
@keyframes pulse-red { 0%,100%{opacity:1} 50%{opacity:.7} }
.timer-pulse { animation:pulse-red .6s infinite; }
#fc-card:hover { box-shadow:0 8px 32px rgba(0,0,0,.4); }
.roulette-card-enter { animation:slideUp .4s cubic-bezier(.22,1,.36,1); }

/* Difficulty colors */
.diff-medium { background:rgba(245,158,11,.15); color:#fbbf24; border:1px solid rgba(245,158,11,.3); }
.salary-row:hover .salary-bar { filter:brightness(1.2); }

/* Hidden/Visible */
.hidden { display:none!important; }
.joke-ans.visible { display:block!important; }

/* Match game */
.match-card { user-select:none; }
.match-card[data-matched] { pointer-events:none; opacity:.8; }

/* Page header */
.page-header { margin-bottom:1.75rem; }
.page-title { font-size:1.4rem; font-weight:800; margin:0 0 .3rem; color:var(--text-primary); letter-spacing:-.3px; }
.page-sub { font-size:.85rem; color:var(--text-muted); margin:0; }

/* Skill dots */
.skill-dot { display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:2px; }

/* Fill blanks */
.fb-btn { font-family:var(--font); transition:all .2s; }

/* App footer */
.app-footer { padding:.75rem 2rem; text-align:center; font-size:.72rem; color:var(--text-muted); border-top:1px solid var(--border); background:var(--bg2); }
.app-footer a { color:var(--accent2); text-decoration:none; }
.app-footer strong { color:var(--text-secondary); }

/* Copy button */
.btn-copy { font-size:.72rem; padding:.25rem .6rem; border-radius:5px; }

/* Notes btn */
.notes-btn { transition:all .2s; }
.notes-btn:hover { background:rgba(59,130,246,.25)!important; }



/*  Premium Sidebar Footer & Streak  */
.sidebar-footer {
  margin-top: auto;
  padding: 1.25rem 1rem;
  background: var(--sidebar);
  z-index: 10;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.streak-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 1.5rem 0.5rem 1.5rem;
  padding: 0.6rem 0.8rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 10px;
}

.streak-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fbbf24;
  margin: 0;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.streak-label span { font-size: .95rem; }

.streak-widget {
  display: flex;
  gap: 4px;
  margin: 0;
}
.streak-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-3); border: 1px solid rgba(255,255,255,.1); transition: all .3s cubic-bezier(0.4, 0, 0.2, 1); }
.streak-dot.done { background: linear-gradient(135deg, #10b981, #059669); border-color: #34d399; box-shadow: 0 0 6px rgba(16,185,129,.4); }
.streak-dot.today { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: #fbbf24; box-shadow: 0 0 10px rgba(245,158,11,.8); transform: scale(1.3); }

/* Fix overlapping sidebar bug */
.sidebar-nav {
  padding-bottom: 200px !important;
}
.sidebar-footer {
  box-shadow: 0 -10px 20px rgba(0,0,0,0.5);
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.1); }
  50% { transform: scale(1); }
  75% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* --- MARKDOWN STUDY NOTES STYLING --- */
.study-notes {
  color: var(--text-main);
  line-height: 1.85;
  font-size: 1rem;
  max-width: 850px;
  word-spacing: 0.02em;
}
.md-h3 {
  font-size: 1.5rem;
  color: #fff;
  margin-top: 2.75rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  letter-spacing: -0.02em;
}
.md-h4 {
  font-size: 1.2rem;
  color: #60a5fa;
  margin-top: 1.75rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
}
.md-para {
  margin-bottom: 1.35rem;
  color: var(--text-secondary);
  line-height: 1.9;
}
.md-para strong {
  color: #fff;
  font-weight: 600;
}
.inline-code {
  background: rgba(255, 255, 255, 0.1);
  color: #fca5a5;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.9em;
}
.code-block {
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.code-block-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--mono);
}
.code-block code {
  display: block;
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: #e5e5e5;
  white-space: pre-wrap;
  overflow-x: auto;
  line-height: 1.5;
}
.md-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.5rem;
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.md-table td, .md-table th {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.md-table td:last-child {
  border-right: none;
}
.md-table tr:first-child td {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.md-table tr:last-child td {
  border-bottom: none;
}


/*  Premium System  */
.premium-blur-active {
  position: relative;
  overflow: hidden;
}
.premium-blur-active > *:not(.premium-overlay) {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.premium-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 13, 0.6);
  backdrop-filter: blur(2px);
  z-index: 50;
  border-radius: var(--radius);
}
.premium-badge-sidebar {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .65rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(239,68,68,.15));
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,.25);
}


/*  Enhanced Content Readability  */
/* Optimized typography for long-form reading. Uses research-backed
   line-height, spacing, and contrast ratios for comfortable study sessions */
.study-notes,
.notes-modal-content,
.lecture-notes-content {
  font-size: 1rem;
  line-height: 1.9;
  color: #d4d8e0;
  letter-spacing: 0.01em;
  word-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings within notes - clear hierarchy for scanability */
.study-notes h2,
.notes-modal-content h2,
.lecture-notes-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.study-notes h3,
.notes-modal-content h3,
.lecture-notes-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #93c5fd;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.study-notes h4,
.notes-modal-content h4,
.lecture-notes-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

/* Paragraphs - generous breathing room for comfort reading */
.study-notes p,
.notes-modal-content p,
.lecture-notes-content p {
  margin-bottom: 1rem;
  text-align: left;
}

/* Lists - clearly spaced for easy scanning */
.study-notes ul, .study-notes ol,
.notes-modal-content ul, .notes-modal-content ol,
.lecture-notes-content ul, .lecture-notes-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.study-notes li, .notes-modal-content li, .lecture-notes-content li {
  margin-bottom: 0.45rem;
  line-height: 1.75;
}

/* Inline code - subtle highlight that doesn't distract */
.study-notes code, .notes-modal-content code, .lecture-notes-content code {
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

/* Code blocks - high-contrast dark background for readability */
.study-notes pre, .notes-modal-content pre, .lecture-notes-content pre {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
  line-height: 1.5;
}

.study-notes pre code, .notes-modal-content pre code, .lecture-notes-content pre code {
  background: none;
  color: #c9d1d9;
  padding: 0;
  font-size: 0.85rem;
}

/* Tables - clean, scannable data presentation */
.study-notes table, .notes-modal-content table, .lecture-notes-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.study-notes th, .notes-modal-content th, .lecture-notes-content th {
  background: rgba(59, 130, 246, 0.08);
  color: #93c5fd;
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.study-notes td, .notes-modal-content td, .lecture-notes-content td {
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.04);
  color: #d1d5db;
}

.study-notes tr:nth-child(even) td {
  background: rgba(255,255,255,0.015);
}

/* Bold text - premium blue tint for emphasis */
.study-notes strong, .notes-modal-content strong, .lecture-notes-content strong {
  color: #f1f5f9;
  font-weight: 700;
}

/* Blockquotes - callout style for important notes */
.study-notes blockquote, .notes-modal-content blockquote {
  border-left: 3px solid #3b82f6;
  background: rgba(59, 130, 246, 0.05);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
  color: #cbd5e1;
  font-style: italic;
}

/*  MOBILE RESPONSIVE - App Layout  */
@media (max-width: 768px) {
  /* Sidebar collapses to hamburger drawer */
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 2001;
    width: 260px;
    height: 100vh;
    transition: left 0.3s ease;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.5);
  }
  .sidebar-overlay.active { display: block; }

  /* Main content takes full width */
  .main-content, .content-area, #view-container {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 1rem !important;
  }

  /* Mobile hamburger button */
  .mobile-hamburger {
    display: block !important;
    display: flex !important;
    position: fixed;
    top: 8px;
    left: 0 !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: none !important;
    z-index: 1001;
    background: rgba(17,24,39,0.9);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0 8px 8px 0 !important;
    padding: 8px;
    cursor: pointer;
    color: #f1f5f9;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
  }

  /* Dashboard grid responsive */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  /* Cards full width */
  .stat-card, .topic-card, .lecture-card {
    width: 100% !important;
  }

  /* Top bar responsive */
  .top-bar, .breadcrumb-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Study notes full width */
  .study-notes {
    padding: 1rem !important;
    font-size: 0.9rem !important;
  }

  /* List styles for markdown */
  .md-list {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
  }
  .md-list li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
    color: var(--text-secondary, #cbd5e1);
  }
}


/* Markdown list styles (all viewports) */
.md-list {
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}
.md-list li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
  color: var(--text-secondary, #cbd5e1);
}
ul.md-list { list-style-type: disc; }
ol.md-list { list-style-type: decimal; }

/* --- MOBILE FIXES --- */
/* --- MOBILE FIXES --- */
@media (max-width: 768px) {
    /* Base App Container Fixes */
    html, body { overflow-x: hidden !important; width: 100%; position: relative; max-width: 100vw; }
    .app-container { overflow-x: hidden !important; width: 100%; max-width: 100%; box-sizing: border-box; }
    
    /* Main Content */
    .content-area, .main-content { margin-left: 0 !important; width: 100% !important; padding: 1rem !important; }
    #view-container { padding: 1rem !important; }
    
    /* Sidebar Overhaul for Mobile */
    .sidebar {
        position: fixed;
        left: -280px; /* Hide off-canvas completely */
        top: 0;
        z-index: 2001; /* Above overlay */
        width: 280px;
        height: 100vh;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    
    .sidebar.mobile-open {
        left: 0; /* Slide in */
    }

    /* Restore vertical scrolling for the menu */
    .sidebar-top-wrapper {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .nav-links {
        display: block; /* Stack vertically */
        padding: 0 1rem;
    }
    .nav-links li {
        display: block;
        margin-bottom: 0.2rem;
    }
    .nav-section-label {
        display: block; /* Show labels again */
    }

    /* Grids to single column */
    .dashboard-grid, .stats-grid, .topics-grid { grid-template-columns: 1fr; }
    
    /* Cards */
    .stat-card, .topic-card, .lecture-card { width: 100% !important; }
}
/* --- APP CONTAINER EDGE FIX --- */
@media (max-width: 768px) {
    .content-area, .main-content {
        padding-left: 0.5rem !important; /* Reclaim edge spacing */
        padding-right: 0.5rem !important;
    }
    .mobile-hamburger {
        left: 0; /* Align directly to the edge to hide the seam */
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
}

@media (max-width: 768px) { .sidebar.mobile-open { box-shadow: 4px 0 20px rgba(0,0,0,0.5); } }
/* --- EDGE BLEED OVERRIDE --- */
@media (max-width: 768px) {
    .sidebar {
        border-right: none !important; /* Prevents the 1px white line from showing */
    }
    .mobile-hamburger {
        left: 0 !important; /* Force override to kill the 12px gap */
        border-left: none !important;
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
    }
}

@keyframes firePulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(245,158,11,0.5)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(245,158,11,1)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(245,158,11,0.5)); }
}
.streak-fire-animated {
  display: inline-block;
  animation: firePulse 2s infinite ease-in-out;
}

/* Oscilloscope animation */
.oscilloscope {
  display: flex; align-items: center; gap: 3px;
  height: 24px; padding: 0 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.scope-bar {
  width: 3px; background: #34d399;
  border-radius: 1px;
  animation: scopeBounce 1s infinite ease-in-out;
}
.scope-bar:nth-child(1) { animation-delay: 0.1s; height: 12px; }
.scope-bar:nth-child(2) { animation-delay: 0.3s; height: 20px; }
.scope-bar:nth-child(3) { animation-delay: 0.5s; height: 16px; }
.scope-bar:nth-child(4) { animation-delay: 0.2s; height: 10px; }
.scope-bar:nth-child(5) { animation-delay: 0.4s; height: 18px; }

@keyframes scopeBounce {
  0%, 100% { transform: scaleY(0.5); opacity: 0.7; }
  50% { transform: scaleY(1); opacity: 1; box-shadow: 0 0 6px #34d399; }
}

/* ═══════════════════════════════════════════════
   PROGRESSIVE LEARNING LAYOUT
   Two-panel educative.io-style lesson flow
   ═══════════════════════════════════════════════ */

.progressive-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 120px);
  margin: -1.75rem -2rem;
  padding: 0;
}

/* LEFT: Step sidebar navigation */
.progressive-sidebar {
  width: 300px;
  min-width: 300px;
  background: rgba(9, 13, 24, 0.6);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
  display: flex;
  flex-direction: column;
}
.progressive-sidebar::-webkit-scrollbar { width: 4px; }
.progressive-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }

.prog-sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(9, 13, 24, 0.95);
  backdrop-filter: blur(12px);
  z-index: 10;
}
.prog-sidebar-header h3 {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .25rem;
}
.prog-sidebar-header .prog-meta {
  font-size: .72rem;
  color: var(--text-muted);
}

/* Step list items */
.prog-step-list { padding: .5rem 0; flex: 1; }
.prog-step {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .7rem 1rem;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
  border-left: 3px solid transparent;
}
.prog-step:hover { background: rgba(255,255,255,.04); }
.prog-step.active {
  background: rgba(59, 130, 246, .08);
  border-left-color: var(--accent);
}
.prog-step.completed .prog-step-dot {
  background: var(--green);
  border-color: var(--green2);
  color: #fff;
}

/* Step number dot */
.prog-step-dot {
  width: 28px; height: 28px; min-width: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700;
  background: rgba(255,255,255,.06);
  border: 2px solid var(--border2);
  color: var(--text-muted);
  transition: all .25s ease;
  position: relative; z-index: 2;
}
.prog-step.active .prog-step-dot {
  background: rgba(59, 130, 246, .2);
  border-color: var(--accent);
  color: var(--accent3);
  box-shadow: 0 0 12px rgba(59, 130, 246, .25);
}

/* Connecting line between dots */
.prog-step::after {
  content: '';
  position: absolute;
  left: calc(1rem + 13px);
  top: calc(.7rem + 28px);
  bottom: calc(-.7rem);
  width: 2px;
  background: var(--border);
  z-index: 1;
}
.prog-step:last-child::after { display: none; }
.prog-step.completed::after { background: var(--green); opacity: .5; }

/* Step text */
.prog-step-info { flex: 1; min-width: 0; padding-top: .15rem; }
.prog-step-title {
  font-size: .8rem; font-weight: 500; color: var(--text-secondary);
  display: block; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.prog-step.active .prog-step-title { color: var(--text-primary); font-weight: 600; }
.prog-step.completed .prog-step-title { color: var(--text-muted); }
.prog-step-badges { display: flex; gap: .35rem; margin-top: .3rem; flex-wrap: wrap; }
.prog-step-badges .badge { font-size: .6rem; padding: .08rem .4rem; }

/* RIGHT: Content panel */
.progressive-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.progressive-content::-webkit-scrollbar { width: 5px; }
.progressive-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }

/* Chapter progress bar at top */
.prog-chapter-bar {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1.25rem;
  background: rgba(15, 22, 36, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.5rem;
}
.prog-chapter-bar .prog-chapter-label {
  font-size: .78rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap;
}
.prog-chapter-bar .prog-chapter-label strong { color: var(--accent3); }
.prog-chapter-bar .progress-bar-wrapper { flex: 1; height: 5px; }

/* Content animation */
@keyframes slideInContent {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.prog-content-body { animation: slideInContent .35s cubic-bezier(.22, 1, .36, 1); }

/* Continue button */
.prog-continue-btn {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; padding: .85rem 1.5rem; margin-top: 2.5rem;
  background: var(--grad-blue); color: #fff; border: none; border-radius: 12px;
  font-size: .92rem; font-weight: 700; cursor: pointer;
  transition: all .25s ease; font-family: var(--font);
  box-shadow: 0 6px 20px rgba(59, 130, 246, .3); letter-spacing: -.2px;
}
.prog-continue-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(59, 130, 246, .45); }
.prog-continue-btn.complete-btn { background: var(--grad-green); box-shadow: 0 6px 20px rgba(16, 185, 129, .3); }
.prog-continue-btn.complete-btn:hover { box-shadow: 0 8px 28px rgba(16, 185, 129, .45); }

/* Video embed */
.prog-video-embed {
  position: relative; padding-bottom: 56.25%; height: 0;
  border-radius: 12px; overflow: hidden; background: #000;
  margin-bottom: 1.75rem;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.prog-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prog-video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(15,22,36,.95), rgba(25,35,56,.9));
  cursor: pointer; transition: all .3s;
}
.prog-video-placeholder:hover { background: linear-gradient(135deg, rgba(25,35,56,.95), rgba(40,55,80,.9)); }
.prog-video-placeholder .play-icon {
  width: 60px; height: 60px; background: rgba(239, 68, 68, .9);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: .75rem;
  box-shadow: 0 4px 20px rgba(239, 68, 68, .4); transition: transform .2s;
}
.prog-video-placeholder:hover .play-icon { transform: scale(1.1); }

/* Inline quiz */
.prog-inline-quiz { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.prog-inline-quiz h3 {
  font-size: .95rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}

/* Responsive: collapse on mobile */
@media (max-width: 768px) {
  .progressive-layout { flex-direction: column; min-height: auto; margin: -.5rem; }
  .progressive-sidebar {
    width: 100%; min-width: 100%; max-height: none;
    border-right: none; border-bottom: 1px solid var(--border);
    overflow-y: visible;
  }
  .progressive-sidebar.collapsed { max-height: 56px; overflow: hidden; }
  .progressive-sidebar.collapsed .prog-step-list { display: none; }
  .progressive-sidebar.collapsed .prog-sidebar-header { cursor: pointer; border-bottom: none; position: relative; }
  .progressive-sidebar.collapsed .prog-sidebar-header::after {
    content: '▼'; position: absolute; right: 1rem; top: 50%;
    transform: translateY(-50%); font-size: .7rem; color: var(--text-muted);
  }
  .progressive-content { padding: 1.25rem 1rem; }
  .prog-step::after { display: none; }
}


/* ═══════════════════════════════════════════════════
   🪄 MAGIC PREMIUM ENHANCEMENTS
   ═══════════════════════════════════════════════════ */

/* ── Animated gradient border on hover for cards ── */
.stat-card::after, .course-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4, #10b981, #3b82f6);
  background-size: 400% 400%;
  z-index: -1;
  opacity: 0;
  transition: opacity .4s ease;
  animation: gradientShift 4s linear infinite;
}
.stat-card:hover::after, .course-card:hover::after {
  opacity: 1;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Staggered entrance animations for grids ── */
.dashboard-grid > * {
  opacity: 0;
  animation: staggerFadeUp .5s cubic-bezier(.22, 1, .36, 1) forwards;
}
.dashboard-grid > *:nth-child(1) { animation-delay: .05s; }
.dashboard-grid > *:nth-child(2) { animation-delay: .1s; }
.dashboard-grid > *:nth-child(3) { animation-delay: .15s; }
.dashboard-grid > *:nth-child(4) { animation-delay: .2s; }
.dashboard-grid > *:nth-child(5) { animation-delay: .25s; }
.dashboard-grid > *:nth-child(6) { animation-delay: .3s; }
.dashboard-grid > *:nth-child(7) { animation-delay: .35s; }
.dashboard-grid > *:nth-child(8) { animation-delay: .4s; }
.dashboard-grid > *:nth-child(9) { animation-delay: .45s; }
.dashboard-grid > *:nth-child(10) { animation-delay: .5s; }
.dashboard-grid > *:nth-child(11) { animation-delay: .55s; }
.dashboard-grid > *:nth-child(12) { animation-delay: .6s; }
@keyframes staggerFadeUp {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Reading progress indicator at top of content ── */
.reading-progress-bar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 50;
}
.reading-progress-bar .reading-fill {
  height: 100%;
  background: var(--grad-brand);
  width: 0%;
  transition: width .1s linear;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(59,130,246,.5);
}

/* ── Toast notification system ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: rgba(15, 22, 36, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .82rem;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 1px rgba(255,255,255,.1);
  animation: toastSlideIn .4s cubic-bezier(.22, 1, .36, 1);
  max-width: 360px;
  font-family: 'Inter', sans-serif;
}
.toast.toast-out {
  animation: toastSlideOut .3s ease forwards;
}
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-text { flex: 1; line-height: 1.4; }
.toast-text strong { display: block; font-size: .78rem; color: var(--text-muted); margin-top: .1rem; font-weight: 400; }
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(80px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastSlideOut {
  to { opacity: 0; transform: translateX(80px) scale(0.9); }
}

/* ── Confetti burst animation ── */
.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  z-index: 10000;
  pointer-events: none;
  animation: confettiFall var(--fall-duration, 2.5s) cubic-bezier(.25, .46, .45, .94) forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg) scale(0.3); }
}

/* ── Smoother code blocks with copy button ── */
.code-block {
  position: relative;
  transition: all .3s ease;
}
.code-block:hover {
  border-color: rgba(59,130,246,.3);
  box-shadow: 0 4px 20px rgba(0,0,0,.3), 0 0 0 1px rgba(59,130,246,.1);
}
.code-copy-btn {
  position: absolute;
  top: .4rem;
  right: .5rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--text-muted);
  padding: .2rem .5rem;
  border-radius: 5px;
  font-size: .65rem;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font);
  z-index: 5;
  opacity: 0;
  transform: translateY(-4px);
}
.code-block:hover .code-copy-btn {
  opacity: 1;
  transform: translateY(0);
}
.code-copy-btn:hover {
  background: rgba(59,130,246,.3);
  color: #93c5fd;
  border-color: rgba(59,130,246,.5);
}
.code-copy-btn.copied {
  background: rgba(16,185,129,.3);
  color: #34d399;
  border-color: rgba(16,185,129,.5);
}

/* ── Progress circle glow animation ── */
.circular-chart .circle {
  filter: drop-shadow(0 0 4px rgba(59,130,246,.4));
}

/* ── Quiz card reveal animation ── */
.quiz-ans {
  animation: none;
}
.quiz-ans[style*="display: block"], .quiz-ans[style*="display:block"] {
  animation: quizReveal .35s cubic-bezier(.22, 1, .36, 1);
}
@keyframes quizReveal {
  from { opacity: 0; max-height: 0; padding: 0 1.25rem; }
  to { opacity: 1; max-height: 600px; }
}

/* ── Pulse ring on active step dot ── */
.prog-step.active .prog-step-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: .4; transform: scale(1.2); }
}

/* ── Keyboard shortcut hints ── */
.kbd-hint {
  display: inline-flex;
  align-items: center;
  padding: .1rem .4rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 4px;
  font-size: .62rem;
  color: var(--text-muted);
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1;
  margin-left: .3rem;
  vertical-align: middle;
}

/* ── Floating reading time badge ── */
.reading-time-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 20px;
  font-size: .7rem;
  color: #a78bfa;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ── Enhanced study notes ── */
.study-notes .md-h3 {
  position: relative;
  padding-left: .75rem;
  border-bottom: none;
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(59,130,246,.04), transparent);
  padding: .5rem .75rem;
  border-radius: 0 8px 8px 0;
  margin: 2.5rem 0 1rem;
}

/* ── Smooth scrollbar fade ── */
.progressive-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.06);
  transition: background .3s;
}
.progressive-content:hover::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15);
}

/* ── Video placeholder shimmer ── */
.prog-video-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.03) 37%, transparent 63%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ── Tooltip for badges ── */
.badge { position: relative; }
.prog-step:hover .prog-step-badges .badge {
  transform: translateY(-1px);
  transition: transform .2s;
}

/* ── Page transitions ── */
#view-container > * {
  animation: pageFadeIn .3s ease-out;
}
@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
#view-container > .progressive-layout {
  animation: pageFadeIn .2s ease-out;
}

/* ── Enhanced button interactions ── */
.prog-continue-btn {
  position: relative;
  overflow: hidden;
}
.prog-continue-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width .5s, height .5s;
}
.prog-continue-btn:active::before {
  width: 500px;
  height: 500px;
}

/* ── Topic card icon float animation ── */
.study-topic-card span[style*="font-size:2rem"] {
  transition: transform .3s ease;
}
.study-topic-card:hover span[style*="font-size:2rem"] {
  transform: scale(1.15) rotate(-5deg);
  animation: iconBounce .5s ease;
}
@keyframes iconBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.2) rotate(-8deg); }
  100% { transform: scale(1.15) rotate(-5deg); }
}

/* ── Lecture completed celebration glow ── */
.prog-step.just-completed .prog-step-dot {
  animation: celebrateDot .6s ease;
}
@keyframes celebrateDot {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16,185,129,.7); }
  50% { transform: scale(1.3); box-shadow: 0 0 0 12px rgba(16,185,129,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ── Sidebar progress bar gradient animation ── */
.prog-sidebar-header .progress-bar {
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
  background-size: 200% 100%;
  animation: progressGradient 3s linear infinite;
}
@keyframes progressGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── Scrollbar track glow ─── */
.progressive-sidebar::-webkit-scrollbar-track {
  background: linear-gradient(180deg, transparent, rgba(59,130,246,.03), transparent);
}
