/* ============================================================
   CCA Foundations - Study Companion
   Complete Stylesheet - Dark Theme
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-hover: #1f2b47;
  --accent: #e94560;
  --accent-light: #ff6b81;
  --accent-dark: #c5283d;
  --text-primary: #f8f8f2;
  --text-secondary: #b8b8cc;
  --text-muted: #6c6c80;
  --success: #50fa7b;
  --success-dark: #2d8f47;
  --warning: #f1fa8c;
  --warning-dark: #b3b830;
  --error: #ff5555;
  --info: #8be9fd;
  --purple: #bd93f9;
  --orange: #ffb86c;
  --cyan: #8be9fd;
  --gradient-accent: linear-gradient(135deg, #e94560, #bd93f9);
  --gradient-bar: linear-gradient(90deg, #e94560, #bd93f9);
  --gradient-success: linear-gradient(90deg, #50fa7b, #8be9fd);
  --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 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(233, 69, 96, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --nav-height: 64px;
  --sidebar-width: 280px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   Navigation
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(233, 69, 96, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.nav-brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.nav-brand-text .brand-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  line-height: 1;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.nav-link svg,
.nav-link .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  padding: 4px;
  cursor: pointer;
}

/* ---- Main Content ---- */
.main-content {
  padding-top: calc(var(--nav-height) + 24px);
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 48px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.card-flat {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 24px;
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.card-grid {
  display: grid;
  gap: 20px;
}

.card-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

.btn-outline:hover {
  background: rgba(233, 69, 96, 0.1);
}

.btn-success {
  background: var(--success-dark);
  color: #fff;
}

.btn-success:hover {
  background: var(--success);
  color: #000;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

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

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

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   Circular Progress Indicator
   ============================================================ */
.progress-circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-circle svg {
  transform: rotate(-90deg);
}

.progress-circle .track {
  fill: none;
  stroke: var(--bg-tertiary);
}

.progress-circle .fill {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.progress-circle .progress-value {
  position: absolute;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
}

.progress-circle .progress-value .pct {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}

.progress-circle-sm .progress-value {
  font-size: 1rem;
}

/* ============================================================
   Progress Bars
   ============================================================ */
.progress-bar-wrapper {
  width: 100%;
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.progress-bar-label .label-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-bar-label .label-value {
  color: var(--text-muted);
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-bar);
  border-radius: 4px;
  transition: width 0.8s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

.progress-bar-lg {
  height: 12px;
}

.progress-bar-success .progress-bar-fill {
  background: var(--gradient-success);
}

/* Domain-specific colors */
.domain-1 .progress-bar-fill { background: linear-gradient(90deg, #e94560, #ff6b81); }
.domain-2 .progress-bar-fill { background: linear-gradient(90deg, #bd93f9, #d4b8ff); }
.domain-3 .progress-bar-fill { background: linear-gradient(90deg, #8be9fd, #b5f0ff); }
.domain-4 .progress-bar-fill { background: linear-gradient(90deg, #ffb86c, #ffd4a3); }
.domain-5 .progress-bar-fill { background: linear-gradient(90deg, #50fa7b, #8cffa5); }

/* ============================================================
   Landing / Dashboard - Hero Section
   ============================================================ */
.hero-section {
  text-align: center;
  padding: 40px 0 32px;
}

.hero-section h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-section .hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 32px;
}

.dashboard-top {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.overall-progress-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
}

.overall-progress-card .progress-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.domain-scores-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.domain-scores-card .card-title {
  margin-bottom: 4px;
}

.domain-scores-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---- Quick Nav Grid ---- */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.quick-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
}

.quick-nav-item .nav-item-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(233, 69, 96, 0.15);
  color: var(--accent);
  transition: all var(--transition-normal);
}

.quick-nav-item:hover .nav-item-icon {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.quick-nav-item .nav-item-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.quick-nav-item .nav-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Recent Activity ---- */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: background var(--transition-fast);
}

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

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.activity-icon.quiz { background: rgba(189, 147, 249, 0.2); color: var(--purple); }
.activity-icon.exam { background: rgba(233, 69, 96, 0.2); color: var(--accent); }
.activity-icon.badge { background: rgba(80, 250, 123, 0.2); color: var(--success); }
.activity-icon.lecture { background: rgba(139, 233, 253, 0.2); color: var(--cyan); }

.activity-text {
  flex: 1;
  color: var(--text-secondary);
}

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

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================
   Detailed Dashboard - Radar Chart
   ============================================================ */
.radar-chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.radar-chart-container canvas {
  max-width: 100%;
  height: auto;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  text-align: center;
  padding: 20px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Score History ---- */
.score-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.score-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.score-history-item .score-name {
  color: var(--text-secondary);
  flex: 1;
}

.score-history-item .score-value {
  font-weight: 700;
  margin-left: 16px;
}

.score-history-item .score-value.pass { color: var(--success); }
.score-history-item .score-value.fail { color: var(--error); }

.score-history-item .score-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 16px;
}

/* ---- Study Time Tracker ---- */
.time-tracker {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
}

.time-display {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.time-display .time-unit {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ---- Recommended Action ---- */
.recommended-action {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(233, 69, 96, 0.08);
  border: 1px solid rgba(233, 69, 96, 0.2);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.recommended-action .action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.recommended-action .action-content h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.recommended-action .action-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Lecture Tracking ---- */
.section-tracker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.section-item .section-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.section-item .section-number.completed {
  background: var(--success-dark);
  color: #fff;
}

.section-item .section-name {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.section-item .section-progress {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================================
   Badge Gallery
   ============================================================ */
.badge-tier-section {
  margin-bottom: 32px;
}

.badge-tier-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-tier-header h2 {
  font-size: 1.2rem;
}

.badge-tier-header .tier-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 10px;
  border-radius: 12px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

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

.badge-icon-wrapper {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  transition: all var(--transition-normal);
}

/* Badge unlocked state */
.badge-card.unlocked .badge-icon-wrapper {
  background: rgba(233, 69, 96, 0.15);
  border: 2px solid var(--accent);
}

.badge-card.unlocked:hover .badge-icon-wrapper {
  box-shadow: 0 0 24px rgba(233, 69, 96, 0.4);
}

.badge-card.unlocked .badge-icon-wrapper::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: badge-pulse 2s ease-in-out infinite;
}

/* Badge locked state */
.badge-card.locked .badge-icon-wrapper {
  background: var(--bg-tertiary);
  border: 2px solid rgba(255, 255, 255, 0.08);
  filter: grayscale(100%);
  opacity: 0.5;
}

.badge-card.locked .badge-icon-wrapper .lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 26, 0.6);
  border-radius: 50%;
  font-size: 1.2rem;
}

.badge-card .badge-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.3;
}

.badge-card.locked .badge-name {
  color: var(--text-muted);
}

.badge-card .badge-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Badge shimmer effect on unlock */
.badge-card.just-unlocked .badge-icon-wrapper::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    var(--accent) 10%,
    transparent 20%
  );
  animation: badge-shimmer 1.5s linear infinite;
  z-index: -1;
}

/* Tier-specific accent colors */
.tier-explorer .badge-card.unlocked .badge-icon-wrapper {
  border-color: var(--cyan);
  background: rgba(139, 233, 253, 0.1);
}

.tier-practitioner .badge-card.unlocked .badge-icon-wrapper {
  border-color: var(--purple);
  background: rgba(189, 147, 249, 0.1);
}

.tier-master .badge-card.unlocked .badge-icon-wrapper {
  border-color: var(--orange);
  background: rgba(255, 184, 108, 0.1);
}

.tier-specialist .badge-card.unlocked .badge-icon-wrapper {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.tier-special .badge-card.unlocked .badge-icon-wrapper {
  border-color: var(--success);
  background: rgba(80, 250, 123, 0.1);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
  position: relative;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--error);
  color: #fff;
}

.modal-badge-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: rgba(233, 69, 96, 0.15);
  border: 3px solid var(--accent);
}

.modal h2 {
  text-align: center;
  margin-bottom: 8px;
}

.modal .modal-description {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.modal .modal-detail {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}

.modal .modal-detail .detail-label {
  color: var(--text-muted);
}

.modal .modal-detail .detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================
   Quiz Interface
   ============================================================ */
.quiz-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 48px 0;
}

.quiz-selector h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.quiz-selector p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.domain-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 800px;
}

.domain-select-card {
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
}

.domain-select-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.domain-select-card.selected {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.domain-select-card .domain-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.domain-select-card .domain-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.domain-select-card .domain-weight {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Quiz Question Display ---- */
.quiz-container {
  max-width: 760px;
  margin: 0 auto;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.quiz-progress .progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 90px;
}

.quiz-progress .progress-bar {
  flex: 1;
}

.question-card {
  margin-bottom: 24px;
}

.question-number {
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 12px;
}

.question-text {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* ---- Quiz Option Cards ---- */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
  line-height: 1.5;
}

.option-card:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.1);
}

.option-card .option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.option-card:hover .option-letter {
  color: var(--text-primary);
}

.option-card .option-text {
  flex: 1;
  color: var(--text-secondary);
  padding-top: 4px;
}

/* Option states */
.option-card.selected {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.option-card.selected .option-letter {
  background: var(--accent);
  color: #fff;
}

.option-card.correct {
  border-color: var(--success);
  background: rgba(80, 250, 123, 0.08);
}

.option-card.correct .option-letter {
  background: var(--success);
  color: #000;
}

.option-card.correct .option-text {
  color: var(--success);
}

.option-card.incorrect {
  border-color: var(--error);
  background: rgba(255, 85, 85, 0.08);
}

.option-card.incorrect .option-letter {
  background: var(--error);
  color: #fff;
}

.option-card.incorrect .option-text {
  color: var(--error);
}

.option-card.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ---- Explanation Box ---- */
.explanation-box {
  margin-top: 20px;
  padding: 20px;
  background: rgba(139, 233, 253, 0.05);
  border: 1px solid rgba(139, 233, 253, 0.15);
  border-radius: var(--radius-md);
  display: none;
}

.explanation-box.visible {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

.explanation-box .explanation-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--info);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

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

/* ---- Quiz Navigation Buttons ---- */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

/* ---- Quiz Results ---- */
.quiz-results {
  text-align: center;
  padding: 32px 0;
}

.quiz-results .result-score {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.quiz-results .result-score.pass {
  color: var(--success);
}

.quiz-results .result-score.fail {
  color: var(--error);
}

.quiz-results .result-label {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.domain-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
}

/* ============================================================
   Exam Simulator
   ============================================================ */
.exam-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 48px 0;
}

.exam-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 960px;
}

.exam-select-card {
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
  text-align: center;
}

.exam-select-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.exam-select-card.selected {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.exam-select-card .exam-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.exam-select-card .exam-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.exam-select-card .exam-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Exam Start Screen ---- */
.exam-start-screen {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 32px 0;
}

.exam-start-screen h2 {
  margin-bottom: 16px;
}

.exam-instructions {
  text-align: left;
  margin-bottom: 24px;
}

.exam-instructions li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.exam-instructions li::before {
  content: '\2022';
  color: var(--accent);
  font-weight: bold;
  flex-shrink: 0;
}

.timer-setting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}

.timer-setting label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.timer-setting select,
.timer-setting input {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
}

.timer-setting select:focus,
.timer-setting input:focus {
  border-color: var(--accent);
  outline: none;
}

/* ---- Exam Layout ---- */
.exam-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 24px;
  align-items: start;
}

.exam-main {
  min-width: 0;
}

/* ---- Exam Timer ---- */
.exam-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.exam-timer .timer-icon {
  font-size: 1.1rem;
}

.exam-timer.warning {
  border-color: rgba(241, 250, 140, 0.3);
  color: var(--warning);
}

.exam-timer.danger {
  border-color: rgba(255, 85, 85, 0.3);
  color: var(--error);
  animation: timer-pulse 1s ease-in-out infinite;
}

/* ---- Question Navigation Sidebar ---- */
.exam-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.question-nav-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.question-nav-btn {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.question-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.question-nav-btn.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.question-nav-btn.answered {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.1);
}

.question-nav-btn.flagged {
  position: relative;
}

.question-nav-btn.flagged::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
}

/* ---- Flag Button ---- */
.btn-flag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  width: 100%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 12px;
  transition: all var(--transition-fast);
}

.btn-flag:hover {
  background: var(--bg-hover);
}

.btn-flag.flagged {
  background: rgba(241, 250, 140, 0.1);
  border-color: rgba(241, 250, 140, 0.3);
  color: var(--warning);
}

/* ---- Exam Submit ---- */
.exam-submit-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.exam-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.exam-stats .stat-row {
  display: flex;
  justify-content: space-between;
}

.exam-stats .stat-row span:last-child {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---- Exam Results ---- */
.exam-results {
  text-align: center;
  padding: 40px 0;
  max-width: 700px;
  margin: 0 auto;
}

.exam-score-display {
  margin-bottom: 24px;
}

.exam-score-value {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.exam-score-value.pass { color: var(--success); }
.exam-score-value.fail { color: var(--error); }

.exam-score-range {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.exam-pass-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.exam-pass-badge.pass {
  background: rgba(80, 250, 123, 0.15);
  color: var(--success);
  border: 1px solid rgba(80, 250, 123, 0.3);
}

.exam-pass-badge.fail {
  background: rgba(255, 85, 85, 0.15);
  color: var(--error);
  border: 1px solid rgba(255, 85, 85, 0.3);
}

.exam-domain-breakdown {
  text-align: left;
  margin-top: 32px;
}

.exam-domain-breakdown h3 {
  margin-bottom: 16px;
}

/* ---- Confirm Dialog ---- */
.confirm-dialog {
  text-align: center;
}

.confirm-dialog h2 {
  margin-bottom: 12px;
}

.confirm-dialog p {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.confirm-dialog .warning-text {
  color: var(--warning);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.confirm-dialog .btn-group {
  justify-content: center;
}

/* ============================================================
   Study Plan
   ============================================================ */
.plan-setup {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 0;
}

.plan-setup h2 {
  text-align: center;
  margin-bottom: 24px;
}

.plan-form-group {
  margin-bottom: 24px;
}

.plan-form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.timeline-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.timeline-option {
  padding: 16px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.timeline-option:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.timeline-option.selected {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.timeline-option .timeline-weeks {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.timeline-option .timeline-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.domain-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.domain-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.domain-checkbox:hover {
  background: var(--bg-hover);
}

.domain-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: var(--bg-secondary);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.domain-checkbox input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.domain-checkbox input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
}

.domain-checkbox .checkbox-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auto-detect-btn {
  margin-top: 8px;
  font-size: 0.8rem;
}

/* ---- Generated Study Plan ---- */
.study-plan-display {
  max-width: 800px;
  margin: 0 auto;
}

.plan-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.plan-header h2 {
  margin-bottom: 4px;
}

.plan-header .plan-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.week-card {
  margin-bottom: 20px;
}

.week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.week-header h3 {
  font-size: 1.1rem;
}

.week-header .week-theme {
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
}

.week-activities {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-activity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.week-activity .activity-type {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  min-width: 64px;
  text-align: center;
}

.week-activity .activity-type.lecture {
  background: rgba(139, 233, 253, 0.15);
  color: var(--cyan);
}

.week-activity .activity-type.quiz {
  background: rgba(189, 147, 249, 0.15);
  color: var(--purple);
}

.week-activity .activity-type.lab {
  background: rgba(255, 184, 108, 0.15);
  color: var(--orange);
}

.week-activity .activity-type.exam {
  background: rgba(233, 69, 96, 0.15);
  color: var(--accent);
}

.week-activity .activity-type.review {
  background: rgba(80, 250, 123, 0.15);
  color: var(--success);
}

.week-activity .activity-name {
  flex: 1;
  color: var(--text-secondary);
}

.week-activity .activity-duration {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ============================================================
   Form Elements
   ============================================================ */
select,
input[type="text"],
input[type="number"],
input[type="email"],
textarea {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
  transition: border-color var(--transition-fast);
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c6c80' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes badge-pulse {
  0%, 100% {
    border-color: transparent;
    transform: scale(1);
  }
  50% {
    border-color: rgba(233, 69, 96, 0.4);
    transform: scale(1.05);
  }
}

@keyframes badge-shimmer {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in {
  animation: fadeSlideIn 0.4s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease forwards;
}

/* ============================================================
   Page-specific: Empty / Loading States
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 400px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.page-header .page-description {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================================
   Tabs
   ============================================================ */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

/* ============================================================
   Sidebar Legend (for exam)
   ============================================================ */
.sidebar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

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

.legend-dot.current { background: var(--accent); }
.legend-dot.answered { background: var(--bg-hover); border: 1px solid rgba(255,255,255,0.1); }
.legend-dot.flagged { background: var(--bg-tertiary); position: relative; }
.legend-dot.flagged::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--warning);
}
.legend-dot.unanswered { background: var(--bg-tertiary); }

/* ============================================================
   Flashcards
   ============================================================ */

/* Domain selector (reuses quiz selector pattern) */
.fc-domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.fc-domain-card {
  cursor: pointer;
  text-align: center;
  padding: 20px 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  border: 2px solid transparent;
}

.fc-domain-card:hover {
  border-color: rgba(233, 69, 96, 0.3);
}

.fc-domain-card.selected {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.fc-domain-number {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.fc-domain-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

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

/* Options row */
.fc-options {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.fc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.fc-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

/* Download section */
.fc-download-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.fc-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.fc-download-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: background var(--transition-fast);
}

.fc-download-link:hover {
  background: var(--bg-hover);
}

.fc-download-icon {
  font-size: 1.2rem;
}

/* Flashcard study area */
.fc-study {
  max-width: 640px;
  margin: 0 auto;
}

.fc-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.fc-progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.fc-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.fc-progress-fill {
  height: 100%;
  background: var(--gradient-bar);
  border-radius: 3px;
  transition: width var(--transition-normal);
}

/* 3D flip card */
.fc-card-container {
  perspective: 1000px;
  margin-bottom: 24px;
  cursor: pointer;
}

.fc-card-inner {
  position: relative;
  min-height: 260px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.fc-card-inner.flipped {
  transform: rotateY(180deg);
}

.fc-card-front,
.fc-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.fc-card-front {
  z-index: 2;
}

.fc-card-back {
  transform: rotateY(180deg);
  background: var(--bg-tertiary);
}

.fc-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}

.fc-card-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.fc-flip-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* Assessment buttons */
.fc-assess {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.fc-assess .btn {
  flex: 1;
  max-width: 200px;
}

.btn-got-it {
  background: var(--success-dark);
  color: #fff;
  border: none;
}

.btn-got-it:hover {
  background: var(--success);
  color: #000;
}

.btn-learning {
  background: var(--bg-tertiary);
  color: var(--warning);
  border: 1px solid var(--warning-dark);
}

.btn-learning:hover {
  background: var(--warning-dark);
  color: #fff;
}

.fc-keyboard-hint {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.fc-keyboard-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Results phase */
.fc-results {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.fc-results h2 {
  font-size: 1.6rem;
  margin-bottom: 24px;
}

.fc-stats-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.fc-stat {
  text-align: center;
}

.fc-stat-value {
  font-size: 2rem;
  font-weight: 800;
}

.fc-stat-value.got-it { color: var(--success); }
.fc-stat-value.learning { color: var(--warning); }
.fc-stat-value.total { color: var(--text-secondary); }

.fc-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.fc-mastery-bar {
  margin: 0 auto 32px;
  max-width: 400px;
}

.fc-mastery-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.fc-mastery-track {
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: 5px;
  overflow: hidden;
}

.fc-mastery-fill {
  height: 100%;
  background: var(--gradient-success);
  border-radius: 5px;
  transition: width var(--transition-slow);
}

/* Missed cards list */
.fc-missed-section {
  text-align: left;
  margin-top: 32px;
}

.fc-missed-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.fc-missed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fc-missed-item {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
}

.fc-missed-q {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.fc-missed-a {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ============================================================
   Responsive Design
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .exam-layout {
    grid-template-columns: 1fr 220px;
  }

  .question-nav-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .main-content {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: calc(var(--nav-height) + 16px);
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .hero-section h1 { font-size: 1.6rem; }

  /* Navbar mobile */
  .nav-hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    width: 100%;
    padding: 12px 16px;
  }

  /* Dashboard mobile */
  .dashboard-top {
    grid-template-columns: 1fr;
  }

  .overall-progress-card {
    flex-direction: row;
    padding: 20px;
  }

  .quick-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Cards mobile */
  .card-grid-2,
  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 16px;
  }

  /* Exam mobile */
  .exam-layout {
    grid-template-columns: 1fr;
  }

  .exam-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    z-index: 500;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
  }

  .exam-sidebar.open {
    transform: translateY(0);
  }

  .exam-main {
    padding-bottom: 80px;
  }

  .question-nav-grid {
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
  }

  /* Flashcard mobile */
  .fc-domain-grid {
    grid-template-columns: 1fr;
  }

  .fc-card-inner {
    min-height: 220px;
  }

  .fc-stats-row {
    gap: 20px;
  }

  .fc-download-grid {
    grid-template-columns: 1fr;
  }

  /* Stats mobile */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Badge grid mobile */
  .badge-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  .badge-card {
    padding: 14px 8px;
  }

  .badge-icon-wrapper {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  /* Timeline options mobile */
  .timeline-options {
    grid-template-columns: 1fr;
  }

  /* Quiz domain select mobile */
  .domain-select-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Exam select mobile */
  .exam-select-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Modal mobile */
  .modal {
    padding: 24px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Time tracker mobile */
  .time-tracker {
    flex-direction: column;
    text-align: center;
  }

  /* Recommended action mobile */
  .recommended-action {
    flex-direction: column;
    text-align: center;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 1.3rem;
  }

  .nav-brand-text .brand-sub {
    display: none;
  }

  .quick-nav {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .quick-nav-item {
    padding: 16px 8px;
  }

  .quick-nav-item .nav-item-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .quiz-progress {
    flex-direction: column;
    align-items: stretch;
  }

  .domain-select-grid {
    grid-template-columns: 1fr;
  }

  .exam-select-grid {
    grid-template-columns: 1fr;
  }

  .exam-score-value {
    font-size: 3.5rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
  .navbar,
  .nav-hamburger,
  .btn,
  .modal-overlay {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card, .card-flat {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: none;
  }

  .main-content {
    padding-top: 0;
  }
}
