/* ============================================================
   QCC NOTES — Enterprise Design System v1.0
   Class 11 PCM Free Theory & Micro-Paid Revision Notes Portal
   ============================================================ */

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

/* ── CSS Design Tokens ── */
:root {
  /* Brand Palette */
  --brand-primary:       #6C63FF;
  --brand-primary-light: #8B85FF;
  --brand-primary-dark:  #4A42CC;
  --brand-secondary:     #FF6584;
  --brand-accent:        #FFD700;
  --brand-gold:          #F5A623;

  /* Subject Colors */
  --physics-color:   #3B82F6;
  --physics-glow:    rgba(59,130,246,0.25);
  --chemistry-color: #10B981;
  --chemistry-glow:  rgba(16,185,129,0.25);
  --maths-color:     #F59E0B;
  --maths-glow:      rgba(245,158,11,0.25);

  /* Dark Mode (Default) */
  --bg-base:         #0A0B14;
  --bg-surface:      #111220;
  --bg-card:         #161828;
  --bg-card-hover:   #1E2038;
  --bg-glass:        rgba(22,24,40,0.8);
  --bg-overlay:      rgba(0,0,0,0.6);

  /* Text */
  --text-primary:    #F0F0FF;
  --text-secondary:  #A0A3C0;
  --text-muted:      #6B6F8F;
  --text-inverse:    #0A0B14;

  /* Borders & Dividers */
  --border-subtle:   rgba(255,255,255,0.06);
  --border-medium:   rgba(255,255,255,0.12);
  --border-strong:   rgba(255,255,255,0.2);

  /* Gradients */
  --gradient-hero:   linear-gradient(135deg, #0A0B14 0%, #111220 50%, #0D0F20 100%);
  --gradient-brand:  linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  --gradient-gold:   linear-gradient(135deg, #F5A623, #FFD700);
  --gradient-physics:   linear-gradient(135deg, #1e3a5f, #3B82F6);
  --gradient-chemistry: linear-gradient(135deg, #064e3b, #10B981);
  --gradient-maths:     linear-gradient(135deg, #451a03, #F59E0B);

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow-brand: 0 0 40px rgba(108,99,255,0.3);
  --shadow-glow-gold:  0 0 30px rgba(245,166,35,0.4);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   all 0.15s ease;
  --transition-base:   all 0.25s ease;
  --transition-slow:   all 0.4s cubic-bezier(0.4,0,0.2,1);

  /* Typography */
  --font-en: 'Inter', sans-serif;
  --font-hi: 'Noto Sans Devanagari', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Mode */
[data-theme="light"] {
  --bg-base:       #F5F5FF;
  --bg-surface:    #FFFFFF;
  --bg-card:       #FFFFFF;
  --bg-card-hover: #F0F0FF;
  --bg-glass:      rgba(255,255,255,0.85);
  --text-primary:  #0A0B14;
  --text-secondary:#3C3F5C;
  --text-muted:    #7B7E9E;
  --border-subtle: rgba(0,0,0,0.06);
  --border-medium: rgba(0,0,0,0.12);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.15);
  --gradient-hero: linear-gradient(135deg, #EEF0FF 0%, #F5F5FF 100%);
}

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

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

body {
  font-family: var(--font-en);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

body.lang-hi { font-family: var(--font-hi); }

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--brand-primary); border-radius: 3px; }

/* ── Selection ── */
::selection { background: rgba(108,99,255,0.3); color: var(--text-primary); }

/* ── Skip Link ── */
.skip-link {
  position: absolute; left: -9999px;
  padding: 0.5rem 1rem; background: var(--brand-primary);
  color: #fff; z-index: 9999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ═══════════════════════════════════
   LAYOUT
═══════════════════════════════════ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section { padding: var(--space-3xl) 0; }

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

/* ═══════════════════════════════════
   NAVIGATION
═══════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-base);
}

.navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  display: flex; align-items: center; gap: var(--space-sm);
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.5px;
}

.nav-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient-brand);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow-brand);
}

.nav-logo .logo-text { color: var(--text-primary); }
.nav-logo .logo-text span { color: var(--brand-primary); }

.nav-links {
  display: flex; align-items: center; gap: var(--space-xl);
}

.nav-links a {
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--brand-primary);
  border-radius: 2px; transition: var(--transition-base);
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.nav-actions {
  display: flex; align-items: center; gap: var(--space-sm);
}

/* Language Toggle */
.lang-toggle {
  display: flex; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); transition: var(--transition-fast);
}

.lang-btn.active {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,99,255,0.4);
}

/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: var(--transition-base);
  color: var(--text-secondary);
}

.theme-toggle:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: rotate(20deg);
}

/* Hamburger */
.hamburger {
  display: none; flex-direction: column;
  gap: 5px; padding: 4px;
  width: 36px; height: 36px;
  justify-content: center; align-items: center;
}

.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-primary); border-radius: 2px;
  transition: var(--transition-base);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed; top: 64px; left: 0; right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-lg);
  flex-direction: column; gap: var(--space-md);
  z-index: 999;
}

