:root {
  --bg: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-card-hover: #1a1a1a;
  --border: #2a2a2a;
  --border-hover: #333333;
  --accent: #10b981;
  --accent-hover: #34d399;
  --accent-dim: rgba(16, 185, 129, 0.1);
  --text: #f5f5f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10,10,10,0.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 76px;
}
.nav-logo {
  display: flex; align-items: center; gap: 4px;
  min-width: 200px;
}
.nav-logo svg {
  display: block;
  flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: 0.2s; }
.nav-links a:hover { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-md); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; border: none; transition: all 0.2s; white-space: nowrap;
}
.btn-green { background: var(--accent); color: var(--bg); box-shadow: 0 4px 14px rgba(16,185,129,0.3); }
.btn-green:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-hover); }
.btn-outline:hover { background: var(--bg-card-hover); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.mobile-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* HERO */
.hero {
  min-height: 100vh; display: flex; align-items: center; padding-top: 68px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: 10%; right: -5%; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(16,185,129,0.06) 0%, transparent 70%); pointer-events: none;
}
.hero-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; width: 100%;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 100px;
  font-size: 0.85rem; color: var(--accent-hover); margin-bottom: 24px; width: fit-content;
}
.hero-badge::before { content: ''; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 8px var(--accent); }
.hero h1 { font-size: clamp(2.8rem, 5vw, 4.5rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 460px; margin: 24px 0 36px; line-height: 1.7; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

/* FLASHCARD SHOWCASE */
.showcase { position: relative; display: flex; justify-content: center; align-items: center; height: 480px; }
.stack { position: relative; width: 340px; }
.fcard {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow); transition: transform 0.3s;
}
.fcard-main { position: relative; z-index: 3; }
.fcard-back1 { position: absolute; top: 16px; left: 16px; right: -16px; z-index: 2; opacity: 0.5; transform: rotate(3deg); }
.fcard-back2 { position: absolute; top: 32px; left: 32px; right: -32px; z-index: 1; opacity: 0.25; transform: rotate(6deg); }
.fcard-h { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; font-size: 0.75rem; color: var(--text-muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.fcard-q { font-size: 1.05rem; font-weight: 600; margin-bottom: 10px; }
.fcard-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.fcard-tag { display: inline-block; padding: 5px 12px; background: var(--accent-dim); color: var(--accent); border-radius: 100px; font-size: 0.75rem; font-weight: 600; }
.fcard-meta { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted); }
.pill {
  position: absolute; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 18px; box-shadow: var(--shadow); z-index: 10;
}
.pill-tr { top: -16px; right: -30px; }
.pill-bl { bottom: 30px; left: -50px; }
.pill-v { font-size: 1.4rem; font-weight: 700; }
.pill-l { font-size: 0.7rem; color: var(--text-muted); }
.pill.green { background: var(--accent); border-color: var(--accent); }
.pill.green .pill-v, .pill.green .pill-l { color: var(--bg); }

/* SECTIONS */
.section { padding: 90px 24px; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-head { text-align: center; max-width: 600px; margin: 0 auto 56px; }
.section-label { display: inline-block; padding: 6px 16px; background: var(--accent-dim); color: var(--accent); border-radius: 100px; font-size: 0.85rem; font-weight: 600; margin-bottom: 14px; }
.section-title { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 700; margin-bottom: 14px; }
.section-desc { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.7; }

/* RESOURCE CARDS */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.rcard {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px 24px; text-align: center; transition: all 0.3s; display: flex; flex-direction: column; align-items: center;
}
.rcard:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--shadow); }
.ricon {
  width: 52px; height: 52px; background: var(--accent-dim); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 18px;
}
.rcard h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; }
.rcard p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; margin-bottom: 20px; flex-grow: 1; }
.rcard .btn { margin-top: auto; }

/* EXAM CARDS */
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.ecat-group { display: contents; }
.ecat-group.hidden { display: none; }
.ecat-header { display: none; }
.ecat-items { display: contents; }
.ecard {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; transition: all 0.3s; position: relative; overflow: hidden;
}
.ecard::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); opacity: 0; transition: 0.3s; }
.ecard:hover::before { opacity: 1; }
.ecard:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--shadow); }
.ecat { display: inline-block; padding: 4px 12px; background: var(--accent-dim); color: var(--accent); border-radius: 100px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.ecard h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.ecard p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; margin-bottom: 16px; }
.emeta { display: flex; gap: 14px; font-size: 0.82rem; color: var(--text-muted); }

