/* ==========================================================================
   ✨ ELYSIA CODE: 3D SPATIAL GLASSMORPHISM DESIGN SYSTEM
   ==========================================================================
   📌 KYA KAAM HAI IS CSS FILE KA (WHAT IT DOES):
     Ye file website ki styling, colors, glassmorphism blur, 3D perspective transforms,
     split-screen layout, responsive layout, aur dark cyber theme control karti hai.

   👁️ WEB PAGE PE KYA DIKHTA HAI:
     Obsidian dark theme, glowing borders, frosted glass blur, 3D tilt ho rahe cards,
     aur terminal screens ka modern Sci-Fi look!

   💡 KYUN USE KIYA (WHY WE USE THIS):
     Boring flat design ki jagah Pinterest-style 3D Spatial aesthetic dene ke liye.

   ⚠️ AGAR CHANGE/DELETE KAREIN TO:
     Agar ye file delete ho gayi to website bina kisi design ke 1995 jaisi plain
     black & white text ban jayegi!
   ========================================================================== */

/* 
  📌 :root — CSS GLOBAL VARIABLES (DESIGN TOKENS)
  👁️ Web Page Pe Effect: Pure page ka color palette, font aur border-radius yahan se decide hota hai.
  💡 Kyun use kiya: Agar kal ko blue color change karna ho, to 1000 jagah badalne ki jagah
     sirf yahan `--accent-cyan` badal do, pura website automatically naye color me shift ho jayega!
  ⚠️ Agar delete karein to: Saare variables crash ho jayenge aur default black text aayega.
*/
:root {
  --bg-cosmic: #060913;              /* Background ka deep midnight space color */
  --bg-card: rgba(13, 19, 36, 0.65); /* Cards ka semi-transparent dark background */
  --bg-card-hover: rgba(22, 33, 62, 0.75);
  --bg-glass-panel: rgba(15, 23, 42, 0.7);
  --border-glass: rgba(255, 255, 255, 0.1);       /* 10% transparent subtle white border */
  --border-glass-bright: rgba(255, 255, 255, 0.2);/* 20% transparent highlight border */
  --accent-cyan: #38bdf8;             /* Primary glowing cyan accent (Buttons & Highlights) */
  --accent-purple: #a855f7;           /* Secondary electric purple accent */
  --accent-emerald: #10b981;          /* Success green color (Tests passed) */
  --accent-rose: #f43f5e;             /* Danger red color (Panic mode & Errors) */
  --accent-amber: #f59e0b;            /* Warning / Viva questions yellow color */
  --text-main: #f8fafc;               /* Crystal white text color */
  --text-muted: #94a3b8;              /* Secondary gray text color */
  --text-dim: #64748b;                /* Dim labels color */
  --glow-cyan: 0 0 30px rgba(56, 189, 248, 0.35);    /* Neon cyan drop glow */
  --glow-purple: 0 0 30px rgba(168, 85, 247, 0.35);  /* Neon purple drop glow */
  --glow-emerald: 0 0 30px rgba(168, 85, 247, 0.35);
  --radius-xl: 28px;                  /* Organic smooth card corners */
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
}

/* ===========================================================================
   🎨 THEME DEFINITIONS (MIDNIGHT, DRACULA, EMERALD, SUNSET, ROYAL, LIGHT)
   =========================================================================== */

/* 1. 🌌 Midnight Cosmic (Default) */
:root,
body[data-theme="midnight"] {
  --bg-cosmic: #060913;
  --bg-card: rgba(13, 19, 36, 0.65);
  --bg-card-hover: rgba(22, 33, 62, 0.75);
  --bg-glass-panel: rgba(15, 23, 42, 0.7);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-bright: rgba(255, 255, 255, 0.2);
  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --glow-cyan: 0 0 30px rgba(56, 189, 248, 0.35);
  --glow-purple: 0 0 30px rgba(168, 85, 247, 0.35);
  --glow-emerald: 0 0 30px rgba(16, 185, 129, 0.35);
}

/* 2. 🧛 Dracula Cyber */
body[data-theme="dracula"] {
  --bg-cosmic: #1a1b26;
  --bg-card: rgba(30, 32, 48, 0.72);
  --bg-card-hover: rgba(41, 46, 66, 0.85);
  --bg-glass-panel: rgba(26, 27, 38, 0.82);
  --border-glass: rgba(187, 154, 247, 0.16);
  --border-glass-bright: rgba(187, 154, 247, 0.32);
  --accent-cyan: #7dcfff;
  --accent-purple: #bb9af7;
  --accent-emerald: #9ece6a;
  --accent-rose: #f7768e;
  --accent-amber: #e0af68;
  --text-main: #c0caf5;
  --text-muted: #9aa5ce;
  --text-dim: #565f89;
  --glow-cyan: 0 0 30px rgba(125, 207, 255, 0.35);
  --glow-purple: 0 0 30px rgba(187, 154, 247, 0.35);
}

body[data-theme="dracula"] .orb-1 {
  background: radial-gradient(circle, #bb9af7 0%, rgba(187, 154, 247, 0) 70%);
}
body[data-theme="dracula"] .orb-2 {
  background: radial-gradient(circle, #f7768e 0%, rgba(247, 118, 142, 0) 70%);
}
body[data-theme="dracula"] .orb-3 {
  background: radial-gradient(circle, #7dcfff 0%, rgba(125, 207, 255, 0) 70%);
}

/* 3. 🌲 Emerald Matrix */
body[data-theme="emerald"] {
  --bg-cosmic: #03140e;
  --bg-card: rgba(6, 36, 24, 0.7);
  --bg-card-hover: rgba(10, 54, 36, 0.82);
  --bg-glass-panel: rgba(5, 28, 19, 0.82);
  --border-glass: rgba(52, 211, 153, 0.18);
  --border-glass-bright: rgba(52, 211, 153, 0.35);
  --accent-cyan: #34d399;
  --accent-purple: #10b981;
  --accent-emerald: #059669;
  --accent-rose: #fb7185;
  --accent-amber: #fbbf24;
  --text-main: #ecfdf5;
  --text-muted: #a7f3d0;
  --text-dim: #6ee7b7;
  --glow-cyan: 0 0 30px rgba(52, 211, 153, 0.35);
  --glow-purple: 0 0 30px rgba(16, 185, 129, 0.35);
}

body[data-theme="emerald"] .orb-1 {
  background: radial-gradient(circle, #10b981 0%, rgba(16, 185, 129, 0) 70%);
}
body[data-theme="emerald"] .orb-2 {
  background: radial-gradient(circle, #34d399 0%, rgba(52, 211, 153, 0) 70%);
}
body[data-theme="emerald"] .orb-3 {
  background: radial-gradient(circle, #059669 0%, rgba(5, 150, 105, 0) 70%);
}

/* 4. 🌅 Sunset Amber */
body[data-theme="sunset"] {
  --bg-cosmic: #160a08;
  --bg-card: rgba(42, 18, 14, 0.72);
  --bg-card-hover: rgba(62, 26, 20, 0.84);
  --bg-glass-panel: rgba(32, 12, 10, 0.82);
  --border-glass: rgba(251, 146, 60, 0.2);
  --border-glass-bright: rgba(251, 146, 60, 0.4);
  --accent-cyan: #fb923c;
  --accent-purple: #f43f5e;
  --accent-emerald: #10b981;
  --accent-rose: #ef4444;
  --accent-amber: #f59e0b;
  --text-main: #fff7ed;
  --text-muted: #fed7aa;
  --text-dim: #ea580c;
  --glow-cyan: 0 0 30px rgba(251, 146, 60, 0.35);
  --glow-purple: 0 0 30px rgba(244, 63, 94, 0.35);
}

body[data-theme="sunset"] .orb-1 {
  background: radial-gradient(circle, #f97316 0%, rgba(249, 115, 22, 0) 70%);
}
body[data-theme="sunset"] .orb-2 {
  background: radial-gradient(circle, #f43f5e 0%, rgba(244, 63, 94, 0) 70%);
}
body[data-theme="sunset"] .orb-3 {
  background: radial-gradient(circle, #f59e0b 0%, rgba(245, 158, 11, 0) 70%);
}

/* 5. 👑 Royal Amethyst */
body[data-theme="royal"] {
  --bg-cosmic: #0d061c;
  --bg-card: rgba(28, 14, 56, 0.72);
  --bg-card-hover: rgba(44, 22, 86, 0.84);
  --bg-glass-panel: rgba(20, 10, 42, 0.82);
  --border-glass: rgba(168, 85, 247, 0.2);
  --border-glass-bright: rgba(168, 85, 247, 0.4);
  --accent-cyan: #c084fc;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #fbbf24;
  --text-main: #faf5ff;
  --text-muted: #e9d5ff;
  --text-dim: #a855f7;
  --glow-cyan: 0 0 30px rgba(192, 132, 252, 0.35);
  --glow-purple: 0 0 30px rgba(139, 92, 246, 0.35);
}

body[data-theme="royal"] .orb-1 {
  background: radial-gradient(circle, #9333ea 0%, rgba(147, 51, 234, 0) 70%);
}
body[data-theme="royal"] .orb-2 {
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
}
body[data-theme="royal"] .orb-3 {
  background: radial-gradient(circle, #c084fc 0%, rgba(192, 132, 252, 0) 70%);
}

/* 6. ☀️ Clean Minimal (Day Light Mode) */
body[data-theme="light"] {
  --bg-cosmic: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-glass-panel: rgba(241, 245, 249, 0.95);
  --border-glass: rgba(15, 23, 42, 0.12);
  --border-glass-bright: rgba(15, 23, 42, 0.22);
  --accent-cyan: #0284c7;
  --accent-purple: #7c3aed;
  --accent-emerald: #059669;
  --accent-rose: #e11d48;
  --accent-amber: #d97706;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --glow-cyan: 0 4px 20px rgba(2, 132, 199, 0.15);
  --glow-purple: 0 4px 20px rgba(124, 58, 237, 0.15);
  --glow-emerald: 0 4px 20px rgba(5, 150, 105, 0.15);
}

body[data-theme="light"] .aurora-container {
  opacity: 0.22;
}
body[data-theme="light"] .floating-navbar {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
body[data-theme="light"] .topic-chip {
  background: rgba(15, 23, 42, 0.05);
  color: #334155;
}
body[data-theme="light"] .mode-dock {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .dock-item {
  color: #475569;
}
body[data-theme="light"] .pill-btn {
  background: rgba(15, 23, 42, 0.05);
  color: #1e293b;
}
body[data-theme="light"] .stat-pill {
  background: rgba(15, 23, 42, 0.05);
  color: #1e293b;
}
body[data-theme="light"] .concept-card,
body[data-theme="light"] .mistake-card,
body[data-theme="light"] .viva-card {
  background: rgba(241, 245, 249, 0.8);
}
body[data-theme="light"] .card-3d-tilt {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* 
  📌 * (UNIVERSAL RESET)
  👁️ Web Page Pe Effect: Saari elements ka default browser margin aur padding 0 karta hai.
  💡 Kyun use kiya: `box-sizing: border-box` se padding aur border element ki width ke andar
     count hote hain, bahar nikal kar layout nahi todte!
*/
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased; /* Mac/iOS screens par text crisp aur sharp dikhata hai */
}

/* 
  📌 BODY (ENTIRE PAGE CONTAINER)
  👁️ Web Page Pe Effect: Pura background dark cosmic hota hai aur horizontal scrollbar gayab rehti hai.
*/
body {
  background-color: var(--bg-cosmic);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden; /* Faltu horizontal scrolling prevent karta hai */
  position: relative;
  line-height: 1.6;
}

/* 
  📌 AURORA BACKGROUND CONTAINERS & FLOATING ORBS
  👁️ Web Page Pe Effect: Peeche soft blur wali glowing lights tairti rehti hain.
  💡 Kyun use kiya: `filter: blur(120px)` se circle light diffuse hoke ethereal nebula ban jati hai.
*/
.aurora-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
  pointer-events: none; /* Mouse clicks ko peeche lights se pass-through karta hai */
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px); /* Massive blur for smooth cosmic glow */
  opacity: 0.45;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #38bdf8 0%, rgba(56, 189, 248, 0) 70%);
  top: -100px;
  left: 10%;
}

.orb-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, #a855f7 0%, rgba(168, 85, 247, 0) 70%);
  top: 40%;
  right: -100px;
  animation-duration: 25s;
  animation-delay: -5s;
}

.orb-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #10b981 0%, rgba(168, 85, 247, 0) 70%);
  bottom: -150px;
  left: 30%;
  animation-duration: 22s;
  animation-delay: -10s;
}

/* Keyframes: Lights ko slowly floating animation deta hai */
@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* 
  📌 APP WRAPPER: Content ko screen ke beech me center karta hai (max 1540px width)
*/
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px;
}

/* 
  📌 FLOATING 3D NAVBAR (TOP STICKY BAR)
  👁️ Web Page Pe Effect: Screen par upar chipka rehta hai, peeche ka content blur hota hai (`backdrop-filter`).
*/
.floating-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(13, 20, 39, 0.75);
  backdrop-filter: blur(28px);       /* Asli frosted glass effect! */
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass);
  border-radius: 9999px;              /* Full pill capsule shape */
  padding: 12px 28px;
  margin-bottom: 28px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: sticky;                  /* Scroll karne par bhi top par fix rehta hai */
  top: 16px;
  z-index: 100;
}

/* 
  📌 3D LOGO BADGE: Hover karne par 3D perspective me ghoomta hai
*/
.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-3d {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
  transform: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-logo-3d:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.35);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; /* Gradient text effect */
}

.brand-tag {
  font-size: 0.68rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 
  ===========================================================================
  📌 NAVBAR CONTROLS & TOGGLES (.nav-actions, .pill-group, .pill-btn)
  ===========================================================================
  📌 KYA KAAM HAI:
    Top navbar ke right side ke controls (English/Hinglish switcher, Python/HTML track switcher,
    aur sound FX toggle) ko align aur style karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Dark glass capsule ke andar cute rounded buttons jo click hone par glowing gradient
    ke saath activate ho jaate hain.
  💡 KYUN USE KIYA:
    `display: flex` aur `gap: 16px` use kiya taaki sabhi controls horizontal line me 
    proper spacing ke saath aapas me bina overlap hue align rahein.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Language aur subject change karne wale buttons ek doosre ke upar chadh jayenge
    ya unki modern glowing look khatam hokar boring default buttons ban jayenge.
*/
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Capsule shape container jisme 2 buttons (jaise EN | HI) fit hote hain */
.pill-group {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: 9999px; /* Poora circular pill look */
  padding: 4px;
  gap: 4px;
}

/* Pill ke andar ka single button */
.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-btn:hover {
  color: var(--text-main);
}

/* Active status: Jab button select ho tab cyan-purple gradient aur soft glow */
.pill-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(168, 85, 247, 0.2));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 🎨 Theme Selector Dropdown Styles */
.theme-select-container {
  display: inline-flex;
  align-items: center;
}

.theme-select-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.theme-select-box:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  color: #fff;
}

.theme-select-box:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.theme-select-box option {
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 12px;
}

body[data-theme="light"] .theme-select-box option {
  background: #ffffff;
  color: #0f172a;
}

/* 
  📌 3D CIRCULAR ICON BUTTON (.icon-btn-3d)
  👁️ Web Page Pe Effect: Sound (Audio) toggle ke liye circular glass button.
  💡 Kyun: Hover karne par thoda sa upar uthta hai (`translateY(-2px)`) jisse physical 3D button jaisa feel hota hai.
*/
.icon-btn-3d {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 1.1rem;
}

.icon-btn-3d:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

/* 
  ===========================================================================
  📌 FLOATING MODE DOCK (APP NAVIGATION BAR)
  ===========================================================================
  📌 KYA KAAM HAI:
    macOS ke Dock ya iPad ke navigation jaisa floating strip banata hai jisme saare 
    tabs (Learn & Code, Visual E-Book, Q-Bank, Mock Exam, Search, Code X-Ray, Panic) hain.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Screen ke center me floating horizontal buttons.
  💡 KYUN USE KIYA:
    `justify-content: center` se tabs humesha center me rahenge, aur `flex-wrap: wrap` 
    se screen choti hone par buttons doosri line me smoothly wrap ho jayenge.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    User alag-alag features ke beech switch nahi kar payega ya navigation toot jayega.
*/
.mode-dock {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

/* Single dock item: 3D glass card with spring hover physics */
.dock-item {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  /* cubic-bezier physics: spring bouncing effect deta hai jab hover chhute */
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
}

.dock-item:hover {
  transform: translateY(-4px);
  color: var(--text-main);
  border-color: var(--border-glass-bright);
}

/* Active tab button: Cyan glowing boundary and elevated look */
.dock-item.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(168, 85, 247, 0.2));
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px) scale(1.02);
}

/* Panic tab special styling: Red/Orange danger glow */
.dock-item.panic-item {
  border-color: rgba(244, 63, 94, 0.5);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(245, 158, 11, 0.15));
}

.dock-item.panic-item.active,
.dock-item.panic-item:hover {
  border-color: var(--accent-rose);
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.4);
}