.mobile-nav.open { display: flex; }
.mobile-nav a { font-size: 1rem; font-weight: 500; padding: var(--space-sm) 0; }

/* ═══════════════════════════════════
   HERO
═══════════════════════════════════ */
.hero {
  position: relative;
  background: var(--gradient-hero);
  overflow: hidden;
  padding: 100px 0 80px;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 40%, rgba(108,99,255,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80% 60%, rgba(255,101,132,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 0.8rem; font-weight: 600; color: var(--brand-primary-light);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.5px; text-transform: uppercase;
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--brand-primary);
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900; line-height: 1.15;
  letter-spacing: -1px; margin-bottom: var(--space-lg);
}

.hero-title .gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem; color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex; gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-stats {
  display: flex; gap: var(--space-xl);
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.hero-stat .stat-value {
  font-size: 1.8rem; font-weight: 800;
  background: var(--gradient-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stat .stat-label {
  font-size: 0.8rem; color: var(--text-muted); margin-top: 2px;
}

/* Hero Visual */
.hero-visual {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

.hero-card-stack {
  position: relative; width: 100%; max-width: 380px;
}

.floating-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
}

.floating-card.main {
  position: relative; z-index: 2;
  animation: float 4s ease-in-out infinite;
}

.floating-card.secondary {
  position: absolute; bottom: -30px; right: -20px;
  z-index: 1; padding: var(--space-md);
  transform: rotate(3deg);
  animation: float 4s ease-in-out infinite 1s;
  width: 75%;
}

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

.floating-card.secondary { animation: float-alt 4s ease-in-out infinite 1s; }

@keyframes float-alt {
  0%, 100% { transform: translateY(0) rotate(3deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

/* ═══════════════════════════════════
   BUTTONS
═══════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 600;
  transition: var(--transition-base);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108,99,255,0.5);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(108,99,255,0.08);
}

.btn-gold {
  background: var(--gradient-gold);
  color: #1a0a00; font-weight: 700;
  box-shadow: var(--shadow-glow-gold);
}

.btn-gold:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 40px rgba(245,166,35,0.5);
}

.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ═══════════════════════════════════
   CARDS
═══════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: var(--transition-slow);
}

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

/* Subject Cards */
.subject-card {
  position: relative; overflow: hidden;
  cursor: pointer;
}

.subject-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  transition: var(--transition-base);
}

.subject-card.physics::before { background: var(--physics-color); }
.subject-card.chemistry::before { background: var(--chemistry-color); }
.subject-card.maths::before { background: var(--maths-color); }

.subject-card:hover.physics { box-shadow: 0 8px 40px var(--physics-glow); border-color: rgba(59,130,246,0.3); }
.subject-card:hover.chemistry { box-shadow: 0 8px 40px var(--chemistry-glow); border-color: rgba(16,185,129,0.3); }
.subject-card:hover.maths { box-shadow: 0 8px 40px var(--maths-glow); border-color: rgba(245,158,11,0.3); }

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

.physics .subject-icon { background: rgba(59,130,246,0.15); }
.chemistry .subject-icon { background: rgba(16,185,129,0.15); }
.maths .subject-icon { background: rgba(245,158,11,0.15); }

.subject-title {
  font-size: 1.2rem; font-weight: 700; margin-bottom: var(--space-sm);
}

.subject-meta {
  font-size: 0.85rem; color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.subject-chapters {
  display: flex; flex-direction: column; gap: 6px;
}

.chapter-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}

.chapter-link:hover { color: var(--text-primary); padding-left: 4px; }
.chapter-link .ch-num { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.75rem; }
.chapter-link .free-badge {
  margin-left: auto;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  background: rgba(16,185,129,0.15);
  color: #10B981; padding: 2px 6px; border-radius: 4px;
}

/* Feature Cards */
.feature-card {
  text-align: center;
}

.feature-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-lg);
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto var(--space-lg);
  transition: var(--transition-base);
}

.feature-card:hover .feature-icon {
  background: rgba(108,99,255,0.2);
  transform: scale(1.1) rotate(5deg);
}

.feature-title { font-size: 1rem; font-weight: 700; margin-bottom: var(--space-sm); }
.feature-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }

/* ═══════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════ */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--brand-primary);
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.2);
  padding: 4px 14px; border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800; line-height: 1.2;
  letter-spacing: -0.5px; margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: 1rem; color: var(--text-secondary);
  max-width: 580px; margin: 0 auto;
  line-height: 1.7;
}

