/* Gathaway SAT Styles - Digital SAT Bluebook Inspired */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(37, 99, 235, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font-serif: "Georgia", "Cambria", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --surface-3: #334155;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-border: rgba(59, 130, 246, 0.35);
  --accent: #6366f1;
  --accent-light: rgba(99, 102, 241, 0.15);
  --text: #f8fafc;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --border: #334155;
  --border-light: #1e293b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Topbar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.brand-icon {
  font-size: 26px;
  line-height: 1;
}
.brand-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
}
.nav-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.nav-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Card & Sections */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.card-header {
  margin-bottom: 18px;
}
.card-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text);
}
.card-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Hero Section */
.hero-box {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-content {
  max-width: 680px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-title {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.25;
  margin: 0 0 10px;
}
.hero-desc {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.92;
  margin: 0 0 18px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--surface-2);
}
.btn-white {
  background: #ffffff;
  color: #1e3a8a;
}
.btn-white:hover {
  background: #f1f5f9;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius);
}

/* Grid Layouts */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.sat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}
.sat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.sat-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-indigo { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-amber { background: var(--warning-light); color: var(--warning); }
.sat-card-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text);
}
.sat-card-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 18px;
  flex-grow: 1;
}

/* ===================================================
   DIGITAL SAT BLUEBOOK EXAM WORKSPACE
   =================================================== */
.sat-exam-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
}
.sat-exam-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sat-exam-title-badge {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sat-timer-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: monospace;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}
.sat-timer-toggle {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.sat-exam-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sat-tool-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.sat-tool-btn:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}
.sat-tool-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Split Workspace */
.sat-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex-grow: 1;
  min-height: 480px;
}
@media (max-width: 900px) {
  .sat-workspace {
    grid-template-columns: 1fr;
  }
}
.sat-passage-pane {
  padding: 32px 36px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  font-family: var(--font-serif);
  background: var(--surface);
}
@media (max-width: 900px) {
  .sat-passage-pane {
    border-right: none;
    border-bottom: 2px solid var(--border);
    padding: 24px 20px;
  }
}
.sat-passage-text {
  white-space: pre-line;
  max-width: 580px;
}
.sat-passage-text mark, .sat-highlight {
  background: #fef08a;
  color: #000000;
  padding: 2px 4px;
  border-radius: 3px;
}
:root[data-theme="dark"] .sat-passage-text mark, :root[data-theme="dark"] .sat-highlight {
  background: #854d0e;
  color: #fef08a;
}

/* Question Pane */
.sat-question-pane {
  padding: 32px 36px;
  background: var(--surface);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
@media (max-width: 900px) {
  .sat-question-pane {
    padding: 24px 20px;
  }
}
.sat-q-number-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sat-q-badge {
  background: var(--text);
  color: var(--surface);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.sat-mark-review-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.sat-mark-review-box input {
  cursor: pointer;
}
.sat-q-stem {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 24px;
  font-family: var(--font-sans);
}

/* Choices */
.sat-choices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.sat-choice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.sat-choice-item:hover:not(.eliminated) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.sat-choice-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary);
}
.sat-choice-item.eliminated {
  opacity: 0.45;
  background: var(--surface-2);
  text-decoration: line-through;
}
.sat-choice-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
}
.sat-choice-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-2);
  flex-shrink: 0;
  background: var(--surface);
}
.sat-choice-item.selected .sat-choice-letter {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.sat-choice-text {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
}
.sat-eliminator-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.sat-eliminator-btn:hover {
  background: var(--surface-3);
  color: var(--danger);
  border-color: var(--border);
}
.sat-choice-item.eliminated .sat-eliminator-btn {
  color: var(--danger);
}

/* Bottom Bar */
.sat-bottom-bar {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.sat-nav-btn-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sat-grid-nav-trigger {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sat-grid-nav-trigger:hover {
  background: var(--surface-3);
}

/* Modal Navigator */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
}
.q-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.q-grid-item {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}
.q-grid-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.q-grid-item.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}
.q-grid-item.answered {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}
.q-grid-item.marked::after {
  content: "🔖";
  font-size: 10px;
  position: absolute;
  top: -4px;
  right: -4px;
}

/* Results & Review */
.score-badge-large {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  padding: 24px 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}
.score-number {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
}
.score-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-top: 6px;
}
.domain-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13.5px;
}
.progress-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Tables */
.sat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.sat-table th, .sat-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}
.sat-table th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text-2);
}
.sat-table tr:hover td {
  background: var(--surface-2);
}

/* Explanations Card */
.expl-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
}
.expl-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.expl-evidence {
  background: #fef9c3;
  color: #713f12;
  border-left: 3px solid #eab308;
  padding: 8px 12px;
  border-radius: 4px;
  margin: 8px 0;
  font-family: var(--font-serif);
  font-size: 14px;
}
:root[data-theme="dark"] .expl-evidence {
  background: #713f12;
  color: #fef9c3;
}
.distractor-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  margin: 2px 4px 2px 0;
  background: var(--surface-3);
  color: var(--text);
}
