/* SciUganda Modern Stylesheet & Design System */
:root {
  /* Brand Palette */
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-dark: #04433e;
  --primary-light: #f0fdfa;
  --primary-surface: #ccfbf1;
  --primary-glow: rgba(15, 118, 110, 0.22);
  
  /* Class Theming */
  --p5-green: #15803d;
  --p5-green-hover: #166534;
  --p5-green-light: #f0fdf4;
  --p5-green-surface: #dcfce7;
  --p5-green-glow: rgba(21, 128, 61, 0.22);

  --p6-teal: #0f766e;
  --p6-teal-hover: #0d9488;
  --p6-teal-light: #f0fdfa;
  --p6-teal-surface: #ccfbf1;

  /* Accent & Functional Colors */
  --secondary: #0284c7;
  --secondary-hover: #0369a1;
  --secondary-light: #f0f9ff;
  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  --accent-flame: #ea580c;
  --accent-purple: #7c3aed;
  --accent-purple-light: #f5f3ff;

  /* Backgrounds & Surfaces */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-glass-card: rgba(255, 255, 255, 0.82);

  /* Typography Colors */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border: #e2e8f0;
  --border-subtle: #cbd5e1;

  /* Status Colors */
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #ca8a04;
  --warning-light: #fef9c3;

  /* Shapes & Shadows */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow: 0 4px 10px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 18px -3px rgba(15, 23, 42, 0.08), 0 3px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 28px -4px rgba(15, 23, 42, 0.1), 0 6px 12px -3px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 24px 38px -6px rgba(15, 23, 42, 0.12), 0 10px 18px -4px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 25px rgba(15, 118, 110, 0.28);
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

/* ==========================================================================
   Header & Sticky Navigation
   ========================================================================== */
.navbar {
  background-color: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

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

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.4px;
}

.brand-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(15, 118, 110, 0.2));
}

.brand-text {
  background: linear-gradient(135deg, #0f766e, #0284c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Class Toggle Segmented Pill in Navbar */
.class-toggle-pill {
  display: flex;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 3px;
}

.pill-btn {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.pill-btn:hover {
  color: var(--text-main);
}

.pill-btn.active.p6-active {
  background: #0f766e;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.35);
}

.pill-btn.active.p5-active {
  background: #15803d;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.35);
}

/* ==========================================================================
   Hamburger Button & Nav Left
   ========================================================================== */
.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hamburger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.hamburger-btn:active {
  transform: translateY(0);
}

.hamburger-box {
  width: 20px;
  height: 14px;
  display: inline-block;
  position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  position: absolute;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.hamburger-inner {
  top: 6px;
}

.hamburger-inner::before {
  content: '';
  top: -6px;
}

.hamburger-inner::after {
  content: '';
  bottom: -6px;
}

.hamburger-btn:hover .hamburger-inner,
.hamburger-btn:hover .hamburger-inner::before,
.hamburger-btn:hover .hamburger-inner::after {
  background-color: var(--primary);
}

/* Header Center Search Pill */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 420px;
  margin: 0 16px;
}

.header-search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.header-search-pill:hover {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.12);
}

.search-placeholder {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-kbd {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-subtle);
}

/* Header Actions & Badges */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.study-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #fcd34d;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 800;
  color: #b45309;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.18);
  cursor: default;
  transition: transform 0.2s ease;
}

.study-streak-badge:hover {
  transform: scale(1.05);
}

.streak-flame {
  font-size: 1rem;
  animation: pulseFlame 1.8s infinite ease-in-out;
}

@keyframes pulseFlame {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(4deg); }
}

.header-pdf-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Modern Navigation Sidebar Drawer & Backdrop
   ========================================================================== */
body.sidebar-open {
  overflow: hidden !important;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 330px;
  max-width: 88vw;
  background: #ffffff;
  z-index: 2010;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
  outline: none;
}

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

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand-icon {
  font-size: 1.6rem;
}

.sidebar-brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-close-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: rotate(90deg);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Scholar Snapshot in Drawer */
.sidebar-scholar-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f0fdfa 0%, #f0fdf4 100%);
  border: 1px solid #ccfbf1;
  padding: 12px 14px;
  border-radius: var(--radius);
}