/* ═══════════════════════════════════
   CHAPTER PAGE LAYOUT
═══════════════════════════════════ */
.chapter-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-2xl);
  align-items: start;
  padding: var(--space-2xl) 0 var(--space-3xl);
}

/* Sidebar */
.chapter-sidebar {
  position: sticky; top: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.sidebar-title {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.toc-link {
  display: block; padding: 6px var(--space-sm);
  font-size: 0.85rem; color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  border-left: 2px solid transparent;
}

.toc-link:hover, .toc-link.active {
  color: var(--brand-primary);
  background: rgba(108,99,255,0.08);
  border-left-color: var(--brand-primary);
  padding-left: var(--space-md);
}

.progress-bar-wrap {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar {
  height: 6px; background: var(--bg-surface);
  border-radius: 3px; overflow: hidden;
}

.progress-fill {
  height: 100%; background: var(--gradient-brand);
  border-radius: 3px; transition: width 0.5s ease;
}

/* Chapter Content */
.chapter-content {
  min-width: 0;
}

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.breadcrumb a { color: var(--brand-primary); }
.breadcrumb .sep { color: var(--text-muted); }

.chapter-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}

.chapter-subject-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.chapter-subject-tag.physics { background: rgba(59,130,246,0.15); color: var(--physics-color); }
.chapter-subject-tag.chemistry { background: rgba(16,185,129,0.15); color: var(--chemistry-color); }
.chapter-subject-tag.maths { background: rgba(245,158,11,0.15); color: var(--maths-color); }

.chapter-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800; line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: var(--space-md);
}

.chapter-meta {
  display: flex; align-items: center; gap: var(--space-lg);
  flex-wrap: wrap;
}

.chapter-meta-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-muted);
}

/* Article Typography */
.article-body h2 {
  font-size: 1.4rem; font-weight: 700;
  margin: var(--space-2xl) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: 80px;
}

.article-body h3 {
  font-size: 1.1rem; font-weight: 600;
  margin: var(--space-xl) 0 var(--space-sm);
  color: var(--brand-primary-light);
  scroll-margin-top: 80px;
}

.article-body p {
  font-size: 1rem; line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.article-body ul, .article-body ol {
  margin: var(--space-md) 0 var(--space-md) var(--space-xl);
  color: var(--text-secondary);
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }

.article-body li {
  margin-bottom: 6px; line-height: 1.7;
}

.article-body strong { color: var(--text-primary); }

.article-body .formula-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--brand-primary-light);
  overflow-x: auto;
}

.article-body .example-box {
  background: rgba(108,99,255,0.06);
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.article-body .example-box .ex-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--brand-primary);
  margin-bottom: var(--space-sm);
}

.article-body .info-box {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.article-body .info-box .ib-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #10B981;
  margin-bottom: var(--space-sm);
}

.article-body .warn-box {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.article-body table {
  width: 100%; border-collapse: collapse;
  margin: var(--space-lg) 0; font-size: 0.9rem;
}

.article-body th {
  background: rgba(108,99,255,0.12);
  padding: 10px 14px; text-align: left;
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-primary);
  border-bottom: 2px solid var(--border-medium);
}

.article-body td {
  padding: 10px 14px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.article-body tr:hover td { background: var(--bg-card-hover); }

/* ═══════════════════════════════════
   CTA CARD (Sticky Purchase)
═══════════════════════════════════ */
.cta-card {
  background: linear-gradient(135deg, rgba(245,166,35,0.12), rgba(108,99,255,0.12));
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-top: var(--space-2xl);
  position: relative; overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute; top: -50%; right: -30%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(245,166,35,0.1), transparent 70%);
  pointer-events: none;
}

.cta-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; background: rgba(245,166,35,0.2);
  color: var(--brand-gold); padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.cta-title {
  font-size: 1.2rem; font-weight: 800;
  margin-bottom: var(--space-sm);
}