/* Category-colored top borders on desktop */
.ecard[data-color="#3b82f6"]::before { background: #3b82f6; }
.ecard[data-color="#10b981"]::before { background: #10b981; }
.ecard[data-color="#a855f7"]::before { background: #a855f7; }
.ecard[data-color="#f59e0b"]::before { background: #f59e0b; }
.ecard[data-color="#ef4444"]::before { background: #ef4444; }
.ecard[data-color="#ec4899"]::before { background: #ec4899; }

/* UNIT CARDS */
.ucard {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 14px; transition: all 0.2s; cursor: pointer; display: block;
}
.ucard:hover { border-color: var(--accent); }
.unum { display: inline-block; padding: 4px 12px; background: var(--accent-dim); color: var(--accent); border-radius: 100px; font-size: 0.75rem; font-weight: 700; margin-bottom: 10px; }
.ucard h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.ucard p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* TABS */
.tabs { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.tab { padding: 8px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 100px; color: var(--text-secondary); font-size: 0.88rem; font-weight: 500; cursor: pointer; transition: 0.2s; }
.tab:hover, .tab.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* SUBJECT HERO */
.shero { padding: 110px 24px 50px; background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); }
.shero-inner { max-width: 1200px; margin: 0 auto; }
.shero h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); font-weight: 700; margin-bottom: 14px; }
.shero p { font-size: 1.15rem; color: var(--text-secondary); max-width: 600px; line-height: 1.7; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 0.88rem; color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* UNIT PAGE */
.unit-hero { padding: 110px 24px 40px; background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); }
.unit-hero-inner { max-width: 1200px; margin: 0 auto; }
.unit-hero h1 { font-size: clamp(2rem, 3.5vw, 3rem); font-weight: 700; margin-bottom: 10px; }
.unit-hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 700px; line-height: 1.7; }

/* CONTENT BOXES */
.content-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; margin-bottom: 20px;
}
.content-box h2 { font-size: 1.4rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.content-box h2 span { font-size: 1.6rem; }
.content-box p, .content-box li { color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; }
.content-box ul { padding-left: 20px; }
.content-box li { margin-bottom: 8px; }
.flashcard-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px; margin-bottom: 12px;
}
.flashcard-item .q { font-weight: 600; margin-bottom: 8px; color: var(--text); }
.flashcard-item .a { color: var(--text-secondary); font-size: 0.95rem; }
.practice-q {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 24px; margin-bottom: 16px;
}
.practice-q .q { font-weight: 600; margin-bottom: 12px; color: var(--text); font-size: 1.05rem; }
.practice-q .choices { margin-bottom: 16px; }
.practice-q .choice {
  display: block; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; transition: 0.2s; color: var(--text-secondary);
}
.practice-q .choice:hover { border-color: var(--accent); color: var(--text); }
.practice-q .choice.correct { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.practice-q .explanation { display: none; padding: 16px; background: var(--accent-dim); border-radius: var(--radius-sm); color: var(--text); font-size: 0.95rem; }
.practice-q .explanation.show { display: block; }
.video-item {
  display: flex; gap: 16px; align-items: flex-start; padding: 16px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 12px; cursor: pointer; transition: 0.2s;
}
.video-item:hover { border-color: var(--accent); }
.video-thumb {
  width: 120px; height: 70px; background: var(--bg-card); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0;
}
.video-info h4 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.video-info p { font-size: 0.85rem; color: var(--text-muted); }

/* FOOTER */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 60px 24px 28px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.fgrid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.fbrand { max-width: 300px; }
.fbrand .nav-logo { margin-bottom: 14px; }
.fbrand p { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; }
.fcol h4 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 18px; }
.fcol ul { list-style: none; }
.fcol li { margin-bottom: 10px; }
.fcol a { color: var(--text-secondary); font-size: 0.88rem; transition: 0.2s; }
.fcol a:hover { color: var(--accent); }
.fbot { border-top: 1px solid var(--border); padding-top: 28px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.fbot p { color: var(--text-muted); font-size: 0.85rem; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .showcase { height: 380px; order: -1; }
  .stack { width: 280px; }
  .fgrid { grid-template-columns: 1fr 1fr; }
  .rgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  .hero { padding-top: 80px; min-height: auto; padding-bottom: 50px; }
  .section { padding: 60px 24px; }
  .fgrid { grid-template-columns: 1fr; }
  .rgrid { grid-template-columns: 1fr; }

  /* Mobile exam section: category-grouped compact list */
  .egrid { display: flex; flex-direction: column; gap: 20px; }
  .ecat-group { display: flex; flex-direction: column; }
  .ecat-group.hidden { display: none !important; }
  .ecat-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
    font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em;
  }
  .ecat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .ecat-name { color: var(--text); font-weight: 700; }
  .ecat-count { color: var(--text-muted); font-weight: 500; margin-left: auto; font-size: 0.75rem; }
  .ecat-items { display: flex; flex-direction: column; gap: 6px; }
  .ecard {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius-md);
    background: var(--bg-card); border: 1px solid var(--border);
  }
  .ecard::before { display: none; }
  .ecard:hover { transform: none; box-shadow: none; border-color: var(--border-hover); }
  .ecard .ecat { display: none; }
  .ecard h3 { font-size: 0.92rem; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ecard p { display: none; }
  .ecard .emeta { display: none; }
  .ecard::after {
    content: '→'; margin-left: auto; color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0;
  }
  .ecard[data-color="#3b82f6"] { border-left: 3px solid #3b82f6; }
  .ecard[data-color="#10b981"] { border-left: 3px solid #10b981; }
  .ecard[data-color="#a855f7"] { border-left: 3px solid #a855f7; }
  .ecard[data-color="#f59e0b"] { border-left: 3px solid #f59e0b; }
  .ecard[data-color="#ef4444"] { border-left: 3px solid #ef4444; }
  .ecard[data-color="#ec4899"] { border-left: 3px solid #ec4899; }
}

/* ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease forwards; opacity: 0; }
.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.3s; }

/* LIGHT MODE */
[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-secondary: #e9ecef;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f5;
  --border: #dee2e6;
  --border-hover: #ced4da;
  --text: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
}
[data-theme="light"] .nav { background: rgba(248,249,250,0.9); }
[data-theme="light"] .footer { background: #e9ecef; }

/* THEME TOGGLE */
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 8px 12px; cursor: pointer; color: var(--text-secondary); font-size: 1rem;
  transition: 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* PRINT STYLES */
@media print {
  .nav, .footer, .res-tabs, .btn, .theme-toggle, .mobile-toggle { display: none !important; }
  body { background: white; color: black; }
  .content-box { border: 1px solid #ccc; box-shadow: none; }
  .section { padding: 20px; }
}

/* SCROLL REVEAL */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.6s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* HOVER LIFT */
.hover-lift { transition: transform 0.3s, box-shadow 0.3s; }
.hover-lift:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(0,0,0,0.3); }
[data-theme="light"] .hover-lift:hover { box-shadow: 0 12px 30px rgba(0,0,0,0.1); }

/* PULSE */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
}
.pulse { animation: pulse 2s infinite; }

/* SHIMMER */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* STAGGER GRID */
.stagger-grid > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-grid > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-grid > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-grid > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-grid > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-grid > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-grid > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-grid > *:nth-child(8) { animation-delay: 0.4s; }

/* BADGE */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px; font-size: 0.8rem; font-weight: 600;
}
.badge-gold { background: rgba(234,179,8,0.15); color: #eab308; border: 1px solid rgba(234,179,8,0.3); }
.badge-blue { background: rgba(59,130,246,0.15); color: #3b82f6; border: 1px solid rgba(59,130,246,0.3); }
.badge-red { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }

/* GAME STYLES */
.game-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; text-align: center; transition: 0.3s;
}
.game-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.game-icon { font-size: 3rem; margin-bottom: 16px; }
.timer { font-size: 2.5rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.score { font-size: 1.2rem; font-weight: 600; }

/* DRAG DROP */
.drop-zone {
  min-height: 120px; background: var(--bg); border: 2px dashed var(--border);
  border-radius: var(--radius-md); padding: 16px; transition: 0.2s;
}
.drop-zone.drag-over { border-color: var(--accent); background: var(--accent-dim); }
.draggable {
  padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: grab; margin-bottom: 8px; font-size: 0.9rem;
}
.draggable:active { cursor: grabbing; }

/* AUDIO PLAYER */
.audio-player {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.audio-btn {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent);
  color: var(--bg); border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-size: 1.2rem;
}

/* CHECKLIST */
.checklist-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 10px; cursor: pointer; transition: 0.2s;
}
.checklist-item:hover { border-color: var(--accent); }
.checklist-item.checked { opacity: 0.6; }
.checklist-item.checked .check-circle { background: var(--accent); border-color: var(--accent); }
.check-circle {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: 0.2s;
}

/* PRINT STYLES */
@media print {
  .nav, .footer, .res-sidebar, .btn, .theme-toggle, .mobile-toggle, .fc-controls, .fc-shuffle { display: none !important; }
  body { background: white !important; color: black !important; }
  .content-box, .game-card, .checklist-item { border: 1px solid #ccc !important; box-shadow: none !important; background: white !important; }
  .section { padding: 20px !important; }
  .res-layout { grid-template-columns: 1fr !important; }
  .res-panel { display: block !important; }
  a { color: #000 !important; text-decoration: underline !important; }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Dropdown nav */
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 0; min-width: 200px; box-shadow: var(--shadow); z-index: 1000; }
.dropdown-menu a { display: block; padding: 8px 16px; font-size: 0.9rem; color: var(--text-secondary); white-space: nowrap; transition: 0.2s; }
.dropdown-menu a:hover { background: var(--accent-dim); color: var(--accent); }
.dropdown:hover .dropdown-menu { display: block; }

/* =================== IB SECTION STYLES =================== */

/* IB Hub */
.ib-hub { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.ib-hub-header { display: flex; align-items: center; gap: 20px; margin-bottom: 40px; }
.ib-hub-icon { width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ib-hub-header h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 6px; }
.ib-hub-subtitle { color: var(--text-muted); font-size: 1.1rem; }

/* Global action cards on hub */
.ib-global-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 48px; }
.ib-action-card { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: 0.2s; text-decoration: none; color: inherit; }
.ib-action-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.ib-action-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ib-action-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.ib-action-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* Subject groups */
.ib-group { margin-bottom: 48px; }
.ib-group-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; color: var(--text-primary); }
.ib-subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ib-subject-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: 0.2s; text-decoration: none; color: inherit; }
.ib-subject-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.ib-subject-cover { height: 140px; background-size: cover; background-position: center; }
.ib-subject-info { padding: 14px 16px; }
.ib-subject-info h3 { font-size: 0.95rem; font-weight: 600; margin: 0; }

/* Subject layout */
.subject-layout { min-height: 100vh; }
.subject-hero { background-size: cover; background-position: center; padding: 80px 24px 60px; position: relative; }
.subject-hero-content { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.subject-hero-content h1 { font-size: 2.5rem; font-weight: 800; color: white; margin-bottom: 12px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.8); font-size: 0.9rem; margin-bottom: 16px; }
.breadcrumb a { color: rgba(255,255,255,0.9); text-decoration: none; }
.breadcrumb a:hover { color: white; text-decoration: underline; }
.exam-date-badge { display: inline-block; padding: 6px 14px; background: rgba(16,185,129,0.9); color: white; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }

.subject-container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.subject-description { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-top: 32px; }
.subject-description .markdown-content { line-height: 1.7; }
.subject-description .markdown-content h2 { font-size: 1.3rem; margin: 20px 0 12px; }
.subject-description .markdown-content h3 { font-size: 1.1rem; margin: 16px 0 10px; }
.subject-description .markdown-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.subject-description .markdown-content th, .subject-description .markdown-content td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.subject-description .markdown-content th { background: var(--bg-elevated); font-weight: 600; }

/* Mode grid */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.mode-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); text-decoration: none; color: inherit; transition: 0.2s; }
.mode-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.mode-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.mode-card h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.mode-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* Mode tabs */
.mode-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.mode-tab { padding: 8px 16px; border-radius: var(--radius-md); font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); text-decoration: none; transition: 0.2s; }
.mode-tab:hover { background: var(--bg-elevated); color: var(--text-primary); }
.mode-tab.active { background: var(--accent-dim); color: var(--accent); }

/* Topic accordion */
.topic-accordion { display: flex; flex-direction: column; gap: 8px; }
.accordion-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.accordion-header { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: none; border: none; color: var(--text-primary); font-size: 0.95rem; font-weight: 600; cursor: pointer; text-align: left; }
.accordion-header-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-decoration: none; color: var(--text-primary); font-size: 0.95rem; font-weight: 600; transition: 0.2s; }
.accordion-header-link:hover { background: var(--bg-elevated); }
.accordion-title { flex: 1; }
.accordion-chevron { transition: transform 0.2s; color: var(--text-muted); }
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body { display: none; padding: 0 16px 16px; }
.accordion-body.open { display: block; }
.topic-link { display: inline-block; padding: 8px 16px; background: var(--accent-dim); color: var(--accent); border-radius: var(--radius-md); text-decoration: none; font-weight: 500; font-size: 0.9rem; transition: 0.2s; }
.topic-link:hover { background: var(--accent); color: white; }
.topic-badge { display: inline-block; padding: 3px 10px; background: var(--bg-elevated); color: var(--text-muted); border-radius: 12px; font-size: 0.75rem; font-weight: 500; margin-left: 8px; }

/* PDF cards */
.pdf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.pdf-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: 0.2s; }
.pdf-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.pdf-thumb { height: 260px; background-size: cover; background-position: center; background-color: var(--bg-elevated); }
.pdf-info { padding: 14px 16px; }
.pdf-info h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.pdf-info p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

/* Gallery sections */
.gallery-section { margin-bottom: 48px; }
.gallery-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.gallery-section-header h2 { font-size: 1.3rem; font-weight: 700; }
.view-all-btn { padding: 6px 14px; background: var(--bg-elevated); color: var(--text-secondary); border-radius: var(--radius-md); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: 0.2s; border: 1px solid var(--border); }
.view-all-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* Premium badge */
.premium-badge { display: inline-block; padding: 2px 8px; background: linear-gradient(135deg, #f59e0b, #d97706); color: white; border-radius: 10px; font-size: 0.7rem; font-weight: 700; margin-left: 6px; vertical-align: middle; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); font-size: 1.1rem; }

/* Exemplar cards */
.exemplar-categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 32px; }
.exemplar-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; text-decoration: none; color: inherit; transition: 0.2s; }
.exemplar-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.exemplar-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.exemplar-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* Tutor */
.tutor-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; margin-top: 32px; }
.tutor-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; height: fit-content; }
.tutor-sidebar h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.tutor-sidebar a { display: block; padding: 8px 12px; border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; transition: 0.2s; }
.tutor-sidebar a:hover { background: var(--bg-elevated); color: var(--text-primary); }
.tutor-chat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-height: 500px; }
.chat-welcome { flex: 1; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.chat-welcome h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.chat-welcome p { color: var(--text-muted); margin-bottom: 24px; }
.suggestion-pills { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.suggestion-pills button { padding: 10px 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 20px; color: var(--text-secondary); font-size: 0.85rem; cursor: pointer; transition: 0.2s; }
.suggestion-pills button:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.chat-input-bar { display: flex; gap: 12px; padding: 20px; border-top: 1px solid var(--border); }
.chat-input-bar input { flex: 1; padding: 12px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-size: 0.95rem; }
.chat-input-bar input:focus { outline: none; border-color: var(--accent); }
.chat-input-bar button { padding: 12px 24px; background: var(--accent); color: white; border: none; border-radius: var(--radius-md); font-weight: 600; cursor: pointer; transition: 0.2s; }
.chat-input-bar button:hover { background: var(--accent-hover); }

/* Grader */
.grader-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 32px; }
.grader-step { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 16px; }
.grader-step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.grader-step p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.grader-step select { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-size: 0.9rem; margin-bottom: 8px; }
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 32px; text-align: center; cursor: pointer; transition: 0.2s; color: var(--text-muted); }
.upload-zone:hover { border-color: var(--accent); color: var(--accent); }
.upload-zone svg { margin: 0 auto 12px; display: block; }

