/* ==========================================================================
   StudyPlanning.online — Design System & Component Stylesheet
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --indigo: #4f46e5;
  --emerald: #10b981;
  --emerald-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --coral: #ef4444;
  --coral-soft: #fef2f2;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;

  --navy-card: #0f172a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, 0.14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --container: 1220px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-alt: #111827;
  --surface: #151f32;
  --surface-2: #1e293b;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --border: #273549;
  --border-strong: #3b4d68;
  --primary-soft: rgba(37, 99, 235, 0.18);
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --amber-soft: rgba(245, 158, 11, 0.16);
  --coral-soft: rgba(239, 68, 68, 0.16);
  --purple-soft: rgba(124, 58, 237, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.48);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  font-size: 16px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.65rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.22rem; font-weight: 700; }
h4 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 1rem; color: var(--text-muted); }

.mono { font-family: var(--font-mono); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 72px 0; }
.section-sm { padding: 44px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 34px;
}
.section-header.centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 740px;
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
  text-decoration: none !important;
  line-height: 1.25;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  color: #ffffff;
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.5);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-emerald {
  background: var(--emerald);
  color: #ffffff;
  box-shadow: 0 8px 18px -6px rgba(16, 185, 129, 0.45);
}
.btn-emerald:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: 0.84rem; border-radius: 10px; }
.btn-lg { padding: 14px 26px; font-size: 1rem; border-radius: 14px; }

/* ---------- Badges & Pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-emerald { background: var(--emerald-soft); color: #059669; border-color: transparent; }
.badge-amber { background: var(--amber-soft); color: #b45309; border-color: transparent; }
.badge-coral { background: var(--coral-soft); color: #dc2626; border-color: transparent; }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: transparent; }
[data-theme="dark"] .badge-emerald { color: #34d399; }
[data-theme="dark"] .badge-amber { color: #fbbf24; }
[data-theme="dark"] .badge-coral { color: #f87171; }

/* ---------- Header / Navbar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.88);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none !important;
  flex-shrink: 0;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand span em { font-style: normal; color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  padding: 7px 9px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none !important;
  transition: background-color 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.xp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #b45309;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
[data-theme="dark"] .xp-pill { color: #fbbf24; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.nav-toggle { display: none; }

@media (max-width: 1080px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .nav-cta-desktop { display: none; }
}

@media (max-width: 540px) {
  .container { padding: 0 16px; }
  .nav-inner { gap: 8px; }
  .brand { font-size: 0.98rem; gap: 7px; }
  .brand img { width: 28px; height: 28px; }
  .xp-pill { display: none; }
  .icon-btn { width: 36px; height: 36px; }
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 58px 0 64px;
  background:
    radial-gradient(circle at 85% 15%, rgba(79, 70, 229, 0.14), transparent 45%),
    radial-gradient(circle at 12% 85%, rgba(16, 185, 129, 0.11), transparent 42%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-lead {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 24px;
}

.hero-launcher {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
}
.hero-launcher-row {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 10px;
}
@media (max-width: 640px) {
  .hero-launcher-row { grid-template-columns: 1fr; }
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-soft);
  font-weight: 500;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }

.hero-showcase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.hero-showcase canvas {
  width: 100%;
  max-width: 440px;
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.hero-showcase-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.84rem;
  color: var(--text-soft);
}

/* ---------- Stat Strip ---------- */
.stat-strip {
  background: var(--navy-card);
  color: #f8fafc;
  padding: 26px 0;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  text-align: center;
}
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  color: #93c5fd;
}
.stat-item span {
  font-size: 0.84rem;
  color: #cbd5e1;
}

