/* ==========================================================================
   GST 201: General African Studies Interactive Prep Platform
   Design System & Aesthetics: Modern Academic Portal
   ========================================================================== */

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Dark Theme (Default) */
  --bg-main: #0a0e17;
  --bg-surface: #111827;
  --bg-card: rgba(19, 26, 43, 0.78);
  --bg-card-hover: rgba(27, 37, 61, 0.9);
  --bg-input: #1a2234;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #f59e0b;
  
  --text-primary: #f9fafb;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Accents & Brand Colors */
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);
  
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.2);
  
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 30px -5px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.18);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-input: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-focus: #d97706;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 20px rgba(217, 119, 6, 0.15);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Atmosphere Gradients */
body::before {
  content: '';
  position: fixed;
  top: -15vw;
  right: -10vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -15vw;
  left: -10vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* Top Announcement Banner */
.exam-alert-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.exam-alert-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pulse-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.exam-alert-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-gold-light);
  letter-spacing: 0.02em;
}

.exam-countdown-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* Header & Brand */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.portal-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.portal-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .portal-title {
  background: linear-gradient(135deg, #0f172a 40%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  outline: none;
  user-select: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #0b0f19;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-ghost {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Global Readiness Widget */
.readiness-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.readiness-gauge {
  position: relative;
  width: 44px;
  height: 44px;
}

.readiness-gauge svg {
  transform: rotate(-90deg);
}

.readiness-gauge circle {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.gauge-bg {
  stroke: var(--border-subtle);
}

.gauge-fill {
  stroke: var(--accent-emerald);
  transition: stroke-dashoffset 0.8s ease;
}

.gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.readiness-info {
  display: flex;
  flex-direction: column;
}

.readiness-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.readiness-status {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

/* Tab Navigation Bar */
.nav-tabs-wrapper {
  position: sticky;
  top: 1rem;
  z-index: 50;
  margin-bottom: 2rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem;
  background: rgba(17, 24, 39, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  scrollbar-width: none;
}

[data-theme="light"] .nav-tabs {
  background: rgba(255, 255, 255, 0.9);
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: var(--accent-gold);
  color: #0b0f19;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.tab-badge {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.15);
}

.nav-tab-btn.active .tab-badge {
  background: rgba(0, 0, 0, 0.2);
  color: #000;
}

/* Views Container */
.view-container {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-container.active {
  display: block;
}

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

/* ==========================================================================
   DASHBOARD VIEW
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.3);
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.stat-icon.gold { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Quick Action Banners */
.dashboard-hero-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.hero-text h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.hero-text p {
  color: var(--text-secondary);
  max-width: 620px;
  font-size: 0.95rem;
}

.hero-cta-group {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Module Hub Grid */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-heading h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: var(--shadow-lg);
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-emerald));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.module-card:hover::before {
  opacity: 1;
}

.module-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.module-badge {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.module-question-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.module-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.module-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.module-footer-actions {
  display: flex;
  gap: 0.5rem;
}

.module-footer-actions .btn {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.5rem;
}

/* ==========================================================================
   SUMMARIES ACCORDION VIEW
   ========================================================================== */
.summaries-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.summary-accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  transition: border-color var(--transition-fast);
}

.summary-accordion-item.open {
  border-color: rgba(245, 158, 11, 0.4);
}

.accordion-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: transparent;
  transition: background var(--transition-fast);
}

.accordion-header:hover {
  background: var(--bg-card-hover);
}

.accordion-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.session-badge {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.accordion-title-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.accordion-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
}

.summary-accordion-item.open .accordion-icon {
  transform: rotate(180deg);
  color: var(--accent-gold);
}

.accordion-body {
  display: none;
  padding: 0 1.5rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  animation: slideDown 0.3s ease;
}

.summary-accordion-item.open .accordion-body {
  display: block;
}

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

/* Scholar Pill Cloud */
.scholars-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.25rem 0;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.scholar-chip {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #93c5fd;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.scholar-chip strong {
  color: #bfdbfe;
}

/* Exam Trap Alert Callout */
.exam-trap-box {
  background: rgba(244, 63, 94, 0.08);
  border-left: 4px solid var(--accent-rose);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.exam-trap-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-rose);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.exam-trap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* Markdown Notes Rendering */
.summary-prose {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.summary-prose h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.summary-prose ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.summary-prose li {
  margin-bottom: 0.4rem;
}

.summary-prose strong {
  color: var(--text-primary);
}

/* In-Text Q&A Drawer */
.itq-section {
  margin-top: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.itq-header {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-gold-light);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.itq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
}

.itq-q {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.itq-a {
  font-size: 0.85rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

/* ==========================================================================
   CBT EXAM SIMULATOR VIEW
   ========================================================================== */
.cbt-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cbt-control-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  backdrop-filter: blur(12px);
}

.cbt-timer-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-gold-light);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
}

.cbt-timer-box.urgent {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent-rose);
  animation: pulse-ring 1s infinite;
}

.cbt-meta-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cbt-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

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

/* Question Area Card */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  position: relative;
}

.question-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.question-number-badge {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.flag-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.flag-btn.flagged {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  font-weight: 700;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 1.75rem;
  color: var(--text-primary);
}

/* Options Stack */
.options-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.option-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateX(3px);
}

.option-item.selected {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.option-key {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.option-item.selected .option-key {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
}

.option-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.45;
}

/* Review Mode States */
.option-item.correct {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: var(--accent-emerald) !important;
}

.option-item.correct .option-key {
  background: var(--accent-emerald) !important;
  color: #fff !important;
}

.option-item.incorrect {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: var(--accent-rose) !important;
}

.option-item.incorrect .option-key {
  background: var(--accent-rose) !important;
  color: #fff !important;
}

.explanation-card {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--accent-blue);
  font-size: 0.9rem;
  line-height: 1.6;
}

.explanation-card strong {
  color: var(--accent-blue);
  display: block;
  margin-bottom: 0.35rem;
}

/* Navigation Buttons */
.cbt-nav-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Question Palette Sidebar */
.palette-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 6.5rem;
}

.palette-header {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.25rem;
  margin-bottom: 1.25rem;
}

.palette-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.palette-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.palette-btn.current {
  border-color: var(--accent-gold);
  color: var(--accent-gold-light);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.palette-btn.answered {
  background: var(--accent-emerald);
  color: #fff;
  border-color: var(--accent-emerald);
}

.palette-btn.flagged {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
}

.palette-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-dot.ans { background: var(--accent-emerald); }
.legend-dot.flag { background: var(--accent-purple); }
.legend-dot.unans { background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.legend-dot.curr { border: 1.5px solid var(--accent-gold); }

/* Score Result Modal / Card */
.score-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.score-badge-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
}

.score-percentage {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent-gold-light);
}

.score-grade {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.score-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.score-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.score-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   FLASHCARDS VIEW (3D FLIP)
   ========================================================================== */
.flashcards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  max-width: 720px;
  margin: 0 auto;
}

.flashcard-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 1rem;
}

