/* ============================================
   Class 10 Computer Science - Nepal
   Interactive Learning Website
   ============================================ */

/* ============================================
   Technology Channel — Brand Guidelines v1.0
   Black. White. Precise. Monochrome system.
   Display/Headings: Poppins · Body/UI: Inter
   ============================================ */
:root {
  /* Channel Black is the single brand "primary" */
  --primary: #000000;
  --primary-dark: #000000;
  --primary-light: #F5F5F5;   /* soft surface for hover/active states */
  --accent: #1A1A1A;          /* Ink — used where a second emphasis is needed */
  /* Functional quiz feedback only — the lone, deliberate exception to monochrome */
  --success: #1f7a4d;
  --danger: #b42318;
  /* Neutral ramp: #000 · #1A1A1A · #404040 · #808080 · #B3B3B3 · #E5E5E5 · #F5F5F5 · #FFF */
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-soft: #f5f5f5;
  --text: #1a1a1a;            /* Ink — body text */
  --text-soft: #404040;       /* Gray-700 */
  --text-muted: #808080;      /* Mid Gray — captions, metadata */
  --border: #e5e5e5;          /* Gray-200 — dividers, structure */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --radius: 6px;
  --radius-lg: 10px;
  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.2s ease;
}

/* Dark = inverted monochrome (white on Channel Black) — fully on-brand */
[data-theme="dark"] {
  --primary: #ffffff;
  --primary-dark: #ffffff;
  --primary-light: #1a1a1a;
  --accent: #e5e5e5;
  --success: #34d399;
  --danger: #f87171;
  --bg: #000000;
  --bg-card: #111111;
  --bg-soft: #1a1a1a;
  --text: #f5f5f5;
  --text-soft: #b3b3b3;
  --text-muted: #808080;
  --border: #2a2a2a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: var(--transition);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Poppins carries all display & headings; the wordmark stays geometric */
h1, h2, h3, h4, h5,
.logo-text h1, .hero h1, .section-title h2,
.chapter-header h1, .workshop-card h2, .coming-soon h1 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  background:
    url('assets/logo.png') center / 72% no-repeat,
    #000000;                 /* reversed lockup: white mark on Channel Black */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;            /* hide fallback text "CS" / "TC" */
  color: transparent;
  font-weight: 700;
  transition: var(--transition);
  flex-shrink: 0;
}

.logo:hover .logo-icon {
  transform: rotate(-4deg) scale(1.05);
}

[data-theme="dark"] .logo-icon {
  background:
    url('assets/logo.png') center / 72% no-repeat,
    #000000;
  border: 1px solid var(--border);
}

.logo-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.theme-toggle, .reset-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.theme-toggle:hover, .reset-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  background: #000000;
  color: #ffffff;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 260px;
  height: 260px;
  background: url('assets/logo.png') center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

@media (max-width: 768px) {
  .hero::after {
    width: 180px;
    height: 180px;
    bottom: -20px;
    right: -30px;
  }
}

.hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.stat {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.2);
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-section {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

.progress-percent {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.progress-bar {
  height: 12px;
  background: var(--bg-soft);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   CHAPTERS GRID
   ============================================ */
.section-title {
  max-width: 1280px;
  margin: 3rem auto 1.5rem;
  padding: 0 1.5rem;
}

.section-title h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.section-title p {
  color: var(--text-soft);
}

.chapters-grid {
  max-width: 1280px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.chapter-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.chapter-banner {
  height: 140px;
  background: var(--banner, #000000);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Tonal grayscale ramp keeps the cards distinct without breaking monochrome */
.chapter-card:nth-child(1) .chapter-banner { --banner: #000000; }
.chapter-card:nth-child(2) .chapter-banner { --banner: #1a1a1a; }
.chapter-card:nth-child(3) .chapter-banner { --banner: #404040; }
.chapter-card:nth-child(4) .chapter-banner { --banner: #1a1a1a; }
.chapter-card:nth-child(5) .chapter-banner { --banner: #000000; }

[data-theme="dark"] .chapter-banner { border-bottom: 1px solid var(--border); }
.chapter-card:nth-child(3) .chapter-banner .chapter-icon { filter: none; }

.chapter-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.chapter-number {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
  color: white;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
}

.completion-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--success);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.chapter-card.completed .completion-badge {
  display: flex;
}

.chapter-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.chapter-content p {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex: 1;
}

.chapter-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.meta-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cta-btn {
  background: var(--primary);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.chapter-card:hover .cta-btn {
  background: var(--primary-dark);
}

.coming-soon-badge {
  background: var(--accent);
}

/* ============================================
   CHAPTER PAGE LAYOUT
   ============================================ */
.chapter-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.sidebar h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc {
  list-style: none;
}

.toc li a {
  display: block;
  padding: 8px 12px;
  color: var(--text-soft);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 2px;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.toc li a:hover, .toc li a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-left-color: var(--primary);
}

[data-theme="dark"] .toc li a:hover,
[data-theme="dark"] .toc li a.active {
  color: white;
}

.main-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

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

.chapter-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.chapter-header .subtitle {
  color: var(--text-soft);
  font-size: 1.05rem;
}

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

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

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

/* ============================================
   TOPIC SECTIONS
   ============================================ */
.topic {
  margin-bottom: 2.5rem;
  scroll-margin-top: 90px;
}

.topic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.topic h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

[data-theme="dark"] .topic h2 {
  color: var(--primary);
}

.topic-num {
  background: var(--primary);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.read-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.read-toggle:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.read-toggle.read {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.topic h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.25rem 0 0.5rem;
}

.topic p {
  margin-bottom: 1rem;
  color: var(--text-soft);
}

.topic ul, .topic ol {
  margin: 0.75rem 0 1rem 1.5rem;
  color: var(--text-soft);
}

.topic li {
  margin-bottom: 6px;
}

.topic strong {
  color: var(--text);
  font-weight: 600;
}

/* Definition box */
.definition {
  background: var(--bg-soft);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
  color: var(--text);
}

[data-theme="dark"] .definition {
  background: var(--bg-soft);
}

.definition strong {
  color: var(--text);
}

[data-theme="dark"] .definition strong {
  color: var(--primary);
}

/* Image placeholder */
.image-placeholder {
  width: 100%;
  min-height: 220px;
  background: repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 10px, var(--bg) 10px, var(--bg) 20px);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin: 1rem 0;
  padding: 1rem;
  text-align: center;
}

.image-placeholder .ph-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.image-placeholder .ph-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.image-placeholder .ph-hint {
  font-size: 0.8rem;
  margin-top: 4px;
  opacity: 0.8;
}

/* Chapter images */
.topic-figure {
  margin: 1rem 0;
}

.topic-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

th {
  background: var(--primary);
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

td {
  padding: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.92rem;
}

tr:hover td {
  background: var(--bg-soft);
}

/* Info / Note boxes */
.note {
  background: var(--bg-soft);
  border-left: 4px solid var(--text-muted);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
}

.note strong {
  color: var(--text);
}

/* SQL / code blocks */
.sql-block {
  background: #000000;
  color: #e5e5e5;
  border: 1px solid #2a2a2a;
  border-left: 4px solid #ffffff;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre;
  tab-size: 2;
}
.sql-block .kw { color: #ffffff; font-weight: 700; }
.sql-block .str { color: #b3b3b3; }
.sql-block .com { color: #808080; font-style: italic; }
.sql-block .num { color: #e5e5e5; }
.sql-label {
  display: inline-block;
  background: var(--primary);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 6px;
  margin: 1rem 0 -0.4rem;
  letter-spacing: 0.5px;
}
code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.86rem;
  color: var(--text);
}
.tip {
  background: var(--bg-soft);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
}
.tip strong { color: var(--text); }

/* Code blocks with copy button */
.code-block {
  position: relative;
  margin: 1.1rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #2a2a2a;
  background: #0d0d0d;
}
.code-block .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000000;
  padding: 6px 12px;
  border-bottom: 1px solid #2a2a2a;
}
.code-block .code-lang {
  color: #808080;
  font-size: 0.72rem;
  font-family: "Consolas", "Monaco", monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.code-block .copy-btn {
  background: #1a1a1a;
  color: #e5e5e5;
  border: 1px solid #404040;
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.code-block .copy-btn:hover { background: #2a2a2a; }
.code-block .copy-btn.copied { background: #ffffff; border-color: #ffffff; color: #000; }
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
}
.code-block pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e5e5e5;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre;
  display: block;
}
.code-block .out {
  background: #000000;
  border-top: 1px dashed #404040;
  color: #b3b3b3;
  padding: 8px 16px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
}
.code-block .out::before {
  content: "Output ▸ ";
  color: #808080;
}

/* Cards inside topic */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.feature-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.feature-card .fc-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.feature-card h4 {
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text);
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin: 0;
}

/* ============================================
   QUIZ & EXERCISES
   ============================================ */
.exercise-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 3px solid var(--primary);
}

.exercise-section h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--primary-dark);
}

[data-theme="dark"] .exercise-section h2 {
  color: var(--primary);
}

.exercise-block {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.exercise-block h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qa-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

.qa-question {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.qa-question .q-num {
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.show-answer-btn {
  background: var(--primary);
  color: var(--bg);
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: var(--transition);
}

.show-answer-btn:hover {
  background: var(--text-soft);
  transform: translateY(-2px);
}

.qa-answer {
  display: none;
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--success);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  margin-top: 0.75rem;
  color: var(--text);
  animation: slideDown 0.3s ease;
}

.qa-answer.show {
  display: block;
}

.qa-answer strong {
  color: var(--success);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* MCQ */
.mcq-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

.mcq-question {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.mcq-options {
  display: grid;
  gap: 0.5rem;
}

.mcq-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
  color: var(--text-soft);
}

.mcq-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

[data-theme="dark"] .mcq-option:hover {
  color: white;
}

.mcq-option.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success);
  color: var(--success);
  font-weight: 600;
}

.mcq-option.wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

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

.mcq-option.correct .option-letter {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.mcq-option.wrong .option-letter {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* Short terms / Glossary */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.term-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
}

.term-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.term-name {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.term-def {
  color: var(--text-soft);
  font-size: 0.85rem;
}

/* Full Form Game */
.fullform-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ff-acronym {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.05rem;
  min-width: 80px;
}

.ff-reveal {
  flex: 1;
  text-align: right;
}

.ff-answer {
  display: none;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 600;
}

.ff-answer.show {
  display: inline-block;
}

.ff-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
}

.ff-btn:hover {
  background: var(--primary-dark);
}

/* Coming soon page */
.coming-soon {
  text-align: center;
  padding: 5rem 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.coming-soon-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.coming-soon h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.coming-soon p {
  font-size: 1.1rem;
  color: var(--text-soft);
  margin-bottom: 2rem;
}

.back-btn {
  background: var(--primary);
  color: white;
  padding: 12px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   WORKSHOP CTA (School Outreach)
   ============================================ */
.workshop-cta {
  max-width: 1280px;
  margin: 4rem auto 2rem;
  padding: 0 1.5rem;
}

.workshop-card {
  background: #000000;
  color: #ffffff;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.workshop-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.workshop-card::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.workshop-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.workshop-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.workshop-card h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.workshop-card h2 .highlight {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.workshop-card .tagline {
  font-size: 1.05rem;
  opacity: 0.92;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.workshop-features {
  list-style: none;
  margin: 1rem 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 8px;
}

.workshop-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  opacity: 0.95;
}

.workshop-features li::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.contact-panel {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.contact-panel h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #ffffff;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: white;
  transition: var(--transition);
}

.contact-row:last-child {
  border-bottom: none;
}

.contact-row:hover {
  transform: translateX(4px);
}

.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-icon {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.contact-icon.whatsapp,
.contact-icon.email,
.contact-icon.site {
  background: rgba(255, 255, 255, 0.1);
}

.contact-text {
  flex: 1;
  min-width: 0;
}

.contact-label {
  font-size: 0.75rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-value {
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-word;
}

.workshop-cta-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.cta-primary {
  background: #ffffff;
  color: #000000;
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.cta-primary:hover {
  background: #e5e5e5;
  transform: translateY(-3px);
}

.cta-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
}

.cta-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  .workshop-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .workshop-card {
    padding: 2rem 1.25rem;
  }
}

/* ============================================
   BRANDED FOOTER
   ============================================ */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.footer-brand .logo-icon {
  width: 56px;
  height: 56px;
  background:
    url('assets/logo.png') center / 72% no-repeat,
    #000000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
  font-weight: 700;
  flex-shrink: 0;
}

[data-theme="dark"] .footer-brand .logo-icon {
  background:
    url('assets/logo.png') center / 72% no-repeat,
    #000000;
  border: 1px solid var(--border);
}

.footer-brand h4 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 4px;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.footer-col h5 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.footer-col a, .footer-col p {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.footer-bottom .copyright {
  font-weight: 600;
  color: var(--text-soft);
}

.footer-bottom a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* Floating WhatsApp button */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  z-index: 99;
  transition: var(--transition);
  animation: pulse-wa 2.5s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .whatsapp-float {
  background: #ffffff;
  color: #000000;
  border-color: var(--border);
}

@keyframes pulse-wa {
  0%, 100% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 12px rgba(0, 0, 0, 0); }
}

@media (max-width: 480px) {
  .whatsapp-float {
    width: 52px;
    height: 52px;
    bottom: 18px;
    right: 18px;
    font-size: 1.55rem;
  }
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  width: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 968px) {
  .chapter-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    top: 0;
    max-height: 400px;
    display: none;
  }
  .sidebar.open {
    display: block;
  }
  .sidebar-toggle {
    display: block;
  }
  .main-content {
    padding: 1.5rem 1.25rem;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 2.5rem 1rem 2rem;
  }
  .hero-stats {
    gap: 1rem;
  }
  .stat {
    padding: 0.75rem 1rem;
  }
  .nav-container {
    padding: 0 1rem;
  }
  .logo-text h1 {
    font-size: 0.95rem;
  }
  .logo-text p {
    font-size: 0.7rem;
  }
  .chapters-grid {
    padding: 0 1rem;
    gap: 1rem;
  }
  .topic h2 {
    font-size: 1.25rem;
  }
}

/* Print friendly for teachers */
@media print {
  .navbar, .sidebar, .read-toggle, .theme-toggle, .reset-btn, .show-answer-btn, .ff-btn {
    display: none !important;
  }
  .main-content, .chapter-layout {
    box-shadow: none;
    border: none;
    padding: 0;
  }
  .qa-answer, .ff-answer {
    display: block !important;
  }
  body { background: white; color: black; }
}