/* 
  ===========================================================================
  📌 PANIC MODE HERO BANNER (.panic-banner)
  ===========================================================================
  📌 KYA KAAM HAI:
    Jab student ka kal exam ya viva ho, to top par warning/emergency banner show karta hai
    jo 10-minute viva booster launch karne ka option deta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Rose-amber gradient glow wala luminous glass box jisme left edge par glowing stripe hai.
  💡 KYUN USE KIYA:
    College students aksar exam se 1 ghanta pehle panic karte hain; ye banner unhe 
    direct most-important viva questions par redirect karta hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Student ko emergency preparation ka fast-track shortcut nahi milega.
*/
.panic-banner {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.18), rgba(168, 85, 247, 0.18));
  border: 1px solid rgba(244, 63, 94, 0.4);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-xl);
  padding: 24px 32px;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(244, 63, 94, 0.2);
}

/* 
  📌 ACCENT STRIP (.panic-banner::before)
  👁️ Web Page Pe Effect: Banner ke left edge par 6px moti glowing gradient vertical line.
  💡 Kyun: Pseudo-element (::before) use kiya taaki HTML me bina extra div daale decorative border ban sake.
*/
.panic-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-rose), var(--accent-amber));
}

.panic-info h2 {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.panic-info p {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin-top: 4px;
}

/* 
  📌 PULSING WARNING BADGE (.pulse-badge)
  👁️ Web Page Pe Effect: "10-MIN SURVIVAL" text continuously dhak-dhak (pulse) karta hai.
  💡 Kyun: User ka dhyan turant emergency status par kheenchne ke liye CSS animation use kiya.
  ⚠️ Agar hata dein: Badge static ho jayega, urgent feel nahi aayegi.
*/
.pulse-badge {
  background: var(--accent-rose);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

/* 
  📌 PANIC CTA BUTTON (.panic-cta-btn)
  👁️ Web Page Pe Effect: Glowing Rose button jo hover karne par bada ho jata hai (`scale(1.05)`).
*/
.panic-cta-btn {
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-amber));
  color: #fff;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.4);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.panic-cta-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(244, 63, 94, 0.6);
}

/* 
  ===========================================================================
  📌 TAB CONTENT VISIBILITY & SMOOTH SWITCHING (.tab-content)
  ===========================================================================
  📌 KYA KAAM HAI:
    Bina page reload kiye alag-alag tabs (Learn, Handbook, Q-Bank, Exam) ko 
    show ya hide karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Jo tab active hota hai wo halka sa neeche se upar slide ho kar fade in hota hai.
  💡 KYUN USE KIYA:
    Single Page Application (SPA) experience ke liye; by default sabhi tab `display: none` 
    rehte hain aur sirf `.active` wala `display: block` banta hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Saare 7 pages ek ke neeche ek khul jayenge aur page bohot lamba aur messy ho jayega.
*/
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

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

/* ==========================================================================
   PAGE 1: LEARN & CODE (Side-by-Side Split View)
   ========================================================================== */
/* 
  📌 SPLIT VIEW GRID CONTAINER (.split-view-container)
  📌 KYA KAAM HAI:
    Screen ko do equal parts me divide karta hai: Left side me Theory, Right side me Code Editor.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    50% width me syllabus/notes aur 50% width me code execution box.
  💡 KYUN USE KIYA:
    `grid-template-columns: 1fr 1fr` se dono panels equal fraction (fr) lete hain 
    aur screen ke hisaab se perfectly stretch hote hain.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Editor aur notes upar-neeche stack ho jayenge aur side-by-side interactive feel chali jayegi.
*/
.split-view-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

/* 
  📌 LEFT PANEL: THEORY CARD 3D (.theory-card-3d)
  📌 KYA KAAM HAI:
    Current topic ke mental models, real-world analogies, viva prep questions, 
    aur common mistakes ko contain karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Frosted glass container with rounded corners aur smooth scrollbar.
  💡 KYUN USE KIYA:
    `max-height: 850px` aur `overflow-y: auto` lagaya taaki agar notes lambe bhi hon, 
    to card screen se bahar na bhage aur card ke andar hi scroll ho sake.
*/
.card-3d-tilt {
  transform: none !important;
  perspective: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.card-3d-tilt:hover {
  transform: none !important;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4) !important;
}

.theory-card-3d {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-height: 850px;
  overflow-y: auto;
  position: relative;
}

/* 
  📌 HORIZONTAL TOPIC STRIP (.topic-selector-strip)
  👁️ Web Page Pe Effect: Saare topic chips (Variables, Loops, etc.) ek single horizontal row me aate hain jise swipe/scroll kar sakte hain.
*/
.topic-selector-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

/* 
  📌 TOPIC CHIP BADGES (.topic-chip)
  📌 KYA KAAM HAI:
    Har topic (e.g. 01. Variables, 02. Conditionals) ka clickable rounded button banata hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Horizontal scrollable pills; hover karne ya select hone par Cyan border aur glowing background aata hai.
  💡 KYUN USE KIYA:
    `border-radius: 9999px` se circular pill shape banta hai, aur `transition: all 0.2s ease` 
    se hover animation smooth lagti hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Topics rectangular boring link lagenge ya unka selection highlight gayab ho jayega.
*/
.topic-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.topic-chip:hover, .topic-chip.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* 
  📌 LESSON HEADER & TYPOGRAPHY (.lesson-header, .lesson-tag, .lesson-title)
  👁️ Web Page Pe Effect: Topic ka tag (jaise PYTHON BASICS • 15 MINS) aur bada heading text.
*/
.lesson-header {
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 16px;
}

