/* CHEMMANTRA FRAR MASTER PRESENTATION STYLESHEET — Light-First Edition */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  
  /* Light Theme (Default) — clean white with vivid accents */
  --bg-primary: #f7f8fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #eef2f7;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #0369a1;
  
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-cyan: #0284c7;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #7c3aed;
  --accent-blue: #2563eb;

  --shadow-card: 0 4px 24px -4px rgba(0, 0, 0, 0.08), 0 2px 8px -2px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 18px rgba(2, 132, 199, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg-primary: #0a0f1d;
  --bg-secondary: #0f172a;
  --bg-card: #131d35;
  --bg-hover: #1e293b;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #38bdf8;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #38bdf8;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #f43f5e;
  --accent-purple: #a78bfa;
  --accent-blue: #60a5fa;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TOP NAVBAR */
.top-nav {
  height: 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

.btn-primary {
  background: var(--accent-cyan);
  color: #0f172a;
  border: none;
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn.active {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
}

.slide-counter-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.slide-input {
  width: 50px;
  padding: 0.3rem 0.4rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
}

.slide-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* PROGRESS BAR */
.progress-bar-container {
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  width: 100%;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  width: 0%;
  transition: width 0.25s ease;
}

/* MAIN PRESENTATION STAGE */
.presentation-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}

/* SLIDE CARD */
.slide-card {
  width: 100%;
  max-width: 1300px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  min-height: 580px;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.slide-header {
  padding: 1.25rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.slide-title-area h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.slide-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.slide-meta-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.badge-module {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
}

.badge-category {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.4);
  color: var(--accent-purple);
}

/* SLIDE BODY CONTENT */
.slide-body {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  font-size: 1.05rem;
}

.slide-body h1, .slide-body h2, .slide-body h3, .slide-body h4 {
  color: var(--accent-cyan);
  margin: 1.2rem 0 0.6rem 0;
  font-weight: 700;
}

.slide-body h1 { font-size: 1.6rem; }
.slide-body h2 { font-size: 1.35rem; }
.slide-body h3 { font-size: 1.2rem; }
.slide-body h4 { font-size: 1.05rem; color: var(--accent-amber); }

.slide-body p {
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}

.slide-body ul, .slide-body ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.slide-body li {
  margin-bottom: 0.4rem;
}

/* CHEMICAL CODE & ASCII DIAGRAMS */
pre {
  background: #070b14 !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  overflow-x: auto;
  margin: 1.2rem 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.45;
  color: #38bdf8;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--accent-amber);
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* TABLES */
.table-wrapper, table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.92rem;
}

table th, table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

table th {
  background: var(--bg-secondary);
  color: var(--accent-cyan);
  font-weight: 600;
}

table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

table tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

/* CALLOUT BOXES */
.callout {
  border-left: 4px solid var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.2rem 0;
}

.callout-title {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.callout-tip {
  border-left-color: var(--accent-emerald);
  background: rgba(52, 211, 153, 0.08);
}
.callout-tip .callout-title { color: var(--accent-emerald); }

.callout-warning {
  border-left-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.08);
}
.callout-warning .callout-title { color: var(--accent-rose); }

.callout-important {
  border-left-color: var(--accent-amber);
  background: rgba(251, 191, 36, 0.08);
}
.callout-important .callout-title { color: var(--accent-amber); }

/* BOTTOM BAR */
.bottom-bar {
  height: 48px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.bottom-left, .bottom-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* TOC DRAWER */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: -420px;
  width: 420px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}

.drawer.open {
  left: 0;
}

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

.drawer-search {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.drawer-search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.drawer-search input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.drawer-module-group {
  margin-bottom: 1rem;
}

.drawer-module-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  padding: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.drawer-slide-item {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  margin: 0.2rem 0;
}

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

.drawer-slide-item.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* SEARCH MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 3000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.modal-search-box {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.modal-search-box input:focus {
  outline: none;
}

.modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.modal-result-item {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-result-item:hover {
  background: var(--bg-hover);
}

.result-title {
  font-weight: 600;
  color: var(--accent-cyan);
  font-size: 0.95rem;
}

.result-snippet {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CONTINUOUS DOCUMENT MODE */
body.document-mode .presentation-stage {
  display: block;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

body.document-mode .slide-card {
  height: auto !important;
  min-height: unset !important;
  margin-bottom: 3rem;
}

body.document-mode .slide-body {
  overflow-y: visible !important;
}

/* RESPONSIVENESS */
@media (max-width: 900px) {
  .top-nav { padding: 0 1rem; }
  .brand span.text { display: none; }
  .slide-card { height: calc(100vh - 170px); }
  .slide-body { padding: 1.25rem; font-size: 0.95rem; }
}


/* ============================================================
   CHEMMANTRA FRAR — CONTENT LAYER
   Cards, KPI tiles, step lists, reaction boxes, SVG figures,
   3D viewers and reveal-boxes used by slides_data.js
   ============================================================ */

/* ---------- GRIDS ---------- */
.grid { display: grid; gap: 0.9rem; margin: 0.5rem 0 0.9rem 0; align-items: start; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  min-width: 0;
}
.card-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}
.card ul, .card ol { margin: 0.2rem 0 0 1.15rem; }
.card li { margin-bottom: 0.3rem; font-size: 0.95rem; line-height: 1.45; }
.card p { margin-bottom: 0.5rem; font-size: 0.95rem; line-height: 1.5; }
.card .card { background: rgba(148,163,184,.06); border-left-color: var(--accent-amber); }

/* ---------- KPI TILES ---------- */
.kpi {
  background: linear-gradient(135deg, rgba(56,189,248,.10), rgba(56,189,248,.02));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
  text-align: center;
}
.kpi-value { font-size: 1.35rem; font-weight: 800; color: var(--accent-cyan); font-family: 'JetBrains Mono', monospace; }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.15rem; }
.kpi-sub { font-size: 0.78rem; color: var(--text-secondary, var(--text-muted)); margin-top: 0.25rem; }

/* ---------- STEPS ---------- */
.steps { display: flex; flex-direction: column; gap: 0.45rem; }
.step { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; line-height: 1.45; }
.step-n {
  flex: 0 0 1.45rem; height: 1.45rem; border-radius: 50%;
  background: var(--accent-cyan); color: #04121f;
  font-weight: 800; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- REACTION BOX ---------- */
.rxn {
  background: rgba(16,185,129,.07);
  border: 1px dashed rgba(16,185,129,.55);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  margin: 0.6rem 0;
  text-align: center;
  overflow-x: auto;
}
.rxn-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: .05em; }
.rxn-eq { font-size: 1.02rem; overflow-x: auto; }

/* ---------- FIGURES & SVG ---------- */
.fig-block { margin: 0.5rem 0 0.9rem 0; }
.fig-svg { width: 100%; }
.fig-svg svg, svg.svgfig { width: 100%; height: auto; max-height: 46vh; display: block; }
.figtag {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent-amber); border: 1px solid var(--accent-amber);
  border-radius: 999px; padding: 0.1rem 0.55rem; margin-bottom: 0.35rem;
}
.figcap { font-size: 0.82rem; color: var(--text-muted); text-align: center; margin-top: 0.4rem; line-height: 1.4; }
svg text { font-family: 'Inter', 'Segoe UI', sans-serif; }

/* ---------- 3D VIEWERS ---------- */
.v3d-wrap { position: relative; margin: 0.5rem 0 0.9rem 0; min-width: 0; }
.v3d {
  position: relative; width: 100%; height: 320px;
  background: #0a0f1c; border: 1px solid var(--border-color);
  border-radius: var(--radius-md); overflow: hidden;
}
.v3d canvas { display: block; }
.v3d-tools {
  position: absolute; top: 0.45rem; right: 0.45rem; display: flex; gap: 0.3rem; z-index: 5;
}
.v3d-tools button {
  font-size: 0.7rem; padding: 0.2rem 0.5rem; cursor: pointer;
  background: rgba(15,23,42,.85); color: #e2e8f0;
  border: 1px solid rgba(148,163,184,.45); border-radius: 6px;
  font-family: 'Inter', sans-serif;
}
.v3d-tools button:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.v3d-tools button.on { background: var(--accent-cyan); color: #04121f; font-weight: 700; }
.v3d-err { color: #fca5a5; font-size: 0.85rem; padding: 1rem; text-align: center; }

/* ---------- REVEAL BOX ---------- */
.reveal-box {
  border: 1px solid rgba(217,119,6,.5);
  background: rgba(217,119,6,.06);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  margin: 0.6rem 0 0.2rem 0;
}
.rv-toggle {
  width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: none;
  color: var(--accent-amber); font-weight: 700; font-size: 0.95rem;
  font-family: 'Inter', sans-serif; padding: 0.15rem 0;
}
.rv-body { display: none; margin-top: 0.6rem; border-top: 1px solid rgba(148,163,184,.3); padding-top: 0.6rem; }
.reveal-box.open .rv-body { display: block; }

/* ---------- ANSWER BADGE ---------- */
.answer-badge {
  display: inline-block; background: rgba(16,185,129,.18);
  border: 1px solid #10b981; color: #10b981;
  border-radius: 8px; padding: 0.15rem 0.6rem; font-weight: 700;
  font-size: 0.9rem; margin-bottom: 0.5rem;
}
.q-stem { font-size: 0.95rem; line-height: 1.5; }
.q-stem ul, .q-stem ol { margin: 0.3rem 0 0.5rem 1.2rem; }
.q-stem li { margin-bottom: 0.3rem; }
.sol-lead { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 0.5rem 0 0.35rem; }

/* ---------- KATEX WIDTH SAFETY ---------- */
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 0.15rem 0; }
.katex { font-size: 1.02em; }

/* ---------- TABLES IN SLIDES ---------- */
.table-wrapper { max-width: 100%; overflow-x: auto; margin: 0.5rem 0 0.9rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.45rem 0.6rem; vertical-align: top; line-height: 1.4; }
th { white-space: normal; }

/* ---------- MISC ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0; }
.pill {
  font-size: 0.74rem; padding: 0.12rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--border-color); color: var(--text-muted);
}
code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.86em;
  background: rgba(148,163,184,.14); padding: 0.05rem 0.3rem; border-radius: 4px;
}

/* CALLOUT COMPLETION — spec requires NOTE / TIP / WARNING / CAUTION / IMPORTANT */
.callout-note {
  border-left-color: var(--accent-blue);
  background: rgba(96, 165, 250, 0.09);
}
.callout-note .callout-title { color: var(--accent-blue); }

.callout-caution {
  border-left-color: var(--accent-purple);
  background: rgba(167, 139, 250, 0.10);
}
.callout-caution .callout-title { color: var(--accent-purple); }

:root[data-theme="light"] .callout-note { background: rgba(37, 99, 235, 0.07); }
:root[data-theme="light"] .callout-caution { background: rgba(124, 58, 237, 0.07); }

/* ---------- NESTED SOLUTION SUB-STEPS ---------- */
.substeps { margin: 0.35rem 0 0 0.2rem; padding-left: 1rem; list-style: disc; }
.substeps li { font-size: 0.93em; line-height: 1.4; margin-bottom: 0.22rem; color: var(--text-secondary, inherit); }

/* ---------- MODULE 07 · PAGE LOCATOR BADGE ---------- */
.page-ref {
  display: inline-block;
  margin: 0.45rem 0 0.15rem 0;
  padding: 0.24rem 0.7rem;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.10);
  color: var(--accent-2, #38bdf8);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}


/* M. S. Chouhan Question Image Embed Styling */
.q-image-box {
  margin: 0.5rem auto 1.5rem auto;
  text-align: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 96%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.q-image-box img {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  cursor: zoom-in;
}

.q-image-box img:hover {
  transform: scale(1.02);
}

.q-image-box.multi-image img {
  max-width: 48%;
  min-width: 280px;
}

@media (max-width: 768px) {
  .q-image-box img {
    max-height: 280px;
  }
  .q-image-box.multi-image img {
    max-width: 100%;
  }
}

/* ==========================================================================
   ChemMantra 2D Mechanism Video & High-Res Poster Showcase
   ========================================================================== */
.mechanism-video-card {
  margin: 1.5rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.mechanism-video-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.mechanism-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(56, 189, 248, 0.08);
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.mechanism-video-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.mechanism-video-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: #050811;
}

.mechanism-video-player {
  width: 100%;
  max-width: 960px;
  max-height: 520px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  outline: none;
  background: #000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.mechanism-video-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0.5rem 1rem 0.75rem 1rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.mechanism-video-actions a {
  color: var(--accent-emerald);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mechanism-video-actions a:hover {
  text-decoration: underline;
}


/* ==========================================================================
   Extra Light-Mode Polish
   ========================================================================== */

/* Colorful top-border accents on cards in light mode */
.grid .card:nth-child(1) { border-top: 3px solid var(--accent-cyan); }
.grid .card:nth-child(2) { border-top: 3px solid var(--accent-emerald); }
.grid .card:nth-child(3) { border-top: 3px solid var(--accent-purple); }
.grid .card:nth-child(4) { border-top: 3px solid var(--accent-amber); }
.grid .card:nth-child(5) { border-top: 3px solid var(--accent-rose); }
.grid .card:nth-child(6) { border-top: 3px solid var(--accent-blue); }

[data-theme="dark"] .grid .card {
  border-top: 1px solid var(--border-color);
}

/* Subtle page background pattern for light mode */
body {
  background-image: radial-gradient(circle at 25px 25px, rgba(0,0,0,0.015) 1px, transparent 0);
  background-size: 50px 50px;
}

[data-theme="dark"] body {
  background-image: none;
}

/* Slide Header in Light Mode */
.slide-header {
  background: linear-gradient(135deg, #f0f7ff 0%, #faf5ff 50%, #f0fdf4 100%);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .slide-header {
  background: rgba(15, 23, 42, 0.6);
}

/* Light mode table styling */
table {
  background: var(--bg-card);
  border-collapse: collapse;
}

table th {
  background: rgba(2, 132, 199, 0.08);
  color: var(--accent-cyan);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
}

[data-theme="dark"] table th {
  background: rgba(56, 189, 248, 0.12);
}

table td {
  border-bottom: 1px solid var(--border-color);
}

table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