.scholar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 10px;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.scholar-greeting {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--primary-dark);
}

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

/* Navigation Groups in Drawer */
.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-group-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  padding: 0 10px 4px;
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg-subtle);
  color: var(--primary);
  transform: translateX(3px);
}

.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  border-left: 3px solid var(--primary);
}

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

.sidebar-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-primary { background: #ccfbf1; color: #0f766e; }
.badge-p5 { background: #dcfce7; color: #15803d; }
.badge-p6 { background: #ccfbf1; color: #0f766e; }
.badge-p7 { background: #ede9fe; color: #7c3aed; }
.badge-teal { background: #e0f2fe; color: #0369a1; }
.badge-emerald { background: #d1fae5; color: #047857; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.sidebar-footer-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-subtle);
}

/* Responsive adjustments */
@media (max-width: 820px) {
  .header-center {
    display: none;
  }

  .header-pdf-btn .btn-text {
    display: none;
  }

  .study-streak-badge .streak-label {
    display: none;
  }
}

/* ==========================================================================
   Buttons & Micro-Interactions
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1.4;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1.05rem;
  border-radius: 12px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}

.btn-emerald {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.btn-emerald:hover {
  background: #047857;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
}

.btn-outline-white {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #ffffff;
}

.btn-warning {
  background: #f59e0b;
  color: #1e293b;
  font-weight: 800;
}

.btn-warning:hover {
  background: #d97706;
  color: #ffffff;
}

/* ==========================================================================
   Modern Dashboard Hero & Welcome Section
   ========================================================================== */
.modern-hero {
  background: linear-gradient(135deg, #09403b 0%, #0f766e 45%, #0284c7 100%);
  color: #ffffff;
  padding: 44px 0 54px 0;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.modern-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.modern-hero.hero-p5 {
  background: linear-gradient(135deg, #064e3b 0%, #15803d 45%, #0284c7 100%);
}

.hero-content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: center;
}

@media (max-width: 960px) {
  .hero-content-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-dynamic-greeting {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fef08a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-title {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 1.8rem;
  }
}

.hero-subtitle {
  font-size: 1.05rem;
  opacity: 0.92;
  line-height: 1.6;
  max-width: 650px;
  margin-bottom: 24px;
}

/* Quick Search in Hero */
.hero-search-box {
  display: flex;
  background: #ffffff;
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-width: 580px;
}

.hero-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-main);
  background: transparent;
}

.hero-search-input::placeholder {
  color: var(--text-subtle);
}

.hero-search-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-search-btn:hover {
  background: var(--primary-hover);
}

/* Hero Right: Gamified Learning Dashboard Card */
.hero-stat-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hero-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat-streak {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-streak-icon {
  font-size: 2.2rem;
}

.hero-streak-num {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: #fef08a;
}

.hero-streak-label {
  font-size: 0.75rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.hero-metric-name {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
}

.hero-metric-badge {
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.85rem;
}

/* ==========================================================================
   Quick Resume Bar (Conditional via localStorage)
   ========================================================================== */
.resume-study-bar {
  background: linear-gradient(90deg, #ecfdf5 0%, #f0fdfa 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: none; /* Managed by assets/app.js */
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  animation: slideDown 0.3s ease-out;
}

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

.resume-study-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.resume-icon-circle {
  width: 44px;
  height: 44px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.resume-tag {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #047857;
}

.resume-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #065f46;
}

/* ==========================================================================
   Dual Class Gateway (P.5 vs P.6)
   ========================================================================== */
.class-gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .class-gateway-grid {
    grid-template-columns: 1fr;
  }
}

.gateway-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.gateway-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gateway-card.p7-card {
  border-color: #ddd6fe;
}

.gateway-card.p7-card.active-class-card {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), var(--shadow-md);
}

.gateway-card.p6-card {
  border-color: #99f6e4;
}

.gateway-card.p6-card.active-class-card {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15), var(--shadow-md);
}

.gateway-card.p5-card {
  border-color: #bbf7d0;
}

.gateway-card.p5-card.active-class-card {
  border-color: #15803d;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15), var(--shadow-md);
}

.gateway-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.gateway-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gateway-icon {
  font-size: 2.2rem;
}

.gateway-grade-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.gateway-term-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.gateway-status-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.status-active-p6 {
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.status-active-p5 {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-active-p7 {
  background: #ede9fe;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

.gateway-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.gateway-specs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.gateway-spec-chip {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

/* ==========================================================================
   Interactive Study Tools Hub Grid
   ========================================================================== */
.tools-hub-section {
  margin-bottom: 36px;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.tools-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

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

.tool-card-top {
  margin-bottom: 16px;
}

.tool-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.tool-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.icon-box-blue {
  background: #e0f2fe;
  color: #0284c7;
}

.icon-box-emerald {
  background: #dcfce7;
  color: #16a34a;
}

.icon-box-amber {
  background: #fef3c7;
  color: #d97706;
}

.icon-box-purple {
  background: #f3e8ff;
  color: #9333ea;
}

.tool-chip {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.tool-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.tool-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Curriculum Topics Modern Grid
   ========================================================================== */
.topic-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.modern-topic-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
}

.modern-topic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.topic-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.topic-icon-large {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.15);
}

.topic-number-pill {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-surface);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.topic-theme-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--secondary);
  margin-bottom: 4px;
}

.modern-topic-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 10px;
}

.modern-topic-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}

/* Topic Progress & Spec Badges */
.topic-progress-box {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.topic-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.topic-progress-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.topic-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #0f766e);
  border-radius: 999px;
}

.topic-action-buttons {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr;
  gap: 8px;
}

@media (max-width: 480px) {
  .topic-action-buttons {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   PLE Examination Strategy Hub
   ========================================================================== */
.ple-strategy-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin-bottom: 40px;
}

.ple-strategy-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--border);
}

.ple-badge-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fef3c7;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.ple-strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.ple-tip-box {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
  padding: 16px;
}

.ple-tip-box.danger-tip {
  border-left-color: var(--danger);
  background: #fff5f5;
}

.ple-tip-box.success-tip {
  border-left-color: var(--success);
  background: #f0fdf4;
}

.ple-tip-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ple-tip-desc {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.55;
}

/* ==========================================================================
   Stats Bar Grid
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  font-size: 2rem;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 12px;
}

.stat-val {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Study Notes Content & Diagrams
   ========================================================================== */
.note-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 36px;
  margin-bottom: 30px;
}

.subtopic-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.subtopic-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.subtopic-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.note-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 20px 0 10px 0;
  color: #0f172a;
}

.note-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 16px 0 8px 0;
  color: #334155;
}

.note-content p {
  margin-bottom: 14px;
}

.note-content ul, .note-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.note-content li {
  margin-bottom: 6px;
}

.diagram-box {
  background: #0f172a;
  color: #38bdf8;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  border: 1px solid #1e293b;
}

/* Textbook Real Educational Photo Cards */
.photo-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 24px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.photo-card img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.photo-caption {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.5;
}

.photo-caption strong {
  color: #0f766e;
}

.photo-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

@media (max-width: 768px) {
  .photo-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  margin: 16px 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th, .table td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.table th {
  background-color: #f1f5f9;
  font-weight: 700;
  color: var(--text-main);
}

.table tr:hover {
  background-color: #f8fafc;
}

/* Alerts and Badges */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.95rem;
}

.alert-warning {
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  color: #713f12;
}

.alert-success {
  background: var(--success-light);
  border-left: 4px solid var(--success);
  color: #14532d;
}

.alert-danger {
  background: var(--danger-light);
  border-left: 4px solid var(--danger);
  color: #7f1d1d;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

/* Flashcards */
.flashcard-wrapper {
  max-width: 650px;
  margin: 30px auto;
  perspective: 1000px;
}

.flashcard {
  position: relative;
  width: 100%;
  min-height: 320px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid var(--primary-light);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  text-align: center;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.card-back {
  transform: rotateY(180deg);
  background: #f0fdfa;
  border-radius: 14px;
}

.card-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 9999px;
  margin-bottom: 16px;
}

.card-term {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.card-desc {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #334155;
}

.card-hint {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.flashcard-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

/* Quiz Styles */
.quiz-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.q-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.q-text {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opt-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
}

.opt-label:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.opt-label.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.opt-label.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: #14532d;
  font-weight: 600;
}

.opt-label.incorrect {
  border-color: var(--danger);
  background: var(--danger-light);
  color: #7f1d1d;
}

.q-explanation {
  margin-top: 14px;
  padding: 12px 16px;
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: 0.95rem;
}

/* Score Card */
.score-card {
  background: linear-gradient(135deg, #0f766e 0%, #0369a1 100%);
  color: #ffffff;
  padding: 32px;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 30px;
}

.score-num {
  font-size: 3rem;
  font-weight: 800;
}

/* Topic Layout & Sidebar */
.topic-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
  position: relative;
}

@media (max-width: 900px) {
  .topic-layout {
    grid-template-columns: 1fr;
  }
  .topic-sidebar {
    display: none;
  }
}

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

.topic-sidebar h4 {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.topic-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topic-nav-item a {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1.4;
  border-left: 3px solid transparent;
}

.topic-nav-item a:hover {
  background: var(--bg-main);
  color: var(--primary);
  border-left-color: var(--primary);
}

.competences-box {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.competences-box h4 {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.competences-box ul {
  padding-left: 20px;
  color: #134e4a;
  line-height: 1.6;
  font-size: 0.95rem;
}

.interactive-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 20px;
  margin-top: 30px;
}

.interactive-card h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.interactive-card details {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.interactive-card details[open] {
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.1);
}

.interactive-card summary {
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  background: #f8fafc;
  user-select: none;
  font-size: 0.95rem;
  color: #1e293b;
}

.interactive-card summary:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.answer-content {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #ffffff;
  font-size: 0.93rem;
  line-height: 1.6;
  color: #334155;
}

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #0d9488, #0284c7);
  z-index: 1000;
  transition: width 0.1s ease;
}

/* ==========================================================================
   Modern Multi-Column Footer
   ========================================================================== */
.modern-footer {
  margin-top: auto;
  background: #0f172a;
  color: #94a3b8;
  padding: 50px 0 28px 0;
  border-top: 1px solid #1e293b;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 36px;
  margin-bottom: 36px;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.footer-brand h4 {
  color: #f8fafc;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand p {
  color: #94a3b8;
  line-height: 1.6;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.footer-col h5 {
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #38bdf8;
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: #64748b;
}

.footer-bottom a {
  color: #94a3b8;
}

.footer-bottom a:hover {
  color: #38bdf8;
}

/* Print Utilities */
@media print {
  .navbar, .modern-footer, .btn, .flashcard-nav, .quiz-controls, .no-print,
  .hero-search-box, .class-toggle-pill, .study-streak-badge, .mobile-menu-btn {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .note-container {
    box-shadow: none;
    border: none;
    padding: 0;
  }
  .photo-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    page-break-inside: avoid;
    break-inside: avoid;
    margin: 16px 0 !important;
  }
  .photo-card img {
    max-height: 320px !important;
  }
}


/* ==========================================================================
   Interactive Instant-Feedback Quiz Engine Styles
   ========================================================================== */
.quiz-engine-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding-bottom: 60px;
}

/* Sticky / Prominent Top Controls & Scoreboard */
.quiz-top-bar {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 86px;
  z-index: 90;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.quiz-top-metrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}

.quiz-metric-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.quiz-metric-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  color: var(--primary);
}

.quiz-streak-flame {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  color: #b45309;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 800;
}

.quiz-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-btn-control {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quiz-btn-control:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.quiz-btn-control.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Progress Bar */
.quiz-progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #0f766e);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Interactive Question Card */
.quiz-instant-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

@media (max-width: 600px) {
  .quiz-instant-card {
    padding: 20px;
  }
}

.quiz-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.q-badge-num {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.q-badge-pts {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.quiz-question-prompt {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 22px;
}

/* Options Grid */
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-option-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  outline: none;
  font-family: inherit;
}

.quiz-option-item:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quiz-option-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.quiz-opt-letter {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #334155;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.quiz-opt-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.quiz-feedback-icon {
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: none;
  flex-shrink: 0;
}

/* Option States upon answering */
.quiz-option-item.opt-correct {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #065f46 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.quiz-option-item.opt-correct .quiz-opt-letter {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.quiz-option-item.opt-correct .quiz-opt-text {
  color: #065f46 !important;
  font-weight: 700;
}

.quiz-option-item.opt-correct .quiz-feedback-icon {
  display: inline-flex;
  background: #10b981;
  color: #ffffff;
}

.quiz-option-item.opt-incorrect {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.quiz-option-item.opt-incorrect .quiz-opt-letter {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

.quiz-option-item.opt-incorrect .quiz-opt-text {
  color: #991b1b !important;
}

.quiz-option-item.opt-incorrect .quiz-feedback-icon {
  display: inline-flex;
  background: #ef4444;
  color: #ffffff;
}

.quiz-option-item.opt-revealed {
  border-color: #10b981 !important;
  background: #f0fdf4 !important;
  border-style: dashed !important;
}

.quiz-option-item.opt-revealed .quiz-opt-letter {
  background: #10b981 !important;
  color: #ffffff !important;
}

.quiz-option-item.opt-revealed .quiz-feedback-icon {
  display: inline-flex;
  background: #dcfce7;
  color: #166534;
}

.quiz-option-item:disabled {
  cursor: default;
}

/* Feedback Banner */
.quiz-instant-banner {
  display: none;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 0.95rem;
  align-items: center;
  gap: 10px;
  animation: fadeInBanner 0.25s ease-out;
}

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

.banner-correct {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #15803d;
}

.banner-incorrect {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

/* Explanation Box */
.quiz-explanation-card {
  display: none;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 16px;
  animation: expandExplanation 0.3s ease-out;
}

@keyframes expandExplanation {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.explanation-header {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.explanation-body {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.6;
}

/* Card Mode Navigation Buttons */
.quiz-card-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.quiz-next-btn {
  background: var(--primary);
  color: #ffffff;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.quiz-next-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
}

.quiz-next-btn.ready-pulse {
  animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(15, 118, 110, 0); }
}

/* Dots Pagination */
.quiz-dots-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 16px 0 24px 0;
}

.quiz-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.quiz-dot:hover {
  background: #94a3b8;
  transform: scale(1.15);
}

.quiz-dot.dot-active {
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.3);
  background: var(--primary);
}

.quiz-dot.dot-correct {
  background: #10b981;
}

.quiz-dot.dot-incorrect {
  background: #ef4444;
}

/* Celebration Completion Scorecard */
.quiz-results-card {
  display: none;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  margin-bottom: 40px;
  animation: zoomResults 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomResults {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.results-trophy {
  font-size: 4rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.3));
}

.results-score-box {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 8px;
}

.results-percentage-badge {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}

.badge-uneb-d1 {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
}

.badge-uneb-d2 {
  background: #e0f2fe;
  color: #0369a1;
  border: 1.5px solid #7dd3fc;
}

.badge-uneb-d3 {
  background: #fef3c7;
  color: #b45309;
  border: 1.5px solid #fde68a;
}

.badge-uneb-d4 {
  background: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
}

.results-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 500px;
  margin: 24px auto;
}

@media (max-width: 500px) {
  .results-stat-grid {
    grid-template-columns: 1fr;
  }
}

.results-stat-pill {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.results-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.results-stat-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.save-score-form {
  max-width: 440px;
  margin: 24px auto 30px auto;
  display: flex;
  gap: 8px;
}

.save-score-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
}

.save-score-input:focus {
  border-color: var(--primary);
}

.save-score-btn {
  background: var(--secondary);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.save-score-btn:hover {
  background: var(--secondary-hover);
}

.results-actions-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
