/* ============================================================
   LEARN.CSS — Class 9 Interactive Learning Platform
   Premium dark/light theme with glassmorphism & animations
   ============================================================ */

/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties (Dark Theme Default) ── */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-hover: rgba(255, 255, 255, 0.1);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;
  
  --accent-primary: #6c5ce7;
  --accent-secondary: #00cec9;
  --accent-tertiary: #fd79a8;
  --accent-warning: #fdcb6e;
  --accent-success: #00b894;
  --accent-danger: #ff6b6b;
  
  --gradient-primary: linear-gradient(135deg, #6c5ce7, #a29bfe);
  --gradient-secondary: linear-gradient(135deg, #00cec9, #55efc4);
  --gradient-hero: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
  
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);
  
  --sidebar-width: 260px;
  --navbar-height: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg-primary: #f5f5fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eeeef5;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-hover: rgba(255, 255, 255, 0.85);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-glass-hover: rgba(0, 0, 0, 0.12);
  
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5f;
  --text-muted: #8888a0;
  
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.08);
  
  --gradient-hero: linear-gradient(135deg, #f5f5fa 0%, #e8e8f0 50%, #ddd8f0 100%);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition-smooth), color var(--transition-smooth);
  -webkit-font-smoothing: antialiased;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-secondary); }

/* ── Loading Screen ── */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-glass);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  margin-top: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

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

/* ── Navbar ── */
.learn-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
  transition: background var(--transition-smooth);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
}

.nav-brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.nav-brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xs);
  background: var(--bg-glass);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.nav-back-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.nav-back-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.nav-back-btn.visible { display: flex; }

.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xs);
  background: var(--bg-glass);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
}

/* ── Page Sections (SPA Routing) ── */
.page-section {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ── LANDING PAGE ── */
.landing-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  overflow: hidden;
}

#hero-three-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-secondary);
  background: rgba(0, 206, 201, 0.1);
  border: 1px solid rgba(0, 206, 201, 0.2);
  border-radius: 50px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 50%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 2.5rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-spring);
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
  text-decoration: none;
}

.hero-cta:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 35px rgba(108, 92, 231, 0.5);
}

.hero-cta svg { width: 20px; height: 20px; }

/* Feature Cards */
.features-section {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.features-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.features-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--transition-smooth);
  cursor: default;
}

.feature-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
}

.feature-icon.purple { background: rgba(108, 92, 231, 0.15); }
.feature-icon.teal { background: rgba(0, 206, 201, 0.15); }
.feature-icon.pink { background: rgba(253, 121, 168, 0.15); }

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── DASHBOARD ── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--navbar-height);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-glass);
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  bottom: 0;
  padding: 1.5rem 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition-smooth);
}

.sidebar-section {
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sidebar-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: rgba(108, 92, 231, 0.12);
  color: var(--accent-primary);
  font-weight: 600;
}

.sidebar-item-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 0.75rem 1rem;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem;
  min-height: calc(100vh - var(--navbar-height));
}

.content-header {
  margin-bottom: 2rem;
}

.content-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.content-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Chapter Cards Grid */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.chapter-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.chapter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-smooth);
}

.chapter-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.chapter-card:hover::before { transform: scaleX(1); }

.chapter-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.chapter-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.chapter-card p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.chapter-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-interactive {
  background: rgba(0, 206, 201, 0.1);
  color: var(--accent-secondary);
  border: 1px solid rgba(0, 206, 201, 0.2);
}

.tag-3d {
  background: rgba(108, 92, 231, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(108, 92, 231, 0.2);
}

.tag-quiz {
  background: rgba(253, 121, 168, 0.1);
  color: var(--accent-tertiary);
  border: 1px solid rgba(253, 121, 168, 0.2);
}

/* Progress Bar on cards */
.chapter-progress {
  margin-top: 0.75rem;
  height: 4px;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
}

.chapter-progress-fill {
  height: 100%;
  background: var(--gradient-secondary);
  border-radius: 10px;
  transition: width 0.6s ease;
}

/* ── MODULE / EXPERIMENT PAGE ── */
.module-layout {
  padding-top: var(--navbar-height);
  min-height: 100vh;
}

.module-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.module-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.module-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.module-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.module-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.module-breadcrumb a {
  color: var(--accent-primary);
  text-decoration: none;
}

.module-breadcrumb a:hover { text-decoration: underline; }

/* Experiment Container */
.experiment-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.experiment-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.experiment-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.experiment-canvas-wrapper {
  position: relative;
  width: 100%;
  min-height: 350px;
  background: rgba(0, 0, 0, 0.15);
}

.experiment-canvas-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.experiment-controls {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-glass);
}