/* ---------- Cards & Grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-5 > *, .hero-grid > *, .studio-grid > * { min-width: 0; }
@media (max-width: 1040px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .btn { white-space: normal; text-align: center; max-width: 100%; flex-shrink: 1; }
}

main, section { overflow-x: clip; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.card > * { min-width: 0; }
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.topic-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.topic-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
}
.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* ---------- Form Controls ---------- */
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.94rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.label {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group { margin-bottom: 14px; }

/* ---------- Challenge Banner ---------- */
.challenge-banner {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.challenge-banner p { color: #cbd5e1; margin: 0; }

/* ---------- Exam Arena (Testbook-inspired Simulator) ---------- */
.exam-topbar {
  position: sticky;
  top: 76px;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.exam-timer {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}
.exam-timer.warning {
  background: var(--coral-soft);
  color: #dc2626;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--emerald));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.exam-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 22px;
  align-items: start;
}
@media (max-width: 920px) {
  .exam-layout { grid-template-columns: 1fr; }
}

.question-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.question-text {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 700;
  margin: 12px 0 20px;
  color: var(--text);
  line-height: 1.42;
}

.options-list { display: grid; gap: 12px; }
.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 500;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.1s ease;
}
.option-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.option-btn.correct {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: #065f46;
}
.option-btn.wrong {
  border-color: var(--coral);
  background: var(--coral-soft);
  color: #991b1b;
}
[data-theme="dark"] .option-btn.correct { color: #6ee7b7; }
[data-theme="dark"] .option-btn.wrong { color: #fca5a5; }

.option-key {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.84rem;
  flex-shrink: 0;
}
.option-btn.selected .option-key {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.palette-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: sticky;
  top: 152px;
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.palette-dot {
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
.palette-dot.answered { background: var(--emerald); color: #ffffff; border-color: var(--emerald); }
.palette-dot.marked { background: var(--purple); color: #ffffff; border-color: var(--purple); }
.palette-dot.current { outline: 3px solid var(--primary); outline-offset: 1px; }

.palette-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--text-soft);
}
.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
}

/* ---------- Result Analytics & Scorecard Studio ---------- */
.result-hero {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.result-hero h2, .result-hero h3 { color: #ffffff; }
.result-hero p { color: #cbd5e1; }

.metric-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}
@media (max-width: 720px) { .metric-tiles { grid-template-columns: repeat(2, 1fr); } }
.metric-tile {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px;
}
.metric-tile span { font-size: 0.78rem; color: #94a3b8; display: block; }
.metric-tile strong { font-family: var(--font-mono); font-size: 1.4rem; color: #ffffff; }

.studio-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 26px;
  align-items: start;
}
@media (max-width: 980px) { .studio-grid { grid-template-columns: 1fr; } }

.canvas-stage {
  background: var(--bg-alt);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
}
.canvas-stage canvas {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.photo-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.photo-dropzone:hover, .photo-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.theme-pill {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-pill.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }

.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  justify-content: center;
}

/* ---------- Planner & Timetable ---------- */
.timetable-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.timetable-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}
.timetable-table th, .timetable-table td {
  border: 1px solid var(--border);
  padding: 10px;
  vertical-align: top;
  font-size: 0.84rem;
}
.timetable-table th {
  background: var(--bg-alt);
  font-family: var(--font-display);
  font-weight: 700;
  text-align: left;
}
.slot-pill {
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 600;
  margin-bottom: 4px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
}

.pomodoro-box {
  text-align: center;
  padding: 26px;
}
.pomodoro-clock {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  margin: 14px 0;
  color: var(--primary);
}

/* ---------- 3D Flip Flashcards ---------- */
.flashcard-scene {
  perspective: 1100px;
  max-width: 640px;
  margin: 0 auto;
}
.flashcard {
  position: relative;
  width: 100%;
  min-height: 270px;
  transform-style: preserve-3d;
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.flashcard-front {
  background: var(--surface);
}
.flashcard-back {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #ffffff;
  transform: rotateY(180deg);
}
.flashcard-back p, .flashcard-back h3 { color: #ffffff; }

/* ---------- Tabs, Accordions, Tables, Modal, Toast ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.tab-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.faq-a {
  display: none;
  padding: 0 20px 18px;
  color: var(--text-muted);
}
.faq-item.open .faq-a { display: block; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.data-table th, .data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.data-table th {
  background: var(--bg-alt);
  font-family: var(--font-display);
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 780px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Footer ---------- */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 58px 0 28px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 34px;
  border-bottom: 1px solid #1e293b;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #ffffff; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: #94a3b8; font-size: 0.9rem; }
.site-footer a:hover { color: #ffffff; }
.footer-bottom {
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  color: #64748b;
}

.hidden { display: none !important; }

@media print {
  .site-header, .site-footer, .no-print, .nav-actions, .share-bar { display: none !important; }
  body { background: #ffffff; color: #000000; }
  .card, .timetable-wrap { box-shadow: none; border-color: #cbd5e1; }
}
