/* ==========================================================================
   TOP TUTOR - Digital SAT Pretest (Bluebook Style UI) Stylesheet
   ========================================================================== */

:root {
  --cb-navy: #0e223d;
  --cb-navy-dark: #071526;
  --cb-blue: #1e60c6;
  --cb-blue-hover: #154ca3;
  --cb-border: #cbd5e1;
  --cb-bg-light: #f8fafc;
  --cb-text: #0f172a;
  --cb-text-muted: #64748b;
  --cb-accent-yellow: #f59e0b;
}

body {
  font-family: 'Plus Jakarta Sans', 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: text;
  background-color: #f1f5f9;
  color: var(--cb-text);
  overflow-x: hidden;
}

/* KaTeX custom sizing for SAT math formulas */
.katex {
  font-size: 1.1em !important;
}

/* ==================== BLUEBOOK TOP HEADER ==================== */
.cb-header {
  background-color: var(--cb-navy);
  color: #ffffff;
  height: 60px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cb-timer-badge {
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 4px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.cb-timer-badge.warning {
  background-color: #dc2626;
  border-color: #ef4444;
  animation: pulse 1.5s infinite;
}

.cb-tool-btn {
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  background: transparent;
  border: 1px solid transparent;
}

.cb-tool-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.cb-tool-btn.active {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ==================== BLUEBOOK QUESTION CANVAS ==================== */
.cb-canvas {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  min-height: calc(100vh - 145px);
}

/* Question Option Row */
.cb-option-row {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  position: relative;
}

.cb-option-row:hover:not(.eliminated) {
  border-color: var(--cb-blue);
  background-color: #f8faff;
}

.cb-option-row.selected {
  border-color: var(--cb-blue);
  background-color: #edf5ff;
  box-shadow: 0 0 0 1px var(--cb-blue);
}

.cb-option-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #475569;
  flex-shrink: 0;
  margin-right: 14px;
  transition: all 0.2s;
}

.cb-option-row.selected .cb-option-circle {
  background-color: var(--cb-blue);
  border-color: var(--cb-blue);
  color: #ffffff;
}

/* Option Eliminator / Strikethrough */
.cb-option-row.eliminated {
  opacity: 0.45;
  background-color: #f1f5f9;
  border-style: dashed;
}

.cb-option-row.eliminated .cb-option-text {
  text-decoration: line-through;
}

.cb-eliminate-btn {
  opacity: 0.3;
  transition: opacity 0.2s;
  padding: 4px;
}

.cb-eliminate-btn:hover {
  opacity: 1;
}

/* SPR Grid-in Input Box */
.cb-spr-input {
  border: 2px solid #94a3b8;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  width: 100%;
  max-width: 280px;
  transition: all 0.2s;
}

.cb-spr-input:focus {
  border-color: var(--cb-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 96, 198, 0.2);
}

/* ==================== BLUEBOOK BOTTOM BAR ==================== */
.cb-footer {
  background-color: var(--cb-navy);
  color: #ffffff;
  height: 65px;
  position: sticky;
  bottom: 0;
  z-index: 40;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.15);
}

.cb-nav-btn {
  background-color: #ffffff;
  color: var(--cb-navy);
  font-weight: 700;
  padding: 8px 24px;
  border-radius: 9999px;
  font-size: 14px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cb-nav-btn:hover {
  background-color: #f1f5f9;
  transform: translateY(-1px);
}

.cb-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.cb-nav-btn.primary {
  background-color: var(--cb-blue);
  color: #ffffff;
}

.cb-nav-btn.primary:hover {
  background-color: var(--cb-blue-hover);
}

/* Question Navigator Dropdown Trigger */
.cb-q-navigator-trigger {
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cb-q-navigator-trigger:hover {
  background-color: rgba(255, 255, 255, 0.22);
}

/* ==================== QUESTION NAVIGATOR GRID MODAL ==================== */
.cb-grid-item {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
  color: #1e293b;
}

.cb-grid-item:hover {
  border-color: var(--cb-blue);
  transform: scale(1.05);
}

.cb-grid-item.current {
  border: 2px solid var(--cb-blue);
  box-shadow: 0 0 0 2px rgba(30, 96, 198, 0.3);
}

.cb-grid-item.answered {
  background-color: var(--cb-navy);
  border-color: var(--cb-navy);
  color: #ffffff;
}

.cb-grid-item.flagged::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 10px 10px 0;
  border-color: transparent var(--cb-accent-yellow) transparent transparent;
}

/* ==================== DESMOS DRAGGABLE MODAL ==================== */
#desmosModal {
  position: fixed;
  top: 75px;
  right: 25px;
  width: 600px;
  height: 520px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  min-width: 360px;
  min-height: 320px;
  max-width: 95vw;
  max-height: 85vh;
}

#desmosModal.hidden {
  display: none !important;
}

#desmosModal.minimized {
  height: 48px !important;
  resize: none;
}

#desmosModal.minimized #desmosBody {
  display: none;
}

.desmos-header {
  background: var(--cb-navy);
  color: #ffffff;
  padding: 10px 14px;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

/* ==================== FORMULA REFERENCE MODAL ==================== */
.ref-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ==================== RESULTS DASHBOARD ==================== */
.score-circle {
  background: radial-gradient(circle, #1e3a8a 0%, #0f172a 100%);
  border: 4px solid #3b82f6;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
}

.domain-bar-bg {
  background-color: #e2e8f0;
  border-radius: 9999px;
  height: 10px;
  overflow: hidden;
}

.domain-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s ease;
}

/* Print optimizations */
@media print {
  .cb-header, .cb-footer, #desmosModal, .no-print {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
}