.exp-btn {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.exp-btn:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-primary);
}

.exp-btn.primary {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
}

.exp-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.exp-btn.success {
  background: rgba(0, 184, 148, 0.15);
  border-color: rgba(0, 184, 148, 0.3);
  color: var(--accent-success);
}

/* Slider Controls */
.control-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.control-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 90px;
}

.control-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border-glass);
  border-radius: 10px;
  outline: none;
}

.control-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(108, 92, 231, 0.4);
}

.control-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-secondary);
  min-width: 50px;
  text-align: right;
}

/* Info / Explanation Panels */
.info-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.info-panel h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-panel p, .info-panel li {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
}

.info-panel ul {
  padding-left: 1.2rem;
}

.info-panel li { margin-bottom: 0.4rem; }

.formula-box {
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid rgba(108, 92, 231, 0.15);
  border-radius: var(--radius-xs);
  padding: 0.75rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-align: center;
  margin: 0.75rem 0;
  letter-spacing: 1px;
}

/* Step-by-step Explanation */
.steps-list {
  counter-reset: step;
}

.step-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-glass);
}

.step-item:last-child { border-bottom: none; }

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* Real-life Example */
.real-life-box {
  background: rgba(0, 206, 201, 0.06);
  border: 1px solid rgba(0, 206, 201, 0.15);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.real-life-box h4 {
  color: var(--accent-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.real-life-box p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ── RESULTS / STATS DISPLAY ── */
.results-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.result-stat {
  text-align: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.result-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.result-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
}

/* ── QUIZ SECTION ── */
.quiz-container {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.quiz-question {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-option {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  text-align: left;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.quiz-option:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.quiz-option.correct {
  background: rgba(0, 184, 148, 0.12);
  border-color: var(--accent-success);
  color: var(--accent-success);
}

.quiz-option.wrong {
  background: rgba(255, 107, 107, 0.12);
  border-color: var(--accent-danger);
  color: var(--accent-danger);
}

.quiz-option-letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.quiz-score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-glass);
}

.quiz-score-bar span {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.quiz-score-bar strong {
  color: var(--accent-success);
}

.quiz-next-btn {
  margin-top: 1rem;
  padding: 0.6rem 1.5rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.quiz-explanation {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 184, 148, 0.06);
  border: 1px solid rgba(0, 184, 148, 0.15);
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: none;
}

.quiz-explanation.visible { display: block; }

/* ── PROGRESS TRACKER ── */
.progress-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.progress-stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.progress-stat-card h4 {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.progress-stat-card .big-number {
  font-size: 2.5rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-stat-card .progress-ring {
  width: 80px;
  height: 80px;
  margin: 0 auto 0.5rem;
}

/* Two-column layout for module content */
.module-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.module-full-width {
  grid-column: 1 / -1;
}

/* Three.js Container */
.three-container {
  width: 100%;
  min-height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
}

.three-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.three-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 0.3rem 0.8rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
}

/* ── COIN TOSS SPECIAL ── */
.coin {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 1rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #5a3e00;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3), inset 0 -2px 5px rgba(0,0,0,0.15);
  transition: transform 0.1s;
  user-select: none;
}

.coin.flipping {
  animation: coinFlip 0.6s ease-out;
}

@keyframes coinFlip {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(900deg) scale(1.2); }
  100% { transform: rotateY(1800deg) scale(1); }
}

.coin-result-bar {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 1rem;
}

.coin-result-item {
  text-align: center;
}

.coin-result-item .count {
  font-size: 2rem;
  font-weight: 800;
}

.coin-result-item .label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── TISSUE DIAGRAM ── */
.tissue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.tissue-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tissue-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.tissue-item.active {
  border-color: var(--accent-primary);
  background: rgba(108, 92, 231, 0.08);
}

.tissue-item-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.tissue-item h4 { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.3rem; }
.tissue-item p { font-size: 0.75rem; color: var(--text-muted); }

.tissue-detail {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  display: none;
}

.tissue-detail.visible { display: block; }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

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

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content {
    margin-left: 0;
    padding: 1.25rem;
  }

  .mobile-menu-toggle { display: flex; }

  .module-two-col {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .chapters-grid {
    grid-template-columns: 1fr;
  }

  .hero-title { font-size: 2.2rem; }

  .experiment-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .results-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .coin-result-bar { gap: 1rem; }

  .content-header h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .learn-navbar { padding: 0 1rem; }
  .nav-brand-text { display: none; }
  .hero-cta { padding: 0.8rem 1.8rem; font-size: 0.95rem; }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.visible { display: block; }

/* ── Utility ── */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }

.hidden { display: none !important; }
