/**
 * AI Exam Simulator - World-Class Exam Interface
 * Designed with Google/Meta level attention to detail
 */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* Primary Colors - Modern Indigo */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;
  
  /* Accent - Teal */
  --accent-400: #2dd4bf;
  --accent-500: #14b8a6;
  --accent-600: #0d9488;
  
  /* Semantic Colors */
  --success-50: #ecfdf5;
  --success-100: #d1fae5;
  --success-500: #10b981;
  --success-600: #059669;
  
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  
  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  
  /* Neutrals */
  --gray-25: #fcfcfd;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
}

/* ============================================
   BASE & LAYOUT
   ============================================ */
.exam-interface {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  font-family: var(--font-sans);
  color: var(--gray-900);
  display: flex;
  flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */
.exam-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .exam-header {
    padding: 16px 24px;
  }
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
}

.header-left { flex: 1; min-width: 0; }
.header-center { flex: 0 0 auto; }
.header-right { flex: 0 0 auto; }

/* Branding */
.exam-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.exam-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .exam-title {
    font-size: 1.25rem;
  }
}

.exam-subtitle {
  font-size: 0.8rem;
  opacity: 0.85;
  font-weight: 500;
}

/* Auto-save Indicator */
.autosave-indicator {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
}

@media (min-width: 640px) {
  .autosave-indicator {
    display: flex;
  }
}

.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon.hidden { display: none; }

.status-icon.idle { opacity: 0.7; }
.status-icon.saving { color: var(--warning-100); }
.status-icon.saved { color: var(--success-100); }
.status-icon.error { color: var(--error-100); }

.status-icon .spin {
  animation: spin 1s linear infinite;
}

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

.last-saved {
  font-size: 0.65rem;
  opacity: 0.7;
}

/* Timer */
.timer-container {
  position: relative;
}

.timer-ring {
  position: relative;
  width: 70px;
  height: 70px;
}

@media (min-width: 768px) {
  .timer-ring {
    width: 80px;
    height: 80px;
  }
}

.timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 3;
}

.timer-progress {
  fill: none;
  stroke: white;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-progress.warning {
  stroke: var(--warning-400);
}

.timer-progress.danger {
  stroke: var(--error-400);
  animation: pulse-ring 1s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.timer-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-value {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .timer-value {
    font-size: 1.1rem;
  }
}

.timer-label {
  font-size: 0.6rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   SETTINGS BAR
   ============================================ */
.settings-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .settings-bar {
    padding: 12px 24px;
  }
}

.settings-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.setting-item label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gray-500);
  font-weight: 500;
}

.setting-item select {
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: white;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.setting-item select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.progress-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.answered-count {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 500;
}

.mini-progress {
  width: 80px;
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mini-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success-500), var(--accent-500));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ============================================
   QUESTION NAVIGATION
   ============================================ */
.question-nav {
  background: white;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
  .question-nav {
    padding: 16px 24px;
  }
}

.nav-scroll {
  display: flex;
  gap: 8px;
  min-width: min-content;
}

.q-pill {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.q-pill:hover {
  border-color: var(--primary-400);
  color: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.q-pill.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.q-pill.answered {
  background: var(--success-50);
  border-color: var(--success-500);
  color: var(--success-700);
}

.q-pill.answered.active {
  background: var(--success-500);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.pill-num {
  display: block;
}

.pill-check {
  display: none;
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--success-500);
  border-radius: var(--radius-full);
  align-items: center;
  justify-content: center;
  color: white;
  border: 2px solid white;
}

.q-pill.answered .pill-check {
  display: flex;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.exam-main {
  flex: 1;
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .exam-main {
    padding: 24px;
  }
}

.questions-container {
  position: relative;
}

/* Question Card */
.question-card {
  display: none;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideIn var(--transition-slow) ease-out;
}

.question-card.active {
  display: block;
}

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

.card-header {
  padding: 16px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.q-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  background: var(--primary-600);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
}

.q-marks {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gray-500);
  font-size: 0.85rem;
  font-weight: 500;
}

.q-marks svg {
  color: var(--warning-500);
}

.card-body {
  padding: 20px;
}

@media (min-width: 768px) {
  .card-body {
    padding: 24px;
  }
}

.question-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gray-800);
  margin-bottom: 24px;
}

.question-content p {
  margin: 0 0 1em 0;
}

.question-content p:last-child {
  margin-bottom: 0;
}

/* ============================================
   ANSWER MODE TOGGLE
   ============================================ */
.answer-mode-toggle {
  margin-bottom: 20px;
}

.toggle-wrapper {
  display: inline-flex;
  position: relative;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 4px;
}

.toggle-wrapper input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: all var(--transition-base);
  position: relative;
  z-index: 1;
}

.toggle-option:hover {
  color: var(--gray-900);
}

input[type="radio"]:checked + .toggle-option {
  color: var(--primary-700);
}

.toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base);
}

input[type="radio"][value="file"]:checked ~ .toggle-slider {
  transform: translateX(100%);
}

/* ============================================
   TEXT ANSWER SECTION
   ============================================ */