/* Responsive */
@media (max-width: 768px) {
  .ib-hub-header { flex-direction: column; text-align: center; }
  .ib-subject-grid { grid-template-columns: repeat(2, 1fr); }
  .tutor-layout { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .pdf-grid { grid-template-columns: repeat(2, 1fr); }
  .subject-hero-content h1 { font-size: 1.8rem; }
  .grader-steps { grid-template-columns: 1fr; }
}

/* ============================================================
   ANIMATIONS v4.1 — EVERYTHING GETS ANIMATED
   ============================================================ */

/* ===== KEYFRAMES GALORE ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes scaleInBounce {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%      { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(16,185,129,0); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(16,185,129,0.3), 0 0 10px rgba(16,185,129,0.2); }
  50%      { box-shadow: 0 0 15px rgba(16,185,129,0.5), 0 0 30px rgba(16,185,129,0.3); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-8px); }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(2deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}
@keyframes wobble {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-8px) rotate(-3deg); }
  30%  { transform: translateX(6px) rotate(2deg); }
  45%  { transform: translateX(-4px) rotate(-1deg); }
  60%  { transform: translateX(2px) rotate(1deg); }
  75%  { transform: translateX(-1px) rotate(-0.5deg); }
  100% { transform: translateX(0); }
}
@keyframes elastic {
  0%  { transform: scale(1); }
  30% { transform: scale(1.15, 0.85); }
  40% { transform: scale(0.9, 1.1); }
  60% { transform: scale(1.05, 0.95); }
  100%{ transform: scale(1); }
}
@keyframes flipInX {
  from { opacity: 0; transform: perspective(400px) rotateX(30deg); }
  to   { opacity: 1; transform: perspective(400px) rotateX(0); }
}
@keyframes flipInY {
  from { opacity: 0; transform: perspective(400px) rotateY(30deg); }
  to   { opacity: 1; transform: perspective(400px) rotateY(0); }
}
@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-180deg) scale(0.3); }
  to   { opacity: 1; transform: rotate(0) scale(1); }
}
@keyframes blurIn {
  from { opacity: 0; filter: blur(10px); transform: scale(1.1); }
  to   { opacity: 1; filter: blur(0); transform: scale(1); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes ripple {
  0%   { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}
@keyframes skeleton {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes neonFlicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.4; }
}

/* ===== ANIMATION CLASSES ===== */
.anim-fade-in     { animation: fadeIn 0.7s ease-out forwards; }
.anim-fade-up     { animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.anim-fade-down   { animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.anim-slide-left  { animation: slideInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.anim-slide-right { animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.anim-scale-in    { animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; opacity: 0; }
.anim-scale-bounce{ animation: scaleInBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; opacity: 0; }
.anim-flip-x      { animation: flipInX 0.6s ease-out forwards; opacity: 0; }
.anim-flip-y      { animation: flipInY 0.6s ease-out forwards; opacity: 0; }
.anim-blur-in     { animation: blurIn 0.8s ease-out forwards; opacity: 0; }
.anim-rotate-in   { animation: rotateIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; opacity: 0; }
.anim-float       { animation: float 3s ease-in-out infinite; }
.anim-float-slow  { animation: floatSlow 4s ease-in-out infinite; }
.anim-pulse       { animation: pulse 2s ease-in-out infinite; }
.anim-pulse-glow  { animation: pulseGlow 2s ease-in-out infinite; }
.anim-bounce      { animation: bounce 2s ease-in-out infinite; }
.anim-wobble      { animation: wobble 1s ease-in-out; }
.anim-shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}
.anim-gradient {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}
.anim-spin-slow   { animation: spinSlow 8s linear infinite; }
.anim-elastic     { animation: elastic 0.6s ease-out; }
.anim-neon        { animation: neonFlicker 3s infinite; }

/* Stagger delays up to 16 */
.stagger-1  { animation-delay: 0.05s; }
.stagger-2  { animation-delay: 0.1s; }
.stagger-3  { animation-delay: 0.15s; }
.stagger-4  { animation-delay: 0.2s; }
.stagger-5  { animation-delay: 0.25s; }
.stagger-6  { animation-delay: 0.3s; }
.stagger-7  { animation-delay: 0.35s; }
.stagger-8  { animation-delay: 0.4s; }
.stagger-9  { animation-delay: 0.45s; }
.stagger-10 { animation-delay: 0.5s; }
.stagger-11 { animation-delay: 0.55s; }
.stagger-12 { animation-delay: 0.6s; }
.stagger-13 { animation-delay: 0.65s; }
.stagger-14 { animation-delay: 0.7s; }
.stagger-15 { animation-delay: 0.75s; }
.stagger-16 { animation-delay: 0.8s; }

/* ===== HOVER EFFECTS ===== */
.card-hover {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.card-hover::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(16,185,129,0.05), transparent);
  transition: left 0.5s ease;
}
.card-hover:hover::before { left: 100%; }
.card-hover:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 20px rgba(16,185,129,0.1);
  border-color: var(--accent);
}
.card-hover:active { transform: translateY(-2px) scale(0.98); }

.btn-hover {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.btn-hover::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}
.btn-hover:hover::after { width: 200%; height: 200%; }
.btn-hover:hover {
  transform: translateY(-3px);
  filter: brightness(1.15);
  box-shadow: 0 8px 25px rgba(16,185,129,0.3);
}
.btn-hover:active { transform: translateY(-1px); }

.topic-card {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.topic-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.download-link {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.download-link:hover {
  background: var(--border) !important;
  transform: translateX(8px) scale(1.01);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ===== GLOW & MAGNETIC ===== */
.magnetic-hover {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.glow-accent {
  transition: box-shadow 0.3s ease;
}
.glow-accent:hover {
  box-shadow: 0 0 20px rgba(16,185,129,0.3), 0 0 40px rgba(16,185,129,0.1);
}
.text-glow {
  transition: text-shadow 0.3s ease;
}
.text-glow:hover {
  text-shadow: 0 0 10px rgba(16,185,129,0.5);
}
.image-zoom {
  overflow: hidden;
}
.image-zoom img,
.image-zoom > div:first-child {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.image-zoom:hover img,
.image-zoom:hover > div:first-child {
  transform: scale(1.08);
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
}

/* ===== HERO PARALLAX ===== */
.hero-parallax {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

/* ===== BADGE ANIMATIONS ===== */
.badge-pop {
  animation: scaleInBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.badge-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ===== TAB TRANSITIONS ===== */
.tab-link {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.tab-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%;
  width: 0; height: 2px;
  background: var(--accent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}
.tab-link:hover::after { width: 80%; }
.tab-link:hover { transform: translateY(-1px); }

/* ===== AP PAGE AUTO-ANIMATIONS ===== */
.ucard {
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.ucard:nth-child(1) { animation-delay: 0.05s; }
.ucard:nth-child(2) { animation-delay: 0.1s; }
.ucard:nth-child(3) { animation-delay: 0.15s; }
.ucard:nth-child(4) { animation-delay: 0.2s; }
.ucard:nth-child(5) { animation-delay: 0.25s; }
.ucard:nth-child(6) { animation-delay: 0.3s; }
.ucard:nth-child(7) { animation-delay: 0.35s; }
.ucard:nth-child(8) { animation-delay: 0.4s; }
.ucard:nth-child(9) { animation-delay: 0.45s; }
.ucard:nth-child(10) { animation-delay: 0.5s; }
.ucard:nth-child(11) { animation-delay: 0.55s; }
.ucard:nth-child(12) { animation-delay: 0.6s; }

.rcard {
  opacity: 0;
  animation: scaleInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.rcard:nth-child(1) { animation-delay: 0.05s; }
.rcard:nth-child(2) { animation-delay: 0.1s; }
.rcard:nth-child(3) { animation-delay: 0.15s; }
.rcard:nth-child(4) { animation-delay: 0.2s; }
.rcard:nth-child(5) { animation-delay: 0.25s; }
.rcard:nth-child(6) { animation-delay: 0.3s; }

.exam-card, .subject-card, .ap-card {
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.exam-card:nth-child(1), .subject-card:nth-child(1), .ap-card:nth-child(1) { animation-delay: 0.05s; }
.exam-card:nth-child(2), .subject-card:nth-child(2), .ap-card:nth-child(2) { animation-delay: 0.1s; }
.exam-card:nth-child(3), .subject-card:nth-child(3), .ap-card:nth-child(3) { animation-delay: 0.15s; }
.exam-card:nth-child(4), .subject-card:nth-child(4), .ap-card:nth-child(4) { animation-delay: 0.2s; }
.exam-card:nth-child(5), .subject-card:nth-child(5), .ap-card:nth-child(5) { animation-delay: 0.25s; }
.exam-card:nth-child(6), .subject-card:nth-child(6), .ap-card:nth-child(6) { animation-delay: 0.3s; }
.exam-card:nth-child(7), .subject-card:nth-child(7), .ap-card:nth-child(7) { animation-delay: 0.35s; }
.exam-card:nth-child(8), .subject-card:nth-child(8), .ap-card:nth-child(8) { animation-delay: 0.4s; }

/* Hover lift for AP cards */
.ucard, .rcard {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ucard:hover, .rcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border-color: var(--accent);
}

/* Section headers animate in */
.section-head, .section-title {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Hero text */
.shero h1 {
  opacity: 0;
  animation: fadeInUp 0.7s ease-out 0.1s forwards;
}
.shero p {
  opacity: 0;
  animation: fadeInUp 0.7s ease-out 0.2s forwards;
}

/* =================== NEW INTERACTIVE FEATURES =================== */

/* --- Reading Progress Bar --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  z-index: 10001;
  width: 0%;
  transition: width 0.1s linear;
}

/* --- Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s ease;
  z-index: 9999;
  box-shadow: var(--shadow);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* --- Search --- */
.search-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 10002;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}
.search-overlay.active {
  display: flex;
}
.search-box {
  width: 90%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.search-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  outline: none;
}
.search-input-wrap input::placeholder {
  color: var(--text-muted);
}
.search-shortcut-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.search-results {
  max-height: 60vh;
  overflow-y: auto;
}
.search-result-item {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: 0.15s;
}
.search-result-item:hover {
  background: var(--accent-dim);
}
.search-result-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.search-result-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.search-result-item .search-result-url {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 2px;
}
.search-no-results {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Copy to Clipboard --- */
.code-copy-wrap {
  position: relative;
  display: inline-block;
}
.code-copy-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  line-height: 1;
}
.code-copy-wrap:hover .code-copy-btn {
  opacity: 1;
}
.code-copy-btn:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
li .code-copy-wrap,
p .code-copy-wrap {
  display: inline;
}
li .code-copy-btn,
p .code-copy-btn {
  position: static;
  margin-left: 6px;
  opacity: 0.6;
  font-size: 0.65rem;
  padding: 2px 6px;
  vertical-align: middle;
}
li:hover .code-copy-btn,
p:hover .code-copy-btn {
  opacity: 1;
}

/* --- Toast --- */
.vp-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 10003;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.vp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Light mode tweaks for new components */
[data-theme="light"] .search-overlay {
  background: rgba(0,0,0,0.35);
}
[data-theme="light"] .back-to-top {
  background: #fff;
}
[data-theme="light"] .back-to-top:hover {
  background: var(--accent);
  color: #fff;
}
[data-theme="light"] .nav {
  background: rgba(248,249,250,0.9);
}
[data-theme="light"] .mobile-toggle {
  color: var(--text);
}

/* ===== MOBILE MENU ===== */
.nav-links.active {
  display: flex;
  position: absolute;
  top: 68px;
  left: 0;
  right: 0;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  padding: 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  z-index: 999;
  box-shadow: var(--shadow);
}
[data-theme="light"] .nav-links.active {
  background: rgba(248,249,250,0.98);
}

/* ===== PAGE TRANSITION ===== */
body {
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.05s forwards;
}

/* ===== ENTRANCE ANIMATIONS FOR ALL CARDS ===== */
.ecard, .ib-subject-card, .mode-card, .topic-card, .pdf-card, .exemplar-card, .ib-action-card, .accordion-item {
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.ecard:nth-child(1), .ib-subject-card:nth-child(1), .mode-card:nth-child(1), .topic-card:nth-child(1), .pdf-card:nth-child(1), .exemplar-card:nth-child(1), .ib-action-card:nth-child(1), .accordion-item:nth-child(1) { animation-delay: 0.05s; }
.ecard:nth-child(2), .ib-subject-card:nth-child(2), .mode-card:nth-child(2), .topic-card:nth-child(2), .pdf-card:nth-child(2), .exemplar-card:nth-child(2), .ib-action-card:nth-child(2), .accordion-item:nth-child(2) { animation-delay: 0.1s; }
.ecard:nth-child(3), .ib-subject-card:nth-child(3), .mode-card:nth-child(3), .topic-card:nth-child(3), .pdf-card:nth-child(3), .exemplar-card:nth-child(3), .ib-action-card:nth-child(3), .accordion-item:nth-child(3) { animation-delay: 0.15s; }
.ecard:nth-child(4), .ib-subject-card:nth-child(4), .mode-card:nth-child(4), .topic-card:nth-child(4), .pdf-card:nth-child(4), .exemplar-card:nth-child(4), .ib-action-card:nth-child(4), .accordion-item:nth-child(4) { animation-delay: 0.2s; }
.ecard:nth-child(5), .ib-subject-card:nth-child(5), .mode-card:nth-child(5), .topic-card:nth-child(5), .pdf-card:nth-child(5), .exemplar-card:nth-child(5), .ib-action-card:nth-child(5), .accordion-item:nth-child(5) { animation-delay: 0.25s; }
.ecard:nth-child(6), .ib-subject-card:nth-child(6), .mode-card:nth-child(6), .topic-card:nth-child(6), .pdf-card:nth-child(6), .exemplar-card:nth-child(6), .ib-action-card:nth-child(6), .accordion-item:nth-child(6) { animation-delay: 0.3s; }
.ecard:nth-child(7), .ib-subject-card:nth-child(7), .mode-card:nth-child(7), .topic-card:nth-child(7), .pdf-card:nth-child(7), .exemplar-card:nth-child(7), .ib-action-card:nth-child(7), .accordion-item:nth-child(7) { animation-delay: 0.35s; }
.ecard:nth-child(8), .ib-subject-card:nth-child(8), .mode-card:nth-child(8), .topic-card:nth-child(8), .pdf-card:nth-child(8), .exemplar-card:nth-child(8), .ib-action-card:nth-child(8), .accordion-item:nth-child(8) { animation-delay: 0.4s; }

/* ===== BUTTON HOVER ENHANCEMENTS ===== */
.btn { position: relative; overflow: hidden; }
.btn-green::after, .btn-outline::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}
.btn-green:hover::after, .btn-outline:hover::after { width: 250%; height: 250%; }
.btn-green:hover { filter: brightness(1.1); box-shadow: 0 8px 25px rgba(16,185,129,0.35); }
.btn-outline:hover { background: var(--bg-card-hover); border-color: var(--accent); color: var(--accent); }

/* ===== SKELETON SHAPES ===== */
.skeleton-card { border-radius: var(--radius-lg); height: 160px; width: 100%; }
.skeleton-text { border-radius: var(--radius-sm); height: 14px; width: 100%; margin-bottom: 8px; }
.skeleton-title { border-radius: var(--radius-sm); height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-circle { border-radius: 50%; width: 48px; height: 48px; flex-shrink: 0; }
.skeleton-pulse { animation: skeleton 1.2s infinite; }

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  body { opacity: 1 !important; animation: none !important; }
  .ucard, .rcard, .ecard, .ib-subject-card, .mode-card, .topic-card, .pdf-card, .exemplar-card, .ib-action-card, .accordion-item, .fade-up, .anim-fade-up, .anim-fade-in, .anim-scale-bounce, .anim-slide-left, .anim-slide-right {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .nav, .footer, .mobile-toggle, .theme-toggle, .tabs, .hero-btns, .suggestion-pills, .upload-zone, .fc-controls, .fc-shuffle, .audio-player, .checklist-item, .drop-zone, .draggable, .game-card, .timer, .score, .pill, .showcase, .stack, .res-sidebar, .search-overlay, .back-to-top, .vp-toast, .code-copy-btn {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
    opacity: 1 !important;
    animation: none !important;
  }
  .content-box, .ucard, .rcard, .ecard, .mode-card, .ib-subject-card, .pdf-card, .exemplar-card, .ib-action-card, .accordion-item, .topic-card, .grader-step, .tutor-sidebar, .chat-input-bar, .flashcard-item, .practice-q, .video-item, .checklist-item {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: white !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .section, .shero, .unit-hero, .hero {
    padding: 16px !important;
    background: white !important;
    min-height: auto !important;
  }
  .section-inner, .shero-inner, .unit-hero-inner, .ib-hub, .subject-container {
    max-width: 100% !important;
  }
  h1, h2, h3, h4 {
    color: black !important;
  }
  p, li, .content-box p, .content-box li, .section-desc, .hero p {
    color: #333 !important;
  }
  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
  .rgrid, .egrid, .ib-subject-grid, .mode-grid, .pdf-grid, .exemplar-categories, .grader-steps, .tutor-layout, .ib-global-actions {
    grid-template-columns: 1fr !important;
  }
  .nav-links, .nav-links.active {
    display: none !important;
  }
}