.cta-perks {
  margin: var(--space-md) 0; display: flex;
  flex-direction: column; gap: 8px;
}

.cta-perk {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.88rem; color: var(--text-secondary);
}

.cta-perk .check { color: #10B981; font-weight: 700; }

.cta-price-row {
  display: flex; align-items: baseline; gap: var(--space-sm);
  margin: var(--space-lg) 0;
}

.cta-price {
  font-size: 2rem; font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cta-price-note {
  font-size: 0.82rem; color: var(--text-muted);
}

.cta-old-price {
  font-size: 1rem; color: var(--text-muted);
  text-decoration: line-through;
}

/* ═══════════════════════════════════
   PAYMENT MODAL
═══════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: var(--transition-base);
}

.modal-overlay.open {
  opacity: 1; pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 480px; width: calc(100% - 2rem);
  transform: scale(0.95) translateY(20px);
  transition: var(--transition-base);
  position: relative;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute; top: var(--space-lg); right: var(--space-lg);
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1.2rem;
  transition: var(--transition-fast);
}

.modal-close:hover { background: var(--brand-secondary); color: #fff; }

.modal-title {
  font-size: 1.3rem; font-weight: 800;
  margin-bottom: var(--space-sm);
}

.modal-subtitle { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: var(--space-xl); }

.payment-options { display: flex; flex-direction: column; gap: var(--space-md); }

.payment-option {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition-base);
}

.payment-option:hover, .payment-option.selected {
  border-color: var(--brand-primary);
  background: rgba(108,99,255,0.08);
}

.po-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.po-name { font-weight: 600; font-size: 0.95rem; }
.po-desc { font-size: 0.8rem; color: var(--text-muted); }

/* ═══════════════════════════════════
   CHAPTER DIRECTORY
═══════════════════════════════════ */
.chapter-directory {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.dir-subject-section {
  margin-bottom: var(--space-2xl);
}

.dir-subject-header {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.dir-subject-header.physics { background: rgba(59,130,246,0.1); border-left: 4px solid var(--physics-color); }
.dir-subject-header.chemistry { background: rgba(16,185,129,0.1); border-left: 4px solid var(--chemistry-color); }
.dir-subject-header.maths { background: rgba(245,158,11,0.1); border-left: 4px solid var(--maths-color); }

.dir-chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.dir-chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: var(--transition-base);
  display: flex; flex-direction: column; gap: var(--space-sm);
}

.dir-chapter-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dir-ch-num {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); font-family: var(--font-mono);
}

.dir-ch-title { font-size: 0.95rem; font-weight: 600; }

.dir-ch-actions {
  display: flex; gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* ═══════════════════════════════════
   SEARCH
═══════════════════════════════════ */
.search-bar {
  position: relative; max-width: 600px; margin: 0 auto var(--space-2xl);
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 14px 24px 14px 52px;
  font-size: 0.95rem; color: var(--text-primary);
  font-family: inherit;
  outline: none; transition: var(--transition-base);
}

.search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.search-icon {
  position: absolute; left: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 1.1rem;
  pointer-events: none;
}

/* ═══════════════════════════════════
   FOOTER
═══════════════════════════════════ */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand .nav-logo { margin-bottom: var(--space-md); }

.footer-desc {
  font-size: 0.88rem; color: var(--text-muted);
  line-height: 1.7; margin-bottom: var(--space-lg);
}

.footer-col-title {
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-links a {
  font-size: 0.88rem; color: var(--text-muted);
  transition: var(--transition-fast);
}

.footer-links a:hover { color: var(--brand-primary); padding-left: 4px; }

.footer-bottom {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem; color: var(--text-muted);
  flex-wrap: wrap; gap: var(--space-md);
}

/* ═══════════════════════════════════
   TAGS & BADGES
═══════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-free { background: rgba(16,185,129,0.15); color: #10B981; }
.badge-paid { background: rgba(245,166,35,0.15); color: var(--brand-gold); }
.badge-new  { background: rgba(108,99,255,0.15); color: var(--brand-primary-light); }

/* ═══════════════════════════════════
   UTILITY CLASSES
═══════════════════════════════════ */
.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.divider {
  border: none; border-top: 1px solid var(--border-subtle);
  margin: var(--space-2xl) 0;
}

.spacer-sm { height: var(--space-md); }
.spacer-md { height: var(--space-xl); }
.spacer-lg { height: var(--space-2xl); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ═══════════════════════════════════
   ANIMATIONS
═══════════════════════════════════ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

.animate-fade-up { animation: fade-up 0.6s ease both; }
.animate-fade-up-delay-1 { animation: fade-up 0.6s ease 0.1s both; }
.animate-fade-up-delay-2 { animation: fade-up 0.6s ease 0.2s both; }
.animate-fade-up-delay-3 { animation: fade-up 0.6s ease 0.3s both; }

/* Scroll Reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { gap: var(--space-2xl); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .chapter-layout { grid-template-columns: 1fr; }
  .chapter-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero-stats { flex-wrap: wrap; gap: var(--space-lg); }
  .container { padding: 0 var(--space-md); }
}

@media (max-width: 480px) {
  .hero { padding: 60px 0 50px; }
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .chapter-meta { flex-direction: column; gap: var(--space-sm); }
}

/* ── Print Styles ── */
@media print {
  .navbar, .footer, .cta-card, .modal-overlay, .chapter-sidebar { display: none !important; }
  .chapter-layout { grid-template-columns: 1fr; }
  body { background: white; color: black; }
}

/* ═══════════════════════════════════
   STEM ENHANCEMENT LAYER
═══════════════════════════════════ */

/* ── KaTeX Math Rendering ── */
.katex-display {
  overflow-x: auto;
  padding: var(--space-sm) 0;
  margin: var(--space-md) 0;
}

.katex { font-size: 1.05em; }

.eq-number {
  float: right;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* ── Prism.js Code Blocks ── */
.code-block-wrap {
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-medium);
  position: relative;
}

.code-block-wrap::before {
  content: attr(data-lang);
  position: absolute; top: 10px; right: 14px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  z-index: 1;
}

pre[class*="language-"] {
  margin: 0 !important;
  border-radius: 0 !important;
  font-size: 0.88rem !important;
  line-height: 1.6 !important;
  tab-size: 4;
  background: #1E1E2E !important;
  padding: var(--space-lg) !important;
}

[data-theme="light"] pre[class*="language-"] {
  background: #F8F8F2 !important;
}

code[class*="language-"] {
  font-family: var(--font-mono) !important;
}

/* Inline code */
.article-body code:not([class]) {
  background: rgba(108,99,255,0.12);
  color: var(--brand-primary-light);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

/* ── Plotly Chart Containers ── */
.qcc-chart {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0;
  min-height: 380px;
  transition: var(--transition-base);
}

.qcc-chart:hover {
  border-color: rgba(59,130,246,0.3);
  box-shadow: 0 8px 40px rgba(59,130,246,0.12);
}

/* ── PhET Simulation Containers ── */
.phet-sim {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0;
  min-height: 420px;
  transition: var(--transition-base);
}

.phet-sim:hover {
  border-color: rgba(16,185,129,0.3);
  box-shadow: 0 8px 40px rgba(16,185,129,0.1);
}

/* ── STEM Section Dividers ── */
.stem-section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: var(--space-2xl) 0 var(--space-lg);
  color: var(--text-muted);
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
}

.stem-section-divider::before,
.stem-section-divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border-subtle);
}

/* ── STEM Tags ── */
.stem-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 10px; border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
}

.stem-tag.interactive { background: rgba(108,99,255,0.15); color: var(--brand-primary-light); }
.stem-tag.simulation  { background: rgba(16,185,129,0.15);  color: #10B981; }
.stem-tag.chart       { background: rgba(59,130,246,0.15);   color: var(--physics-color); }
.stem-tag.code        { background: rgba(245,158,11,0.15);   color: var(--maths-color); }
.stem-tag.molecule    { background: rgba(16,185,129,0.15);   color: #10B981; }

/* ── Copy Formula Button ── */
.copy-formula-btn {
  position: absolute; top: 8px; right: 10px;
  background: rgba(108,99,255,0.2);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--brand-primary);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 0.72rem; cursor: pointer;
  font-family: var(--font-en);
  transition: var(--transition-fast);
}

.copy-formula-btn:hover {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

/* ── 3Dmol Molecular Viewer ── */
.mol-viewer {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0;
  height: 400px;
  position: relative;
}

.mol-viewer .mol-label {
  position: absolute; top: 10px; left: 14px;
  z-index: 10;
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

/* ── STEM Responsive ── */
@media (max-width: 768px) {
  .qcc-chart, .phet-sim { min-height: 320px; }
  pre[class*="language-"] { font-size: 0.78rem !important; padding: var(--space-md) !important; }
  .katex { font-size: 0.95em; }
}