.answer-section {
  animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.editor-container {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.editor-container:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px var(--primary-100);
}

.answer-textarea {
  width: 100%;
  min-height: 250px;
  padding: 16px;
  border: none;
  font-size: 1rem;
  line-height: 1.7;
  resize: vertical;
  font-family: var(--font-sans);
  color: var(--gray-900);
}

.answer-textarea:focus {
  outline: none;
}

.answer-textarea::placeholder {
  color: var(--gray-400);
}

.editor-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

.word-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* ============================================
   FILE UPLOAD SECTION
   ============================================ */
.dropzone {
  position: relative;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--gray-50);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary-500);
  background: var(--primary-50);
}

.dropzone.has-file {
  display: none;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-empty {
  pointer-events: none;
}

.drop-icon {
  color: var(--gray-400);
  margin-bottom: 12px;
}

.drop-text {
  margin-bottom: 8px;
}

.drop-main {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
}

.drop-sub {
  display: block;
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.drop-formats {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.dropzone-uploading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--primary-600);
  font-weight: 500;
}

.dropzone-uploading.hidden {
  display: none;
}

.upload-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--primary-200);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Uploaded Files */
.uploaded-files {
  margin-top: 16px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.file-preview {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-icon {
  color: var(--error-500);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-800);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--error-50);
  color: var(--error-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.file-remove:hover {
  background: var(--error-500);
  color: white;
  transform: scale(1.1);
}

/* ============================================
   FOOTER NAVIGATION
   ============================================ */
.exam-footer {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 12px 16px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
  .exam-footer {
    padding: 16px 24px;
  }
}

.nav-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
}

.nav-btn.secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.nav-btn.secondary:hover:not(:disabled) {
  background: var(--gray-200);
}

.nav-btn.secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-btn.accent {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.nav-btn.accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  animation: fadeIn var(--transition-base);
}

.modal-overlay.hidden {
  display: none;
}

.modal-container {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-2xl);
  animation: modalSlideIn var(--transition-slow) ease-out;
}

.modal-container.small {
  max-width: 420px;
}

.modal-container.review-modal {
  max-width: 700px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--gray-900);
}

.modal-header h2 svg {
  color: var(--primary-500);
}

.modal-container.warning .modal-header h2 svg {
  color: var(--warning-500);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-body p {
  margin: 0 0 12px 0;
  color: var(--gray-600);
  line-height: 1.6;
}

.modal-body p.sub {
  font-size: 0.9rem;
  color: var(--gray-500);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.btn-secondary,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

/* ============================================
   REVIEW MODAL SPECIFIC
   ============================================ */
.review-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.summary-card.success { background: var(--success-50); }
.summary-card.warning { background: var(--warning-50); }
.summary-card.error { background: var(--error-50); }

.summary-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 4px;
}

.summary-card.success .summary-value { color: var(--success-600); }
.summary-card.warning .summary-value { color: var(--warning-600); }
.summary-card.error .summary-value { color: var(--error-600); }

.summary-label {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 500;
}

.review-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  transition: background var(--transition-base);
  cursor: pointer;
}

.review-item:hover {
  background: var(--gray-100);
}

.review-item.answered {
  background: var(--success-50);
}

.review-item.unanswered {
  background: var(--warning-50);
}

.review-q-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gray-700);
  flex-shrink: 0;
}

.review-item.answered .review-q-num {
  background: var(--success-500);
  color: white;
}

.review-item.unanswered .review-q-num {
  background: var(--warning-500);
  color: white;
}

.review-q-info {
  flex: 1;
  min-width: 0;
}

.review-q-status {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-800);
}

.review-q-detail {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.review-q-action {
  color: var(--primary-500);
  font-size: 0.85rem;
  font-weight: 500;
}

.review-warnings {
  margin-top: 16px;
  padding: 16px;
  background: var(--warning-50);
  border: 1px solid var(--warning-200);
  border-radius: var(--radius-lg);
}

.review-warnings h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px 0;
  color: var(--warning-700);
  font-size: 0.95rem;
}

.review-warnings p {
  margin: 0;
  color: var(--warning-600);
  font-size: 0.9rem;
}

/* File Comparison (Replace Modal) */
.file-comparison {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  margin-top: 16px;
}

.file-old, .file-new {
  flex: 1;
}

.file-comparison .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.file-comparison .name {
  display: block;
  font-weight: 500;
  color: var(--gray-800);
  word-break: break-all;
}

.file-arrow {
  color: var(--gray-400);
  font-size: 1.5rem;
}

/* Submitting Overlay */
.submitting-content {
  text-align: center;
  color: white;
}

.submit-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

.submitting-content h3 {
  font-size: 1.25rem;
  margin: 0 0 8px 0;
}

.submitting-content p {
  opacity: 0.8;
  margin: 0;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 640px) {
  .header-center {
    display: none;
  }
  
  .timer-ring {
    width: 60px;
    height: 60px;
  }
  
  .timer-value {
    font-size: 0.9rem;
  }
  
  .toggle-option span {
    display: none;
  }
  
  .toggle-option {
    padding: 10px 16px;
  }
  
  .nav-btn span {
    display: none;
  }
  
  .nav-btn {
    padding: 12px 16px;
  }
  
  .nav-btn.accent span {
    display: inline;
  }
  
  .review-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .summary-value {
    font-size: 1.25rem;
  }
  
  .summary-label {
    font-size: 0.7rem;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer button {
    width: 100%;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .exam-header,
  .settings-bar,
  .question-nav,
  .exam-footer,
  .answer-mode-toggle,
  .modal-overlay {
    display: none !important;
  }
  
  .question-card {
    display: block !important;
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    margin-bottom: 20px;
  }
}