.custom-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.card-scene {
  width: 100%;
  height: 380px;
  perspective: 1200px;
}

.flashcard-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

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

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
}

.card-front {
  background: linear-gradient(135deg, rgba(22, 30, 49, 0.95), rgba(15, 23, 42, 0.95));
  border-color: rgba(245, 158, 11, 0.25);
}

.card-back {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.95));
  border-color: rgba(16, 185, 129, 0.35);
  transform: rotateY(180deg);
}

.card-topic-tag {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-center-text {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  margin: auto 0;
}

.card-back .card-center-text {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  text-align: left;
  line-height: 1.65;
  white-space: pre-line;
}

.card-hint-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.flashcard-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.mastery-btn-group {
  display: flex;
  gap: 0.75rem;
}

/* ==========================================================================
   FILL IN THE BLANKS VIEW
   ========================================================================== */
.fitb-container {
  max-width: 740px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.fitb-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.fitb-prompt {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.fitb-blank {
  display: inline-block;
  min-width: 160px;
  border-bottom: 2.5px dashed var(--accent-gold);
  color: var(--accent-gold-light);
  font-weight: 700;
  text-align: center;
  padding: 0 0.5rem;
}

.fitb-input-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.fitb-input {
  flex: 1;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.fitb-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}

.fitb-feedback {
  display: none;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.25s ease;
}

.fitb-feedback.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  color: #6ee7b7;
}

.fitb-feedback.error {
  display: block;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid var(--accent-rose);
  color: #fca5a5;
}

/* ==========================================================================
   GLOSSARY / KEY CONCEPTS VIEW
   ========================================================================== */
.glossary-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.glossary-search-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
}

.category-filter-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.category-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.category-chip.active {
  background: var(--accent-gold);
  color: #0b0f19;
  border-color: var(--accent-gold);
  font-weight: 700;
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.term-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.term-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: var(--shadow-md);
}

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

.term-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.term-cat-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
}

.term-def {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   ESSAY PREPARATION VIEW
   ========================================================================== */
.essay-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.essay-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.essay-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.essay-badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-purple);
}

.essay-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.essay-prompt-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-primary);
}

.essay-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rubric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.rubric-table th {
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-heading);
  font-weight: 700;
}

/* ==========================================================================
   RAPID NIGHT-BEFORE CHEAT SHEET
   ========================================================================== */
.cheatsheet-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.table-responsive {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-gold-light);
  white-space: nowrap;
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Confetti Canvas */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ==========================================================================
   PRINT STYLES FOR HIGH-YIELD CHEAT SHEET & SUMMARIES
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }
  
  .exam-alert-bar, .header-controls, .nav-tabs-wrapper, .cbt-control-bar, .btn, #confettiCanvas {
    display: none !important;
  }
  
  .app-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  .view-container {
    display: block !important;
  }
  
  .stat-card, .module-card, .summary-accordion-item, .term-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 1rem !important;
  }
  
  .accordion-body {
    display: block !important;
  }
}
