:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-100: #e0e7ff;
  --secondary: #0ea5e9;
  --secondary-light: #f0f9ff;
  --accent: #8b5cf6;
  --accent-light: #f5f3ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 1.35rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 500;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.timer-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-100);
  padding: 0.5rem 0.95rem;
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-700);
}

/* Container */
main {
  flex: 1;
  max-width: 1140px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Landing / Mode Selection */
.landing-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.825rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.landing-hero h2 {
  font-size: 2.35rem;
  color: var(--gray-900);
  font-weight: 800;
  margin-bottom: 0.85rem;
}

.landing-hero p {
  color: var(--gray-600);
  font-size: 1.1rem;
  max-width: 780px;
  margin: 0 auto;
}

/* Mode Cards Grid */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.mode-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  border: 2px solid var(--gray-200);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

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

.mode-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, #ffffff, #fcfaff);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
}

.mode-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mode-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

.mode-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.mode-desc {
  font-size: 0.95rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.mode-features {
  list-style: none;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.mode-features li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Spot light dropdown bar */
.spotlight-picker-box {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.select-field {
  flex: 1;
  padding: 0.85rem 1.15rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  background: white;
  font-weight: 600;
  color: var(--gray-800);
}

.select-field:focus {
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-100);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: #059669;
}

/* Quiz Test Runner Layout */
.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.5rem;
  align-items: start;
}

.question-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  position: relative;
}

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

.q-strand {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.q-dimension-badge {
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: var(--gray-100);
  color: var(--gray-700);
}

.dim-D1 { background: #dbeafe; color: #1e40af; } /* Fluency */
.dim-D2 { background: #e0e7ff; color: #3730a3; } /* Modeling */
.dim-D3 { background: #fef3c7; color: #92400e; } /* Distractor */
.dim-D4 { background: #f3e8ff; color: #6b21a8; } /* Reverse */
.dim-D5 { background: #fee2e2; color: #991b1b; } /* Trap */

.q-flag-btn {
  background: transparent;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
}

.q-flag-btn:hover { background: var(--gray-100); }
.q-flag-btn.flagged { color: var(--warning); background: var(--warning-light); }

.q-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  line-height: 1.7;
  word-spacing: 0.05em;
  letter-spacing: normal;
}

.math-block {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-md);
  margin: 1.25rem 0 1.75rem;
  text-align: center;
  font-size: 1.5rem;
  color: var(--gray-900);
  line-height: 1.8;
  overflow-x: auto;
}

.math-block .katex { font-size: 1.65rem !important; }
.option-text .katex { font-size: 1.15rem !important; }

.custom-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.custom-table th, .custom-table td {
  border: 1px solid var(--gray-200);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.95rem;
}

.custom-table th { background: var(--gray-100); font-weight: 700; }

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

.option-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  background: white;
  user-select: none;
}

.option-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary);
}

.option-key {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--gray-100);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-right: 1rem;
  color: var(--gray-700);
  flex-shrink: 0;
}

.option-item.selected .option-key {
  background: var(--primary);
  color: white;
}

.option-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--gray-900);
  line-height: 1.5;
}

.quiz-nav-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--gray-100);
  padding-top: 1.5rem;
}

/* Sidebar Navigator */
.sidebar-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  position: sticky;
  top: 90px;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-bar-container {
  background: var(--gray-100);
  border-radius: 9999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.progress-bar {
  background: var(--primary);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

.grid-btn {
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  background: white;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.grid-btn:hover { border-color: var(--primary); color: var(--primary); }
.grid-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.grid-btn.answered { background: var(--gray-800); color: white; border-color: var(--gray-800); }
.grid-btn.flagged::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  background: var(--warning);
  border-radius: 50%;
}

.legend-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--gray-100);
  padding-top: 1rem;
}

.legend-item { display: flex; align-items: center; gap: 0.5rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }

/* Report Section */
.report-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  margin-bottom: 2.5rem;
}

.report-hero {
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
}

.score-circle {
  width: 145px;
  height: 145px;
  border-radius: 50%;
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), white);
  border: 4px solid var(--primary);
}

.score-number {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.score-total {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-600);
}

.readiness-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.75rem;
}

.badge-excellent { background: var(--success-light); color: #065f46; }
.badge-good { background: #e0f2fe; color: #0369a1; }
.badge-review { background: var(--warning-light); color: #92400e; }
.badge-urgent { background: var(--danger-light); color: #991b1b; }

/* 5-Dimensional Cognitive Skills Grid */
.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.radar-card {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.radar-card:hover {
  border-color: var(--primary);
  background: white;
}

.radar-dim-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.radar-dim-score {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.radar-dim-desc {
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.4;
}

/* 25-Module Content Mastery Grid */
.strands-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.strand-box {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: var(--gray-50);
}

.strand-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.strand-name {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 0.95rem;
}

.strand-pct {
  font-weight: 800;
  font-size: 1.1rem;
}

.review-accordion {
  margin-top: 2rem;
}

.review-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  background: white;
}

.review-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: white;
  transition: background 0.15s;
}

.review-header:hover { background: var(--gray-50); }
.review-header.correct { border-left: 5px solid var(--success); }
.review-header.incorrect { border-left: 5px solid var(--danger); }

.review-body {
  padding: 1.25rem;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  display: none;
}

.review-body.open { display: block; }

.solution-box {
  background: white;
  border: 1px solid var(--gray-200);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.action-plan-box {
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-top: 2.5rem;
}

.action-plan-box h3 {
  color: #1e40af;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recommendation-list {
  padding-left: 1.25rem;
  margin-top: 0.75rem;
}

.recommendation-list li {
  margin-bottom: 0.6rem;
  color: var(--gray-700);
}

.print-hide { display: block; }

@media print {
  header, .print-hide, .btn, .q-flag-btn { display: none !important; }
  body, main { background: white; margin: 0; padding: 0; }
  .report-card { box-shadow: none; border: none; padding: 0; }
  .review-body { display: block !important; }
}

@media (max-width: 760px) {
  .modes-grid { grid-template-columns: 1fr; }
  .quiz-layout { grid-template-columns: 1fr; }
  .sidebar-card { position: static; margin-top: 1.5rem; }
  .question-grid { grid-template-columns: repeat(5, 1fr); }
}