.lesson-tag {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lesson-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 
  ===========================================================================
  📌 VISUAL REAL-WORLD ANALOGY BOX (.analogy-box)
  ===========================================================================
  📌 KYA KAAM HAI:
    Complex programming concepts ko real life ke practical examples (jaise Kitchen 
    ka Dabba, Traffic Light, Remote Control) se samjhata hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Subtle Cyan-Purple glowing card jisme explanation formatted readable text me hota hai.
  💡 KYUN USE KIYA:
    Text-heavy rote learning se hatkar visual mental model banane ke liye.
    `line-height: 1.6` se sentences ke beech achha vertical gap rehta hai jisse padhne me aasaani hoti hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Student ko boring bookish definitions hi milengi aur concept feel nahi hoga.
*/
.analogy-box {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
}

.box-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.analogy-text {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.6;
}

/* 
  ===========================================================================
  📌 🚨 ANTI-PATTERN & COMMON MISTAKE ALERT CARD (.mistake-card)
  ===========================================================================
  📌 KYA KAAM HAI:
    Beginners jo common galtiyaan karte hain (jaise Python me `=` vs `==`, 
    indentation error, index out of range) unko highlight karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Red danger card jisme Galat Code (Red snippet), kyu fail hua, aur Sahi Code (Green snippet) dikhta hai.
  💡 KYUN USE KIYA:
    Exam me students sabse zyada marks silly mistakes ki wajah se khote hain;
    Red aur Green color visual comparison se dimag me fix baith jata hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Student wahi purani galtiyaan lab exam me repeat karega aur viva me fas jayega.
*/
.mistake-card {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.1), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
}

.mistake-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-rose);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* Red Snippet: Galat code dikhane wala box */
.mistake-snippet {
  background: rgba(0, 0, 0, 0.4);
  border-left: 3px solid var(--accent-rose);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #fecdd3;
  margin-bottom: 10px;
  border-radius: 0 8px 8px 0;
}

.mistake-explain {
  font-size: 0.88rem;
  color: #cbd5e1;
  margin-bottom: 10px;
}

/* Green Snippet: Correct code solution */
.mistake-fix {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--accent-emerald);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #a7f3d0;
  border-radius: 0 8px 8px 0;
}

/* 
  ===========================================================================
  📌 TOP VIVA PREP ACCORDION (.viva-accordion)
  ===========================================================================
  📌 KYA KAAM HAI:
    College lab practicals ke viva examiner jo sawal poochte hain, 
    unke expected answers aur teacher ko kya bolna hai, wo display karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Amber/Golden accented card jisme numbered Questions aur Model Answers hote hain.
  💡 KYUN USE KIYA:
    Students ko pata hona chahiye ki Viva me kya bolna hai taaki full viva marks milein.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Viva questions theory notes ke saath mix hokar kho jayenge.
*/
.viva-accordion {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
}

/* Viva Question Box: Har sawal aur uske model answer ko separate karta hai */
.viva-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.viva-q-box {
  margin-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.viva-q-box:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.viva-q-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
}

