/* ==========================================================
   ONLINE EXAM SYSTEM & RESULT STYLES
   ========================================================== */

.exam-screen {
  background-color: var(--bg-app);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Exam Header */
.exam-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.exam-title-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Countdown Timer */
.exam-timer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.exam-timer.warning {
  border-color: var(--warning);
  color: var(--warning);
  background: var(--warning-light);
}

.exam-timer.danger {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
  animation: pulse-danger 1s infinite;
}

@keyframes pulse-danger {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Exam Layout Grid */
.exam-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Question Area */
.question-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

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

.question-number-pill {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.question-text {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Answer Choices */
.choices-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface-subtle);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.choice-option:hover {
  border-color: var(--primary);
  background: var(--bg-surface);
  transform: translateX(4px);
}

.choice-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .choice-option.selected {
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
}

.choice-letter {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.choice-option.selected .choice-letter {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.choice-text {
  font-size: 1rem;
  font-weight: 500;
  flex: 1;
}

/* Exam Controls Bar */
.exam-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
}

/* Sidebar Question Palette */
.palette-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-sm);
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
  margin: 1.5rem 0;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.palette-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--bg-surface-subtle);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.palette-btn:hover {
  border-color: var(--primary);
}

.palette-btn.active-q {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.palette-btn.answered {
  background: var(--success);
  color: #ffffff;
}

.palette-btn.marked {
  background: var(--accent);
  color: #ffffff;
}

.palette-btn.marked-answered {
  background: linear-gradient(135deg, var(--success) 50%, var(--accent) 50%);
  color: #ffffff;
}

.palette-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

/* Result Screen */
.result-hero {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-full);
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  box-shadow: 0 10px 25px var(--primary-glow);
}

.score-num {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
}

.score-total {
  font-size: 0.9rem;
  opacity: 0.85;
}

@media (max-width: 900px) {
  .exam-body {
    grid-template-columns: 1fr;
  }
  .palette-card {
    position: static;
  }
}