.viva-a-text {
  font-size: 0.84rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* 
  ===========================================================================
  📌 RIGHT PANEL: INTERACTIVE CODE EDITOR & TERMINAL (.editor-card-3d)
  ===========================================================================
  📌 KYA KAAM HAI:
    Coding sandbox area provide karta hai jisme student Python/HTML likh sakta hai, 
    terminal output dekh sakta hai, aur memory variables trace kar sakta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Sleek dark glassmorphic coding IDE card with rounded pill buttons.
  💡 KYUN USE KIYA:
    `flex-direction: column` aur `gap: 16px` use karke toolbar, code editor, 
    terminal aur memory tracker vertically clean hierarchy me arrange hote hain.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Coding window toot jayegi ya elements screen ke bahar overflow kar jayenge.
*/
.editor-card-3d {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 850px;
}

/* 
  📌 EDITOR TOP TOOLBAR (.editor-toolbar)
  👁️ Web Page Pe Effect: File tab name (e.g. main.py ya index.html) aur Run/Submit action buttons.
*/
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.editor-tab-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-actions {
  display: flex;
  gap: 10px;
}

/* 
  📌 RUN CODE BUTTON (.btn-primary-3d)
  📌 KYA KAAM HAI:
    User ke likhe Python code ko in-browser WebAssembly (Pyodide) me execute karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Cyan glowing gradient button jo click karne par physical switch jaisa feel deta hai.
  💡 KYUN USE KIYA:
    `box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35)` button ke peeche neon aura deta hai.
*/
.btn-primary-3d {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #fff;
  border: none;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
  transition: all 0.2s ease;
}

.btn-primary-3d:hover {
  background: linear-gradient(135deg, #38bdf8, #0369a1);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
}

.btn-primary-3d:active {
  transform: translateY(0);
}

/* 
  📌 SUBMIT SOLUTION BUTTON (.btn-success-3d)
  👁️ Web Page Pe Effect: Emerald green button jo test cases verify karta hai.
*/
.btn-success-3d {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  border: none;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-success-3d:hover {
  background: linear-gradient(135deg, #34d399, #047857);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-success-3d:active {
  transform: translateY(0);
}

/* 
  ===========================================================================
  📌 CODE EDITING AREA (.code-editor-wrapper & .code-textarea)
  ===========================================================================
  📌 KYA KAAM HAI:
    User ko code type karne ke liye dark IDE editor deta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Dark grey code window jisme monospace (JetBrains Mono) font me code likha hota hai.
  💡 KYUN USE KIYA:
    `font-family: var(--font-mono)` se har character ki width exact barabar hoti hai, 
    jo programming me indentation aur brackets align rakhne ke liye zaroori hai.
    `resize: none` se user textarea ka shape kharab nahi kar sakta.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Text area ordinary form input jaisa lagega aur coding experience kharab ho jayega.
*/
.code-editor-wrapper {
  position: relative;
  flex: 1;
  min-height: 280px;
  background: rgba(3, 7, 18, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.code-textarea {
  width: 100%;
  height: 100%;
  min-height: 280px;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 16px;
  resize: none;
  outline: none;
  line-height: 1.6;
}

/* ===========================================================================
   📌 CODEMIRROR SYNTAX-HIGHLIGHTED IDE EDITOR STYLING
   =========================================================================== */
.CodeMirror {
  width: 100% !important;
  height: 100% !important;
  min-height: 280px !important;
  font-family: var(--font-mono), 'JetBrains Mono', Consolas, monospace !important;
  font-size: 0.92rem !important;
  line-height: 1.6 !important;
  background: transparent !important;
  color: #f8fafc !important;
  padding: 4px 0 !important;
}

.CodeMirror-gutters {
  background: rgba(15, 23, 42, 0.75) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding-right: 6px !important;
}

.CodeMirror-linenumber {
  color: #64748b !important;
  font-size: 0.78rem !important;
  padding: 0 4px 0 6px !important;
}

.CodeMirror-cursor {
  border-left: 2px solid #38bdf8 !important;
}

.CodeMirror-selected {
  background: rgba(56, 189, 248, 0.22) !important;
}

.CodeMirror-focused .CodeMirror-selected {
  background: rgba(56, 189, 248, 0.3) !important;
}

.CodeMirror-line {
  padding: 0 12px !important;
}

/* Python Syntax Highlighting Tokens (Vibrant Modern VS Code / Dracula Theme) */
.cm-s-dracula.CodeMirror { background: transparent !important; }
.cm-s-dracula .cm-keyword { color: #c084fc !important; font-weight: 600; }  /* def, class, return, if, for, while, in, import */
.cm-s-dracula .cm-builtin { color: #38bdf8 !important; font-weight: 600; }  /* print, len, range, input, type, int, str */
.cm-s-dracula .cm-string { color: #4ade80 !important; }                     /* "hello", 'name', f"..." */
.cm-s-dracula .cm-string-2 { color: #4ade80 !important; }
.cm-s-dracula .cm-number { color: #fb923c !important; font-weight: 600; }  /* 10, 3.14, 0xFF */
.cm-s-dracula .cm-def { color: #facc15 !important; font-weight: 700; }     /* def calculate_total() */
.cm-s-dracula .cm-comment { color: #94a3b8 !important; font-style: italic; } /* # comments */
.cm-s-dracula .cm-operator { color: #f472b6 !important; }                  /* +, -, *, ==, != */
.cm-s-dracula .cm-atom { color: #a78bfa !important; font-weight: 600; }     /* True, False, None */
.cm-s-dracula .cm-variable { color: #f1f5f9 !important; }                  /* regular identifiers */
.cm-s-dracula .cm-variable-2 { color: #e2e8f0 !important; }
.cm-s-dracula .cm-variable-3 { color: #38bdf8 !important; }
.cm-s-dracula .cm-property { color: #38bdf8 !important; }                  /* obj.attribute */
.cm-s-dracula .cm-tag { color: #f472b6 !important; font-weight: 600; }     /* <div>, <p> in HTML */
.cm-s-dracula .cm-attribute { color: #facc15 !important; }                 /* class="", id="" in HTML */
.cm-s-dracula .cm-matchingbracket { color: #38bdf8 !important; font-weight: 700; border-bottom: 2px solid #38bdf8; }

/* 
  📌 HTML LIVE PREVIEW IFRAME (.html-preview-frame)
  📌 KYA KAAM HAI:
    Jab student HTML/CSS seekh raha ho, to live website preview render karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    White browser canvas jisme actual HTML buttons, headings, aur styles live dikhte hain.
*/
.html-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 280px;
  background: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  display: none; /* By default hidden, sirf HTML track pe visible */
}

/* 
  ===========================================================================
  📌 TERMINAL & OUTPUT SCREEN (.terminal-card)
  ===========================================================================
  📌 KYA KAAM HAI:
    Python ke `print()` statements ka output aur errors (traceback) display karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Dark black terminal screen jisme normal output Green me aur Error Red me aata hai.
  💡 KYUN USE KIYA:
    `white-space: pre-wrap` lagaya taaki spaces aur newlines (`\n`) exact waisi hi 
    render hon jaise terminal me hoti hain.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Output ki formatting toot jayegi aur sab ek hi line me chipak jayega.
*/
.terminal-card {
  background: rgba(3, 7, 18, 0.92);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-height: 120px;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Standard Output: Saaf suthra mint-green text */
.terminal-stdout {
  color: #a7f3d0;
  white-space: pre-wrap;
}

/* Error Output: Red/Pink error warning text */
.terminal-stderr {
  color: #fecdd3;
  white-space: pre-wrap;
}

/* Terminal Tabs */
.term-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.term-tab-btn:hover {
  color: #e2e8f0;
}

.term-tab-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

/* Original Pyodide Interactive REPL Console View */
.repl-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  max-height: 120px;
  overflow-y: auto;
}

.repl-line {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.repl-line.system-line {
  color: #64748b;
  font-size: 0.75rem;
}

.repl-line.input-line {
  color: #38bdf8;
}

.repl-line.output-line {
  color: #a7f3d0;
}

.repl-line.result-line {
  color: #facc15;
}

.repl-line.error-line {
  color: #f87171;
}

.repl-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  padding: 4px 8px;
}

.repl-prompt {
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.repl-input-field {
  flex: 1;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

/* ANSI Terminal Color Classes */
.ansi-bold { font-weight: 700; }
.ansi-black { color: #64748b; }
.ansi-red { color: #f87171; }
.ansi-green { color: #4ade80; }
.ansi-yellow { color: #facc15; }
.ansi-blue { color: #60a5fa; }
.ansi-magenta { color: #c084fc; }
.ansi-cyan { color: #38bdf8; }
.ansi-white { color: #f1f5f9; }

/* 
  ===========================================================================
  📌 INTERACTIVE TERMINAL INPUT BAR (.terminal-input-bar)
  ===========================================================================
*/
.terminal-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 10px;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
  animation: slideUp 0.2s ease-out;
}

.terminal-prompt-sym {
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
}

.terminal-stdin-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.terminal-stdin-field::placeholder {
  color: rgba(148, 163, 184, 0.6);
  font-size: 0.8rem;
}

/* 
  ===========================================================================
  📌 3D LIVE VARIABLE MEMORY VISUALIZER (.memory-tracker-card)
  ===========================================================================
  📌 KYA KAAM HAI:
    RAM me variables kaise store hote hain unka live 3D visual card banata hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Purple glowing boxes jisme variable ka naam (jaise `x`, `score`) aur uski 
    current value (jaise `10`, `'Elysia'`) 3D tilt ke saath dikhti hai.
  💡 KYUN USE KIYA:
    `transform: perspective(300px) rotateX(4deg)` se box 3D tilted lagta hai; 
    hover karne par flat aur elevate hota hai. Beginners ko RAM memory mentally 
    visualize karne me bohot madad milti hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    User ko code run karne par memory me kya badla wo samajh nahi aayega.
*/
.memory-tracker-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
}

.memory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.memory-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.var-box-3d {
  background: rgba(13, 20, 39, 0.85);
  border: 1px solid var(--accent-purple);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
  min-width: 100px;
  transform: none;
  transition: all 0.2s ease;
}

.var-box-3d:hover {
  transform: translateY(-1px);
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.var-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.var-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* 
  ===========================================================================
  📌 SOCRATIC AI SENIOR FLOATING HINT BOX (.senior-advice-bubble)
  ===========================================================================
  📌 KYA KAAM HAI:
    Jab code run karne par koi Python error (SyntaxError, TypeError, IndexError) aata hai,
    to ek "Senior Bhaiya/Didi" ki tarah Hinglish me friendly guidance deta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Warm golden/amber toast bubble jo screen ke bottom-right se slide up hokar pop hota hai.
  💡 KYUN USE KIYA:
    College freshers cryptic English tracebacks dekh kar darr jaate hain; 
    ye bubble bina direct answer spoon-feed kiye unhe sahi direction me guide karta hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Student error decode nahi kar payega aur stuck ho jayega.
*/
.senior-advice-bubble {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(244, 63, 94, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.86rem;
  color: #fef08a;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  display: none;
}

.senior-advice-bubble.active {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

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

/* ==========================================================================
   PAGE 2: DYNAMIC QUESTION BANK
   ========================================================================== */
/* 
  📌 QUESTION BANK TOP FILTER BAR (.qbank-header-card)
  📌 KYA KAAM HAI:
    Questions ko Category (Loops, Functions, Strings) aur Difficulty (Beginner, Intermediate, Tricky) 
    ke according filter karne ke dropdowns provide karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Frosted glass header bar jisme stylized dropdown menus hain.
*/
.qbank-header-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px 32px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Custom Dropdown select menu */
.custom-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.custom-select option {
  background: #0f172a;
  color: #fff;
}

/* 
  📌 QUESTIONS RESPONSIVE GRID (.questions-container)
  📌 KYA KAAM HAI:
    Saare practice questions ko auto-adjusting responsive grid me display karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Desktop par 2 ya 3 columns aur mobile par 1 column automatically.
  💡 KYUN USE KIYA:
    `grid-template-columns: repeat(auto-fill, minmax(460px, 1fr))` bina hardcoded media 
    queries ke cards ko screen width ke hisaab se wrap kar deta hai!
*/
.questions-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 24px;
}

/* 
  📌 SINGLE QUESTION CARD (.question-card-3d)
  👁️ Web Page Pe Effect: Hover karne par 4px upar lift hota hai aur boundary glowing blue ho jaati hai.
*/
.question-card-3d {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.question-card-3d:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
}

.q-badge-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* 
  📌 DIFFICULTY BADGES (Beginner: Green, Intermediate: Amber, Tricky: Red)
  👁️ Web Page Pe Effect: Colorful pill tags jo student ko question ka level batate hain.
*/
.q-diff-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
}

.diff-beginner { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.diff-intermediate { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.diff-tricky { background: rgba(244, 63, 94, 0.2); color: #fb7185; }

.q-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.q-desc {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 16px;
  line-height: 1.6;
}

.q-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-glass);
  padding-top: 14px;
}

.card-solved {
  border-color: rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.15) !important;
}

.solved-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   PAGE 3: COLLEGE MOCK TEST & LAB VIVA SIMULATOR
   ========================================================================== */
/* 
  📌 MOCK EXAM HEADER & 3D COUNTDOWN TIMER (.mock-exam-header & .timer-box-3d)
  📌 KYA KAAM HAI:
    Real college semester exam jaisa 25-minute ticking timer aur test header render karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Glowing red countdown capsule clock (jaise 24:59).
  💡 KYUN USE KIYA:
    Exam hall jaisa psychological pressure create karne ke liye taaki student time management seekhe.
*/
.mock-exam-header {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px 32px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timer-box-3d {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid var(--accent-rose);
  padding: 8px 20px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fecdd3;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
}

/* Single section in exam (e.g. Section A: Viva MCQs, Section B: Coding) */
.exam-section-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
}

.section-badge-header {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

/* 
  📌 2-COLUMN MCQ OPTIONS GRID (.mcq-options-grid & .mcq-option-btn)
  👁️ Web Page Pe Effect: Har question ke 4 options do columns me aate hain; click karne par Cyan background ke saath select ho jaate hain.
  💡 Kyun: Standard online examination interface jaisa realistic user experience dene ke liye.
*/
.mcq-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.mcq-option-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.mcq-option-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.mcq-option-btn.selected {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* ==========================================================================
   PAGE 4: INSTANT TOPIC SEARCH & 60-SEC DOUBT BUSTER
   ========================================================================== */
/* 
  📌 SEARCH HERO BOX (.search-hero-box & .search-input-3d)
  📌 KYA KAAM HAI:
    Student agar kisi keyword (jaise "recursion", "lambda", "flexbox", "dictionary") 
    se doubt clear karna chahe to live search engine provide karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Center me illuminated search box jisme type karte hi neon blue glow trigger hota hai.
  💡 KYUN USE KIYA:
    `box-shadow: inset 0 2px 10px rgba(0,0,0,0.5)` se search bar physical carved slot 
    jaisa lagta hai, aur focus hone par `box-shadow: 0 0 30px rgba(56, 189, 248, 0.35)` 
    luminous glow deta hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Search bar standard boring input ban jayega.
*/
.search-hero-box {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 36px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 36px auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.search-input-wrapper {
  position: relative;
  margin-top: 20px;
}

.search-input-3d {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 16px 28px;
  font-size: 1.05rem;
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.search-input-3d:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.35);
}

.search-results-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

/* ==========================================================================
   PAGE 5: CODE X-RAY (VIVA SHIELD / LINE EXPLAINER)
   ========================================================================== */
/* 
  📌 CODE X-RAY ENGINE (.xray-container & .xray-line-item)
  📌 KYA KAAM HAI:
    User ke likhe code ko line-by-line dissect karke har line ka "Viva Explanation" 
    aur "Teacher kya puchega" batata hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Interactive line items jinko click karne par right side me us line ka deep explanation load hota hai.
  💡 KYUN USE KIYA:
    External examiner viva me aksar code ke kisi specific line par ungli rakh kar poochta hai:
    "Is line ka kya matlab hai?". Ye feature usi viva situation ki taiyari karwata hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Student ko har line ka deep viva meaning samajh nahi aayega.
*/
.xray-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.xray-line-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.xray-line-item:hover, .xray-line-item.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

/* ==========================================================================
   MODALS: 3D FLEX CARD & LAB FILE EXPORTER
   ========================================================================== */
/* 
  📌 3D DIALOG MODAL (.modal-overlay, .modal-card-3d, .modal-close-btn)
  📌 KYA KAAM HAI:
    Lab File PDF Exporter aur Shareable Achievement Flex Card ko screen ke upar 
    popup dialog me render karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Peeche ka poora background dark blur ho jata hai aur center me 3D perspective 
    card float karta hai.
  💡 KYUN USE KIYA:
    `position: fixed` aur `z-index: 1000` se modal screen ke sabse upar rehta hai.
    `backdrop-filter: blur(16px)` peeche ke content ko luxurious frosted glass blur deta hai.
    `transform: perspective(800px) rotateX(2deg)` card ko halka sa tilted 3D angle deta hai.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Modals work nahi karenge ya screen ke peeche chhip jayenge.
*/
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card-3d {
  background: rgba(13, 20, 39, 0.95);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 580px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  position: relative;
  transform: none;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #fff;
}

/* 
  ===========================================================================
  📌 RESPONSIVE BREAKPOINTS (MEDIA QUERIES)
  ===========================================================================
  📌 KYA KAAM HAI:
    Website ko Tablet (iPad) aur Mobile screens par automatically adapt karta hai.
  👁️ WEB PAGE PE KYA DIKHTA HAI:
    Screen choti hone par 2-column split view 1-column me convert ho jata hai 
    taaki content chhota ya overflow na ho.
  💡 KYUN USE KIYA:
    Responsive Web Design ke rule ke tehat: 
    - 1024px se neeche desktop split columns ko vertical stack bana diya (`grid-template-columns: 1fr`).
    - 768px se neeche navbar aur panic banner ko horizontal flex se vertical column banaya.
  ⚠️ AGAR CHANGE/DELETE KAREIN TO:
    Mobile phone par website horizontally cut jayegi aur horizontal scrolling karni padegi.
*/
@media (max-width: 1024px) {
  .split-view-container, .xray-container {
    grid-template-columns: 1fr;
  }
  .questions-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .floating-navbar {
    border-radius: var(--radius-lg);
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  .nav-stats-group {
    order: 3;
    width: 100%;
    justify-content: space-around;
  }
  .panic-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .mcq-options-grid {
    grid-template-columns: 1fr;
  }
  .profile-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ==========================================================================
   ⚡ HABIT & PRODUCTIVITY COUNTERS IN NAVBAR (DUOLINGO/INSTAGRAM LOOP)
   ========================================================================== */
.nav-stats-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: default;
  transition: transform 0.15s ease;
  user-select: none;
}

.stat-pill:hover {
  transform: translateY(-1px);
}

.streak-pill {
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.35);
  color: #fb923c;
}

.xp-pill {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fbbf24;
}

.timer-pill {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.stat-unit {
  font-size: 0.7rem;
  opacity: 0.85;
}

/* ==========================================================================
   🌳 CURRICULUM TREE NAVIGATION (CHAPTERS & SUBTOPICS)
   ========================================================================== */
.curriculum-nav-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.chapter-selector-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-pill:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.2);
}

.chapter-pill.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.25));
  border-color: rgba(56, 189, 248, 0.6);
  color: #fff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.subtopic-selector-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.subtopic-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.subtopic-pill:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #fff;
}

.subtopic-pill.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.subtopic-pill.completed {
  border-color: rgba(16, 185, 129, 0.35);
}

.subtopic-pill.completed::after {
  content: " ✓";
  color: #34d399;
  font-weight: 800;
}

/* ==========================================================================
   📖 LEFT PANEL: THEORY, EXAMPLES & CHALLENGE CARDS
   ========================================================================== */
.subtopic-meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.duration-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.xp-pill-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.concept-card {
  border-radius: var(--radius-md);
  padding: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(168, 85, 247, 0.05));
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.why-card {
  border-radius: var(--radius-md);
  padding: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(16, 185, 129, 0.04));
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.syntax-card {
  border-radius: var(--radius-md);
  padding: 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(56, 189, 248, 0.04));
  border: 1px solid rgba(168, 85, 247, 0.25);
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.syntax-pre {
  background: #020617;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #c084fc;
  overflow-x: auto;
  overflow-y: hidden;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.syntax-pre code {
  white-space: inherit;
  display: block;
}

.rules-card {
  border-radius: var(--radius-md);
  padding: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.09), rgba(239, 68, 68, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.28);
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.rules-bullet-list {
  padding-left: 20px;
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.7;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.rules-bullet-list li {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rules-bullet-list li strong {
  color: #fbbf24;
}

.example-card {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.example-label {
  font-size: 0.82rem;
  color: #94a3b8;
  flex: 1 1 160px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.example-label strong {
  color: #f1f5f9;
}

.example-code-pre {
  background: #030712;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 8px;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.example-code-pre code {
  white-space: inherit;
  display: block;
}

.example-expl {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
  width: 100%;
  max-width: 100%;
}

.btn-micro {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-micro:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* 🎯 Challenge Card */
.challenge-card {
  border-radius: var(--radius-md);
  padding: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.challenge-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fbbf24;
}

.challenge-reward {
  font-size: 0.75rem;
  font-weight: 700;
  color: #34d399;
}

.challenge-prompt-text {
  font-size: 0.9rem;
  color: #f1f5f9;
  margin-bottom: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  width: 100%;
  max-width: 100%;
}

.challenge-expected-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: 6px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.challenge-expected-box code {
  color: #34d399;
  font-family: var(--font-mono);
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.challenge-actions-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.solution-box {
  background: #020617;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.solution-box.hidden {
  display: none;
}

.solution-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: #34d399;
  font-weight: 700;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.solution-code-pre {
  background: #030712;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #34d399;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 8px;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.solution-code-pre code {
  white-space: inherit;
  display: block;
}

.solution-code-pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #86efac;
  padding: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 6px;
  line-height: 1.4;
}

.solution-expl-text {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* 🔥 Ego Roast Box */
.ego-roast-box {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.08));
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.ego-roast-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.ego-roast-title {
  font-size: 0.78rem;
  color: #f87171;
  display: block;
  margin-bottom: 2px;
}

.ego-roast-msg {
  font-size: 0.84rem;
  color: #fca5a5;
  line-height: 1.4;
}

.subtopic-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   👤 USER PROFILE & PRODUCTIVITY MODAL
   ========================================================================== */
.profile-modal-card {
  max-width: 620px;
  width: 92%;
  padding: 28px;
  background: rgba(13, 19, 36, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-xl);
}

.profile-header-banner {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.profile-avatar-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  flex-shrink: 0;
}

.profile-avatar-emoji {
  font-size: 2rem;
}

.profile-badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.ego-rank-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.level-indicator {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.profile-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.profile-motto {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
}

.profile-xp-progress-wrap {
  margin-bottom: 20px;
}

.profile-xp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.profile-xp-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.profile-xp-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #38bdf8, #a855f7);
  transition: width 0.4s ease;
}

.profile-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}

.metric-icon {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.metric-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

.metric-label {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 2px;
}

.habit-streak-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.section-title-small {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.habit-status-tag {
  color: #fb923c;
  font-size: 0.75rem;
}

.streak-days-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.streak-day {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.streak-day.active {
  background: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.4);
}

.streak-day.today {
  box-shadow: 0 0 10px rgba(251, 146, 60, 0.4);
}

.day-letter {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 2px;
}

.day-dot {
  font-size: 0.75rem;
  color: #cbd5e1;
}

.streak-day.active .day-dot {
  color: #fb923c;
}

.curriculum-mastery-section {
  margin-bottom: 16px;
}

.ego-roadmap-section {
  margin-bottom: 20px;
}

.ranks-pills-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rank-step {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  color: #64748b;
  white-space: nowrap;
}

.rank-step.passed {
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
}

.rank-step.current {
  color: #fff;
  background: linear-gradient(135deg, #0284c7, #9333ea);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.profile-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 🎊 CONFETTI CANVAS */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* ==========================================================================
   🔐 AUTHENTICATION MODAL & USER PROFILE PICTURE STYLES
   ========================================================================== */
.nav-user-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 20, 39, 0.9);
  border: 1.5px solid var(--accent-cyan);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-avatar-emoji {
  font-size: 0.85rem;
  line-height: 1;
}

.nav-user-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-rank-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-weight: 700;
}

/* Auth Modal Card */
.auth-modal-card {
  max-width: 440px;
  width: 90%;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  position: relative;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 12px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.4;
}

/* Tabs switcher */
.auth-tabs-row {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.auth-tab-btn {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.84rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.25));
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

/* Inputs */
.auth-input-group {
  margin-bottom: 14px;
  text-align: left;
}

.auth-input-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.auth-input-field {
  width: 100%;
  background: rgba(13, 20, 39, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.auth-input-field:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* Avatar Selection Box */
.auth-avatar-selection-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.avatar-picker-flex {
  display: flex;
  gap: 14px;
  align-items: center;
}

.avatar-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.avatar-preview-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  background: rgba(13, 20, 39, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.avatar-preview-tag {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 700;
}

.avatar-options-col {
  flex: 1;
}

.avatar-emoji-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.avatar-opt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 1.2rem;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-opt-btn:hover {
  transform: scale(1.1);
  border-color: #38bdf8;
}

.avatar-opt-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.25);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Feedback banner */
.auth-feedback-banner {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  text-align: center;
}

.auth-feedback-banner.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.auth-feedback-banner.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.auth-submit-btn {
  width: 100%;
  padding: 11px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.auth-switch-prompt {
  text-align: center;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 14px;
}

.auth-switch-prompt a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 700;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ==========================================================================
   🤖 ELYSIA SENIOR AI TUTOR & CODE DEBUGGER DRAWER (Powered by Groq)
   ========================================================================== */
.ai-tutor-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 9999px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.25);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(16px);
}

.ai-tutor-fab:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.4);
}

.ai-fab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.ai-fab-label {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
}

.ai-status-dot {
  font-size: 0.68rem;
  color: #10b981;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-tutor-drawer {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 110px);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(24px);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-tutor-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ai-drawer-header {
  padding: 14px 18px;
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-drawer-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ai-drawer-close:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
}

.ai-quick-pills {
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-quick-pills::-webkit-scrollbar {
  display: none;
}

.ai-chip {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.ai-chip:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
}

.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
}

.ai-msg-bot {
  align-self: flex-start;
}

.ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ai-msg-user .ai-msg-avatar {
  background: rgba(168, 85, 247, 0.2);
}

.ai-msg-body {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #e2e8f0;
  word-break: break-word;
}

.ai-msg-bot .ai-msg-body {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-left-radius: 4px;
}

.ai-msg-user .ai-msg-body {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border-top-right-radius: 4px;
}

.ai-chat-input-row {
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-chat-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  font-size: 0.84rem;
  outline: none;
  resize: none;
  max-height: 100px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.ai-chat-input:focus {
  border-color: #38bdf8;
}

.ai-send-btn {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-send-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
}



/* =============================================================================
   🏛️ PIXEL-CLOSE ELYSIA CODE MASTER DESIGN SYSTEM & LAYOUT SPECIFICATION
   Directly matching reference image composition, hero, sidebar, and workspace.
   ============================================================================= */

/* 1. App Shell Container */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #07090e;
  color: #f8fafc;
  font-family: var(--font-sans);
}

/* 2. Left Sidebar Navigation */
.app-sidebar {
  width: 220px;
  min-width: 220px;
  height: 100vh;
  background: #090d16;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 50;
  user-select: none;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px 16px 14px 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-crystal-logo {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title-text {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffffff;
}

.brand-sub-text {
  font-size: 0.62rem;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.sidebar-nav {
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  flex: 1;
}

.side-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8.5px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}

.side-nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.side-nav-btn.active {
  background: #182030;
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.side-nav-btn.active .side-nav-icon {
  color: #38bdf8;
}

.side-nav-icon {
  font-size: 0.95rem;
  width: 18px;
  display: inline-flex;
  justify-content: center;
  flex-shrink: 0;
}

.side-nav-chevron {
  margin-left: auto;
  color: #64748b;
  font-size: 0.9rem;
}

.sidebar-widgets-section {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-progress-widget {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sp-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-ring-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.sp-ring-svg {
  transform: rotate(-90deg);
}

.sp-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 4.5;
}

.sp-ring-bar {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 132;
  stroke-dashoffset: 116;
}

.sp-ring-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
}

.sp-info {
  display: flex;
  flex-direction: column;
}

.sp-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
}

.sp-chapters {
  font-size: 0.62rem;
  color: #64748b;
}

.sp-dots-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 2px;
}

.sp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.sp-dot.active {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.sidebar-scenic-card {
  position: relative;
  background-image: linear-gradient(180deg, rgba(9, 13, 22, 0.35) 0%, rgba(9, 13, 22, 0.95) 100%), url('../images/elysia-hero.jpg');
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.scenic-quote-text {
  font-size: 0.7rem;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.35;
  margin-bottom: 3px;
}

.scenic-quote-author {
  font-size: 0.62rem;
  font-weight: 600;
  color: #94a3b8;
  text-align: right;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.side-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.2s;
}

.side-user-chip:hover {
  background: rgba(255, 255, 255, 0.07);
}

.side-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  border: 1.5px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  overflow: hidden;
  flex-shrink: 0;
}

.side-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.side-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-role {
  font-size: 0.65rem;
  color: #64748b;
}

.side-settings-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  transition: color 0.2s;
}

.side-settings-btn:hover {
  color: #ffffff;
}

.sidebar-theme-segmented {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
  margin-top: 10px;
  gap: 2px;
}

.theme-seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.theme-seg-btn:hover {
  color: #ffffff;
}

.theme-seg-btn.active {
  background: #ffffff;
  color: #090d16;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* 3. Main Viewport & Header */
.app-main-viewport {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px 48px 20px;
  background: #07090e;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.mobile-sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.mobile-sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 49;
  display: none;
}

.sidebar-backdrop.active {
  display: block;
}

.viewport-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 2px;
  box-sizing: border-box;
}

.viewport-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.hero-back-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 9999px;
  color: #38bdf8;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: default;
  padding: 3px 10px;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  max-width: 180px;
  text-overflow: ellipsis;
}

.hero-back-tag:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.viewport-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 18, 30, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 6px 14px;
  width: 250px;
  transition: all 0.2s;
}

.hero-search-box:focus-within {
  width: 300px;
  border-color: #38bdf8;
  background: rgba(13, 18, 30, 0.95);
}

.hero-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.8rem;
  width: 100%;
}

.hero-search-box kbd {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile Preferences Trigger & Collapsible Menu */
.mobile-prefs-toggle-btn {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(13, 18, 30, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 5px 11px;
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-prefs-toggle-btn:hover,
.mobile-prefs-toggle-btn[aria-expanded="true"] {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.mobile-prefs-collapse {
  display: none;
  width: 100%;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease, opacity 0.2s ease;
  opacity: 0;
  box-sizing: border-box;
}

.mobile-prefs-collapse.open {
  display: block;
  max-height: 240px;
  padding: 12px 14px;
  opacity: 1;
}

.mobile-prefs-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-prefs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-prefs-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #94a3b8;
}

.hero-icon-round-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(13, 18, 30, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.hero-icon-round-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.hero-avatar-round-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.84rem;
  transition: all 0.2s;
}

.hero-avatar-round-btn:hover {
  border-color: #38bdf8;
  transform: scale(1.05);
}

/* 4. Cinematic Hero Banner */
.hero-banner-container {
  position: relative;
  width: 100%;
  min-height: 400px;
  border-radius: 18px;
  background-image: 
    linear-gradient(90deg, rgba(7, 9, 14, 0.98) 0%, rgba(7, 9, 14, 0.9) 36%, rgba(7, 9, 14, 0.42) 62%, rgba(7, 9, 14, 0.12) 100%),
    url('../images/elysia-hero.jpg');
  background-size: cover;
  background-position: center right;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px 32px 36px 32px;
  box-sizing: border-box;
  overflow: hidden;
}

.hero-main-content-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 5;
  width: 100%;
}

.hero-text-col {
  max-width: 500px;
}

.hero-display-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3.1rem;
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0 0 12px 0;
}

.hero-display-headline .headline-accent {
  background: linear-gradient(135deg, #818cf8 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-support-desc {
  font-size: 0.94rem;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0 0 24px 0;
  max-width: 440px;
}

.hero-buttons-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-btn-continue {
  background: #ffffff;
  color: #090d16;
  border: none;
  border-radius: 9999px;
  padding: 12px 24px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.hero-btn-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.35);
  background: #f1f5f9;
}

.hero-btn-curriculum {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 12px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-btn-curriculum:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}

.hero-character-quote-tag {
  display: none; /* Removed: floating italic text was visually cluttered and had no purpose */
}

/* 5. Keep Going Panel & Upper-Right Floating Quote Block */
.hero-top-quote-block {
  position: absolute;
  top: 24px;
  right: 28px;
  background: rgba(10, 14, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  z-index: 10;
  text-align: right;
  min-width: 200px;
}

.ht-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.ht-quote {
  font-size: 0.78rem;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.35;
}

.ht-author {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 3px;
}

.keep-going-panel {
  position: absolute;
  top: 26px;
  right: 28px;
  width: 275px;
  background: rgba(10, 14, 24, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  z-index: 10;
}

.keep-going-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.keep-going-heading {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.streak-badge-flame {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 9999px;
}

.week-calendar-strip {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 3px;
  border-radius: 6px;
  min-width: 26px;
}

.cal-d-name {
  font-size: 0.62rem;
  color: #64748b;
  font-weight: 600;
}

.cal-d-num {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 700;
}

.cal-day-col.active {
  background: #3b82f6;
  border-radius: 16px;
  padding: 6px 4px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.cal-day-col.active .cal-d-name,
.cal-day-col.active .cal-d-num {
  color: #ffffff;
}

.keep-going-quote-box {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.kg-quote-mark {
  font-size: 1.3rem;
  line-height: 1;
  color: #64748b;
  font-family: Georgia, serif;
}

.kg-quote-text {
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.kg-author {
  font-size: 0.68rem;
  color: #64748b;
  display: block;
  margin-top: 2px;
}

/* 6. Dashboard Progress & Quick Action Cards */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
}

.stat-card-ref {
  background: #0d121d;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card-ref:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-circle-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.stat-ring-svg {
  transform: rotate(-90deg);
}

.stat-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.stat-ring-bar {
  fill: none;
  stroke: url(#stat-ring-grad);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 188;
  stroke-dashoffset: 165;
  transition: stroke-dashoffset 0.8s ease;
}

.stat-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
}

.progress-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #94a3b8;
}

.breakdown-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.dot-blue { background: #3b82f6; }
.dot-cyan { background: #38bdf8; }
.dot-purple { background: #a855f7; }
.dot-emerald { background: #10b981; }

.breakdown-item .item-val {
  font-weight: 700;
  color: #ffffff;
}

.stat-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.badge-part {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}

.current-chapter-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chapter-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chapter-info {
  flex: 1;
}

.chapter-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 6px;
}

.chapter-progress-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 5px;
}

.chapter-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  border-radius: 9999px;
}

.chapter-topics-count {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
}

.next-topic-body {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.play-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

.next-topic-body:hover .play-icon-box {
  background: #38bdf8;
  color: #0f172a;
}

.next-info {
  flex: 1;
}

.next-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 5px;
}

.next-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.arrow-sym {
  font-size: 0.88rem;
  color: #38bdf8;
}

.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.qa-btn {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #94a3b8;
  transition: all 0.2s;
}

.qa-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #ffffff;
  transform: translateY(-2px);
}

.qa-icon {
  font-size: 1rem;
}

.qa-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

/* Today's Focus Card & Checklist */
.focus-checklist-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 10px 0;
}

.focus-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: #cbd5e1;
  cursor: pointer;
}

.focus-check-item input[type="checkbox"] {
  accent-color: #38bdf8;
  cursor: pointer;
}

.focus-check-item.done {
  color: #64748b;
  text-decoration: line-through;
}

.mini-strip {
  margin-bottom: 0 !important;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chapter-topics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 7. Integrated Course Workspace (Three Coordinated Regions) */
.view-collapsed {
  display: none !important;
}

.course-focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 18, 29, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 16px;
  margin-bottom: 14px;
}

.focus-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-back-dashboard {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-back-dashboard:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.focus-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.focus-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.focus-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.focus-chapter-indicator {
  font-size: 0.76rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 6px;
}

.integrated-workspace-grid {
  display: grid;
  grid-template-columns: minmax(200px, 230px) minmax(0, 1fr) minmax(320px, 380px);
  gap: 14px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.integrated-workspace-grid.tree-collapsed {
  grid-template-columns: 48px minmax(0, 1fr) minmax(320px, 380px);
}

.course-focus-mode .integrated-workspace-grid {
  min-height: calc(100vh - 140px);
}

.workspace-panel {
  background: #0d121d;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.course-focus-mode .workspace-panel {
  height: 100% !important;
  max-height: 100% !important;
}

/* Tree Panel */
.tree-panel {
  padding: 14px;
  height: auto;
  max-height: none;
  min-width: 0;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.tree-panel.collapsed {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  padding: 12px 6px;
  overflow: hidden;
}

.tree-panel.collapsed .tree-title,
.tree-panel.collapsed .tree-search-bar,
.tree-panel.collapsed .course-tree-content {
  display: none !important;
}

.tree-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tree-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
}

.tree-toggle-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.95rem;
}

.tree-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 12px;
}

.tree-search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.78rem;
  width: 100%;
}

.course-tree-content {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 2px;
}

.tree-part-group {
  margin-bottom: 4px;
}

.tree-part-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.tree-part-header:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.tree-part-badge {
  font-size: 0.68rem;
  color: #64748b;
}

.tree-chapters-list {
  padding-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.tree-ch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.tree-ch-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tree-subtopics-list {
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.tree-sub-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  font-size: 0.74rem;
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.tree-sub-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.tree-sub-item.active {
  background: #1e3a8a;
  color: #ffffff;
  font-weight: 700;
}

/* Lesson Reader Panel */
.lesson-panel {
  display: block !important;
  padding: 20px 22px;
  overflow-y: visible;
  overflow-x: hidden;
  height: auto;
  max-height: none;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: normal;
}

.lesson-breadcrumb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.bc-item.active {
  color: #38bdf8;
  font-weight: 600;
}

.lesson-title-meta-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.lesson-h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
  margin: 0;
  flex: 1 1 200px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.lesson-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.meta-badge-time {
  font-size: 0.7rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.circle-fraction-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  flex-shrink: 0;
}

.lesson-summary-p {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lesson-pill-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  height: auto;
  flex-shrink: 0;
  box-sizing: border-box;
}

.lesson-pill-tabs::-webkit-scrollbar {
  display: none;
}

.l-tab {
  background: transparent;
  border: none;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.l-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.l-tab.active {
  background: #3b82f6;
  color: #ffffff;
  font-weight: 700;
}

.lesson-content-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.lesson-main-col {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.lesson-subrail-col {
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.subrail-heading {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.subrail-links-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subrail-link {
  font-size: 0.74rem;
  color: #94a3b8;
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 4px;
  border-left: 2px solid transparent;
  overflow-wrap: anywhere;
}

.subrail-link:hover {
  color: #ffffff;
}

.subrail-link.active {
  color: #38bdf8;
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  font-weight: 600;
}

.subrail-bullets-list {
  padding-left: 14px;
  margin: 0;
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.6;
}

.subrail-bullets-list li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.related-link {
  display: block;
  font-size: 0.73rem;
  color: #94a3b8;
  text-decoration: none;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.related-link:hover {
  color: #38bdf8;
}

.block-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.block-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0 0 10px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.5;
}

.code-snippet-box {
  background: #060912;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.code-snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: #64748b;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.copy-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.7rem;
}

.copy-btn:hover {
  color: #ffffff;
}

.snippet-pre {
  padding: 10px 12px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #e2e8f0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.snippet-pre code {
  font-family: inherit;
  font-size: inherit;
  white-space: inherit;
  display: block;
}

.output-preview-card {
  background: #060912;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.output-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 4px;
  width: 100%;
  min-width: 0;
}

.btn-run-snippet {
  background: #3b82f6;
  border: none;
  border-radius: 5px;
  color: #ffffff;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.output-preview-text {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #10b981;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.educational-tip-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8rem;
  color: #fef3c7;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.educational-tip-box .tip-icon {
  flex-shrink: 0;
}

.educational-tip-box .tip-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.related-link:hover {
  color: #38bdf8;
}

/* Editor Panel */
.editor-panel {
  padding: 14px;
  height: auto;
  max-height: none;
  box-sizing: border-box;
}

.editor-panel-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.editor-tabs-group {
  display: flex;
  gap: 4px;
}

.e-tab {
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.e-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 700;
}

.e-expand-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.95rem;
}

.editor-engine-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.engine-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 3px 8px;
}

.engine-dropdown {
  background: transparent;
  border: none;
  outline: none;
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-editor-reset {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  color: #94a3b8;
  cursor: pointer;
}

.monaco-like-editor-wrapper {
  background: #060912;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  min-height: 200px;
  max-height: 260px;
  overflow: hidden;
  margin-bottom: 10px;
}

.btn-run-prominent {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.35);
  transition: all 0.2s;
}

.btn-run-prominent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.5);
}

.run-key-hint {
  font-size: 0.7rem;
  opacity: 0.7;
  font-weight: 500;
}

.terminal-box-ref {
  background: #060912;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.term-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.term-left-tabs {
  display: flex;
  gap: 2px;
}

.term-tab {
  background: transparent;
  border: none;
  font-size: 0.7rem;
  color: #64748b;
  cursor: pointer;
  padding: 2px 5px;
}

.term-tab.active {
  color: #38bdf8;
  font-weight: 700;
}

.term-clear-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.7rem;
}

.stdout-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #10b981;
  min-height: 36px;
}

.stderr-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #f43f5e;
}

.try-yourself-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
}

.try-yourself-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.try-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fbbf24;
}

.try-hint-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: #ffffff;
  padding: 2px 6px;
  font-size: 0.68rem;
  cursor: pointer;
}

.try-prompt-p {
  font-size: 0.76rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0 0 6px 0;
}

.try-footer-row {
  display: flex;
  justify-content: flex-end;
}

.try-sol-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: #94a3b8;
  font-size: 0.68rem;
  padding: 2px 6px;
  cursor: pointer;
}

/* =========================================================================
   8. LOWER SHOWCASE PREVIEWS ROW (Original Dark Cosmic Cards)
   ========================================================================= */
/* Now 2 cards only (Mobile View & Theme Switch filler cards removed) */
.bottom-showcase-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
}

.showcase-card {
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-size: cover;
  background-position: center;
  min-height: 260px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.sc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sc-title {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 2px 0;
}

.sc-subtitle {
  font-size: 0.7rem;
  color: #94a3b8;
  margin: 0;
}

.sc-tabs {
  display: flex;
  gap: 3px;
}

.sc-tab {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 9999px;
  padding: 2px 6px;
  font-size: 0.62rem;
  color: #94a3b8;
  cursor: pointer;
}

.sc-tab.active {
  background: #3b82f6;
  color: #ffffff;
}

.sc-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sc-item-box {
  background: rgba(13, 18, 30, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.sc-item-box:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}

.sc-item-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 6px;
}

.sc-item-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 3px;
}

.sc-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.62rem;
  color: #64748b;
  margin-bottom: 3px;
}

.level-tag {
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
}

.level-tag.beginner {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.level-tag.intermediate {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.sc-item-desc {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1.3;
  margin: 0;
}

.sc-exam-card {
  background: rgba(13, 18, 30, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.sc-exam-card:hover {
  transform: translateY(-2px);
  border-color: #a855f7;
}

.exam-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.exam-icon-circle.blue-icon { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.exam-icon-circle.purple-icon { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.exam-icon-circle.green-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.exam-card-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffffff;
}

.exam-card-sub {
  font-size: 0.65rem;
  color: #64748b;
  margin-bottom: 4px;
}

.exam-card-meta {
  font-size: 0.64rem;
  color: #94a3b8;
  margin-bottom: 6px;
}

.btn-start-exam {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
}

.preview-badge-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 8px;
}

.device-mockup-frame {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.device-mockup-frame.light-frame {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

.mockup-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mockup-header-bar.light {
  color: #0f172a;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.mockup-body {
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mockup-greet {
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.3;
}

.mockup-greet.light {
  color: #334155;
}

.mockup-hero-btn {
  background: #ffffff;
  color: #090d16;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 9999px;
  padding: 4px 10px;
  text-align: center;
  margin: 3px 0;
  border: none;
  cursor: pointer;
}

.mockup-hero-btn.light-btn {
  background: #3b82f6;
  color: #ffffff;
}

.mockup-course-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
}

.mockup-course-title.light {
  color: #64748b;
}

.mockup-part-row, .mockup-ch-row {
  font-size: 0.65rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
}

.part-prog, .ch-prog {
  font-weight: 700;
  color: #38bdf8;
}

/* 9. Light Theme Complete Overrides */
body[data-theme="light"] .app-layout,
body[data-theme="light"] .app-main-viewport {
  background: #f8fafc;
  color: #0f172a;
}

/* 1. Light Mode: Sidebar & Navigation */
body[data-theme="light"] .app-sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

body[data-theme="light"] .brand-title-text {
  color: #0f172a;
}

body[data-theme="light"] .brand-sub-text {
  color: #64748b;
}

body[data-theme="light"] .side-nav-btn {
  color: #475569;
}

body[data-theme="light"] .side-nav-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #0f172a;
}

body[data-theme="light"] .side-nav-btn.active {
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 700;
  box-shadow: none;
}

body[data-theme="light"] .side-nav-btn.active .side-nav-icon {
  color: #0284c7;
}

body[data-theme="light"] .side-nav-chevron {
  color: #94a3b8;
}

body[data-theme="light"] .sidebar-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .side-user-chip {
  background: rgba(0, 0, 0, 0.03);
}

body[data-theme="light"] .side-user-chip:hover {
  background: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .side-user-name {
  color: #0f172a;
}

body[data-theme="light"] .side-user-role {
  color: #64748b;
}

body[data-theme="light"] .side-settings-btn {
  color: #64748b;
}

body[data-theme="light"] .side-settings-btn:hover {
  color: #0f172a;
}

body[data-theme="light"] .side-avatar-circle {
  background: #f1f5f9;
  border-color: #0284c7;
}

body[data-theme="light"] .sidebar-progress-widget {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .sp-title {
  color: #64748b;
}

body[data-theme="light"] .sp-status {
  color: #0f172a;
}

body[data-theme="light"] .sp-ring-bg {
  stroke: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .sp-ring-val {
  color: #0f172a;
}

/* 2. Light Mode: Top Toolbar & Header Controls */
body[data-theme="light"] .pill-group {
  background: #e2e8f0;
  border-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .pill-btn {
  color: #475569;
}

body[data-theme="light"] .pill-btn:hover {
  color: #0f172a;
}

body[data-theme="light"] .pill-btn.active {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .hero-back-tag {
  color: #475569;
}
body[data-theme="light"] .hero-back-tag:hover {
  color: #0f172a;
}

body[data-theme="light"] .hero-search-box {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
body[data-theme="light"] .hero-search-box input {
  color: #0f172a;
}
body[data-theme="light"] .hero-search-box kbd {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.1);
  color: #64748b;
}

body[data-theme="light"] .hero-icon-round-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

body[data-theme="light"] .hero-avatar-round-btn {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* 3. Light Mode: Hero Banner & Keep Going Panel */
body[data-theme="light"] .hero-banner-container {
  background-image: 
    linear-gradient(90deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.88) 38%, rgba(255, 255, 255, 0.38) 64%, rgba(255, 255, 255, 0.08) 100%),
    url('../images/elysia-hero-light.jpg');
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .hero-display-headline {
  color: #0f172a;
}

body[data-theme="light"] .hero-support-desc {
  color: #475569;
}

body[data-theme="light"] .hero-character-quote-tag {
  color: rgba(15, 23, 42, 0.6);
}

body[data-theme="light"] .hero-btn-curriculum {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.15);
}

body[data-theme="light"] .keep-going-panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .keep-going-heading {
  color: #0f172a;
}

body[data-theme="light"] .cal-d-num {
  color: #334155;
}

body[data-theme="light"] .kg-quote-text {
  color: #475569;
}

body[data-theme="light"] .keep-going-quote-box {
  border-top-color: rgba(0, 0, 0, 0.08);
}

/* 4. Light Mode: Dashboard Stats Cards */
body[data-theme="light"] .stat-card-ref,
body[data-theme="light"] .workspace-panel {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

body[data-theme="light"] .stat-card-title,
body[data-theme="light"] .tree-part-header,
body[data-theme="light"] .block-desc {
  color: #64748b;
}

body[data-theme="light"] .stat-ring-bg {
  stroke: #e2e8f0;
}

body[data-theme="light"] .chapter-progress-bar-wrap {
  background: #e2e8f0;
}

body[data-theme="light"] .chapter-icon-box {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .play-icon-box {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.25);
  color: #0284c7;
}

body[data-theme="light"] .stat-ring-text,
body[data-theme="light"] .item-val,
body[data-theme="light"] .chapter-name,
body[data-theme="light"] .next-title,
body[data-theme="light"] .tree-title,
body[data-theme="light"] .lesson-h2,
body[data-theme="light"] .block-title {
  color: #0f172a;
}

body[data-theme="light"] .qa-btn {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.06);
  color: #475569;
}
body[data-theme="light"] .qa-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

body[data-theme="light"] .lesson-summary-p,
body[data-theme="light"] .breakdown-item {
  color: #475569;
}

body[data-theme="light"] .educational-tip-box {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

/* 5. Light Mode: Course Navigation Tree */
body[data-theme="light"] .tree-search-bar {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .tree-search-bar input {
  color: #0f172a;
}

body[data-theme="light"] .tree-ch-header {
  color: #334155;
}
body[data-theme="light"] .tree-ch-header:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body[data-theme="light"] .tree-sub-item {
  color: #64748b;
}
body[data-theme="light"] .tree-sub-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
body[data-theme="light"] .tree-sub-item.active {
  background: #dbeafe;
  color: #1e40af;
}

body[data-theme="light"] .tree-toggle-btn {
  color: #64748b;
}

/* 6. Light Mode: Lesson Explanation, Cards & High-Contrast Typography */
body[data-theme="light"] .lesson-breadcrumb-row {
  color: #64748b;
}
body[data-theme="light"] .bc-item.active {
  color: #0284c7;
}

body[data-theme="light"] .lesson-pill-tabs {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .l-tab {
  color: #64748b;
}
body[data-theme="light"] .l-tab:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}
body[data-theme="light"] .l-tab.active {
  background: #0284c7;
  color: #ffffff;
}

body[data-theme="light"] .circle-fraction-badge {
  background: #e2e8f0;
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.3);
}

body[data-theme="light"] .meta-badge-time {
  background: #f1f5f9;
  color: #64748b;
  border-color: rgba(0, 0, 0, 0.08);
}

/* High-contrast lesson cards in light mode */
body[data-theme="light"] .concept-card {
  background: #f8fafc;
  border: 1px solid rgba(2, 132, 199, 0.22);
}
body[data-theme="light"] .concept-card .box-label {
  color: #0284c7 !important;
}

body[data-theme="light"] .why-card {
  background: #f8fafc;
  border: 1px solid rgba(2, 132, 199, 0.22);
}
body[data-theme="light"] .why-card .box-label {
  color: #0284c7 !important;
}

body[data-theme="light"] .syntax-card {
  background: #f8fafc;
  border: 1px solid rgba(124, 58, 237, 0.22);
}
body[data-theme="light"] .syntax-card .box-label {
  color: #7c3aed !important;
}

body[data-theme="light"] .rules-card {
  background: #fffbeb;
  border: 1px solid rgba(217, 119, 6, 0.28);
}
body[data-theme="light"] .rules-card .box-label {
  color: #b45309 !important;
}

/* Exact fix for invisible lesson text in light mode */
body[data-theme="light"] .analogy-text {
  color: #1e293b !important;
}

body[data-theme="light"] .rules-bullet-list {
  color: #334155 !important;
}
body[data-theme="light"] .rules-bullet-list li strong {
  color: #b45309 !important;
}

body[data-theme="light"] .analogy-box {
  background: #f8fafc;
  border-color: rgba(2, 132, 199, 0.2);
}
body[data-theme="light"] .analogy-box .box-label {
  color: #0284c7;
}

body[data-theme="light"] .example-card {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .example-label {
  color: #475569 !important;
}
body[data-theme="light"] .example-label strong {
  color: #0f172a !important;
}
body[data-theme="light"] .example-expl {
  color: #334155 !important;
}

body[data-theme="light"] .challenge-card {
  background: #fffbeb;
  border: 1px solid rgba(217, 119, 6, 0.28);
}
body[data-theme="light"] .challenge-badge {
  color: #b45309 !important;
}
body[data-theme="light"] .challenge-prompt-text {
  color: #0f172a !important;
}
body[data-theme="light"] .challenge-expected-box {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #475569 !important;
}
body[data-theme="light"] .challenge-expected-box code {
  color: #059669 !important;
}

body[data-theme="light"] #subtopic-counter-indicator {
  color: #64748b;
}

body[data-theme="light"] .subrail-section {
  border-top-color: rgba(0, 0, 0, 0.06);
}
body[data-theme="light"] .subrail-heading {
  color: #0f172a !important;
}
body[data-theme="light"] .subrail-link {
  color: #475569 !important;
}
body[data-theme="light"] .subrail-link:hover,
body[data-theme="light"] .subrail-link.active {
  color: #0284c7 !important;
}
body[data-theme="light"] .subrail-bullets-list li {
  color: #475569 !important;
}
body[data-theme="light"] .related-link {
  background: #f1f5f9;
  color: #0284c7 !important;
  border-color: rgba(0, 0, 0, 0.06);
}
body[data-theme="light"] .related-link:hover {
  background: #e2e8f0;
}

/* 7. Light Mode: Code Editor Panel Chrome & Memory Tracker */
body[data-theme="light"] .e-tab {
  color: #64748b !important;
}
body[data-theme="light"] .e-tab:hover {
  color: #0f172a !important;
  background: rgba(0, 0, 0, 0.04);
}
body[data-theme="light"] .e-tab.active {
  background: #e2e8f0;
  color: #0f172a !important;
}
body[data-theme="light"] .e-expand-btn {
  color: #64748b !important;
}
body[data-theme="light"] .e-expand-btn:hover {
  color: #0f172a !important;
}

body[data-theme="light"] .engine-pill {
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .engine-dropdown {
  color: #0284c7 !important;
}
body[data-theme="light"] .btn-editor-reset {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.08);
  color: #475569 !important;
}
body[data-theme="light"] .btn-editor-reset:hover {
  background: #e2e8f0;
  color: #0f172a !important;
}

body[data-theme="light"] .try-yourself-card {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .try-title {
  color: #0f172a !important;
}
body[data-theme="light"] .try-prompt-p {
  color: #334155 !important;
}
body[data-theme="light"] .try-hint-btn,
body[data-theme="light"] .try-sol-btn {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.08);
  color: #475569 !important;
}
body[data-theme="light"] .try-hint-btn:hover,
body[data-theme="light"] .try-sol-btn:hover {
  background: #e2e8f0;
  color: #0f172a !important;
}

body[data-theme="light"] .var-box-3d {
  background: #ffffff;
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
}
body[data-theme="light"] .var-val {
  color: #0f172a !important;
}

/* 8. Light Mode: Modals, AI Tutor & Extended Tabs */
body[data-theme="light"] .modal-card-3d {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
body[data-theme="light"] .modal-card-3d h2,
body[data-theme="light"] .modal-card-3d h3,
body[data-theme="light"] .modal-card-3d h4 {
  color: #0f172a !important;
}
body[data-theme="light"] .modal-card-3d p,
body[data-theme="light"] .modal-card-3d span,
body[data-theme="light"] .modal-card-3d li {
  color: #475569;
}
body[data-theme="light"] .modal-card-3d input,
body[data-theme="light"] .modal-card-3d select,
body[data-theme="light"] .modal-card-3d textarea {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #0f172a;
}
body[data-theme="light"] .modal-close-btn {
  color: #64748b !important;
}

body[data-theme="light"] .ai-tutor-drawer {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(2, 132, 199, 0.35);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
body[data-theme="light"] .ai-drawer-header {
  background: #f1f5f9;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .ai-drawer-header div {
  color: #0f172a !important;
}
body[data-theme="light"] .ai-chip {
  background: #f1f5f9;
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.25);
}
body[data-theme="light"] .ai-msg-bot .ai-msg-body {
  background: #f1f5f9;
  color: #0f172a !important;
  border-color: rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .ai-chat-input-row {
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .ai-chat-input {
  background: #f8fafc;
  color: #0f172a !important;
  border-color: rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .handbook-header-card,
body[data-theme="light"] .slide-visual-card,
body[data-theme="light"] .slide-notes-card,
body[data-theme="light"] .mock-exam-header,
body[data-theme="light"] .exam-section-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .handbook-header-card h2,
body[data-theme="light"] .slide-visual-card h2,
body[data-theme="light"] .mock-exam-header h2 {
  color: #0f172a !important;
}
body[data-theme="light"] #slide-concept {
  color: #334155 !important;
}

body[data-theme="light"] .mcq-option-btn {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1e293b;
}
body[data-theme="light"] .mcq-option-btn:hover {
  background: #f1f5f9;
  border-color: rgba(2, 132, 199, 0.4);
}
body[data-theme="light"] .mcq-option-btn.selected {
  background: #dbeafe;
  border-color: #0284c7;
  color: #1e40af;
}

/* Auth modal tabs in light mode */
body[data-theme="light"] .auth-tabs-row {
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .auth-tab-btn {
  color: #64748b;
}
body[data-theme="light"] .auth-tab-btn.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Mobile top controls in light mode */
body[data-theme="light"] .mobile-sidebar-toggle-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
body[data-theme="light"] .mobile-sidebar-toggle-btn svg {
  stroke: #0f172a;
}
body[data-theme="light"] .mobile-prefs-toggle-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
body[data-theme="light"] .mobile-prefs-collapse {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .mobile-prefs-label {
  color: #475569;
}

/* 9. Light Mode: Bottom Showcase Cards (Projects & Mock Exams) */
body[data-theme="light"] .showcase-card {
  background: #ffffff !important;
  background-image: none !important;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
body[data-theme="light"] .sc-title {
  color: #0f172a;
}
body[data-theme="light"] .sc-subtitle {
  color: #64748b;
}
body[data-theme="light"] .sc-tab {
  background: #f1f5f9;
  color: #64748b;
}
body[data-theme="light"] .sc-tab.active {
  background: #0284c7;
  color: #ffffff;
}
body[data-theme="light"] .sc-item-box {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.08);
}
body[data-theme="light"] .sc-item-box:hover {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
}
body[data-theme="light"] .sc-item-title {
  color: #0f172a;
}
body[data-theme="light"] .sc-item-meta {
  color: #64748b;
}
body[data-theme="light"] .sc-item-box .btn-start-test,
body[data-theme="light"] .sc-item-box .btn-open-proj {
  background: #f1f5f9;
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .sc-exam-card {
  background: #f8fafc !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}
body[data-theme="light"] .sc-exam-card:hover {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1) !important;
}
body[data-theme="light"] .exam-card-title {
  color: #0f172a !important;
}
body[data-theme="light"] .exam-card-sub,
body[data-theme="light"] .exam-card-meta {
  color: #64748b !important;
}
body[data-theme="light"] .btn-start-exam {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}
body[data-theme="light"] .btn-start-exam:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
}

body[data-theme="light"] .app-footer {
  background: #ffffff !important;
  border-top-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.02) !important;
}
body[data-theme="light"] .app-footer span,
body[data-theme="light"] .app-footer a,
body[data-theme="light"] .app-footer p {
  color: #475569 !important;
}
body[data-theme="light"] .app-footer div > div > span:first-child {
  color: #0f172a !important;
}

/* ===========================================================================
   10. RESPONSIVE DESIGN SPECIFICATION (Desktop, Laptop, Tablet, Mobile)
   =========================================================================== */

/* --- A. LARGE DESKTOP (>= 1400px) --- */
@media (min-width: 1025px) {
  .tree-panel {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .editor-panel {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
}

@media (min-width: 769px) {
  #mobile-prefs-collapse,
  .mobile-prefs-collapse {
    display: none !important;
  }
  #btn-mobile-prefs-toggle,
  .mobile-prefs-toggle-btn {
    display: none !important;
  }
}

@media (min-width: 1400px) {
  .integrated-workspace-grid {
    grid-template-columns: 240px minmax(0, 1.25fr) minmax(360px, 420px);
    gap: 16px;
  }
}

/* --- B. LAPTOP & MEDIUM DESKTOP (1025px - 1399px) --- */
@media (min-width: 1025px) and (max-width: 1399px) {
  .app-sidebar {
    width: 200px;
    min-width: 200px;
  }
  .app-main-viewport {
    padding: 14px 18px 40px 18px;
  }
  .integrated-workspace-grid {
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr) minmax(310px, 360px);
    gap: 12px;
  }
  .integrated-workspace-grid.tree-collapsed {
    grid-template-columns: 48px minmax(0, 1fr) minmax(310px, 360px);
  }
  .lesson-panel {
    padding: 16px 18px;
  }
  .editor-panel {
    padding: 12px;
  }
}

/* --- C. TABLET (769px - 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Reduce sidebar width to compact icon rail */
  .app-sidebar {
    width: 68px;
    min-width: 68px;
  }
  .app-sidebar .brand-text-block,
  .app-sidebar .side-nav-label,
  .app-sidebar .side-nav-chevron,
  .app-sidebar .side-user-meta {
    display: none;
  }
  .app-sidebar .side-nav-btn {
    justify-content: center;
    padding: 10px;
  }
  .app-sidebar .sidebar-header,
  .app-sidebar .sidebar-footer {
    display: flex;
    justify-content: center;
    padding: 14px 6px;
  }
  .app-main-viewport {
    padding: 12px 14px 36px 14px;
  }
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bottom-showcase-row {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Three-panel adaptive layout on tablet */
  .integrated-workspace-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr);
    gap: 12px;
  }
  .tree-panel {
    grid-column: span 2;
    max-height: 220px;
  }
  .lesson-panel {
    grid-column: span 1;
    min-width: 0;
    padding: 16px;
  }
  .editor-panel {
    grid-column: span 1;
    min-width: 0;
    padding: 12px;
  }
}

/* --- D. MOBILE (< 768px, down to 390px) --- */
@media (max-width: 768px) {
  /* Off-canvas collapsible navigation drawer */
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    min-width: 250px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.7);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-sidebar-toggle-btn {
    display: inline-flex !important;
  }
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative;
  }
  .app-container {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .app-main-viewport {
    padding: 10px 10px calc(72px + env(safe-area-inset-bottom, 16px)) 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  .desktop-only-controls {
    display: none !important;
  }
  .mobile-prefs-toggle-btn {
    display: inline-flex !important;
  }
  .viewport-top-header {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 6px !important;
  }
  .viewport-top-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    order: 1 !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .hero-back-tag {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.4px !important;
    max-width: 160px !important;
  }
  .viewport-top-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    order: 2 !important;
    flex-shrink: 0 !important;
  }
  .mobile-prefs-collapse {
    order: 3 !important;
    width: 100% !important;
  }
  .hero-search-box {
    order: 4 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-top: 4px !important;
    box-sizing: border-box !important;
    display: flex !important;
  }
  .hero-search-box input {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 0.82rem !important;
  }
  .ai-tutor-fab {
    position: fixed !important;
    bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
    right: max(16px, env(safe-area-inset-right, 16px)) !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 12px rgba(56, 189, 248, 0.35) !important;
    z-index: 1000 !important;
  }
  .ai-tutor-fab .ai-fab-label {
    display: none !important;
  }
  .ai-tutor-fab .ai-fab-icon {
    font-size: 1.35rem !important;
    margin: 0 !important;
    line-height: 1 !important;
  }
  .aurora-container {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    contain: strict !important;
    clip-path: inset(0 0 0 0) !important;
  }
  .aurora-orb {
    max-width: 100% !important;
  }
  .editor-panel, .lesson-panel, .workspace-panel, .integrated-workspace-grid {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .CodeMirror {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }
  .bottom-showcase-row {
    grid-template-columns: 1fr;
    width: 100% !important;
    max-width: 100% !important;
  }
  /* Hide ⌘K shortcut on mobile (touchscreen, no Cmd key) */
  .kbd-shortcut {
    display: none !important;
  }
  /* Hide hero back tag on mobile to save header space */
  .hero-back-tag {
    display: none !important;
  }
  .showcase-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .sc-header {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: flex-start !important;
  }
  .sc-tabs {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
  .hero-character-quote-tag {
    display: none;
  }
  .keep-going-panel {
    position: static;
    width: 100%;
    margin-top: 14px;
  }
  /* Stack lesson and coding workspace vertically */
  .integrated-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    width: 100%;
    min-height: auto;
  }
  .tree-panel {
    grid-column: span 1;
    max-height: 240px;
    width: 100%;
  }
  .lesson-panel {
    grid-column: span 1;
    max-height: none;
    width: 100%;
    padding: 14px 12px;
  }
  .editor-panel {
    grid-column: span 1;
    max-height: none;
    width: 100%;
    padding: 12px;
  }
  .lesson-content-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  .lesson-subrail-col {
    grid-template-columns: 1fr;
  }
  /* Course Studio Focus Mode overrides on mobile */
  .course-focus-mode .integrated-workspace-grid {
    height: auto !important;
    min-height: auto !important;
  }
  .course-focus-mode .workspace-panel {
    height: auto !important;
    max-height: none !important;
  }
  .course-focus-mode .lesson-panel {
    max-height: none !important;
    overflow-y: visible !important;
  }
  .course-focus-header {
    flex-wrap: wrap;
    gap: 8px;
  }
}
