/* =========================================================
   AI GOD — TRIAL EXAM STYLESHEET
   File: sample-exam.css
   NOTE: UI only. Exam logic is in HTML.
   ========================================================= */

/* =========================
   MODULE: BASIC RESET
   ========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* IMPORTANT: missing earlier — this is why blocks were showing */
.is-hidden {
  display: none !important;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f2f5ff;
  color: #1b2430;
  padding: 1.5rem;
}

h1,
h2,
h3 {
  font-weight: 700;
}

/* =========================
   MODULE: PAGE WRAPPER
   ========================= */
.page-shell {
  max-width: 1080px;
  margin: 0 auto;
}

/* =========================
   MODULE: HEADER
   ========================= */
.exam-header {
  text-align: center;
  margin-bottom: 1rem;
}

.exam-title {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.exam-subtitle {
  font-size: 0.9rem;
  color: #47516b;
}

.badge-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.badge {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-green {
  background: #e6f8ed;
  color: #146a2a;
}

.badge-blue {
  background: #e4f2ff;
  color: #1459a6;
}

/* =========================
   MODULE: GRID LAYOUT TOP
   ========================= */
.top-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

/* =========================
   MODULE: CARD BASE
   ========================= */
.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  border: 1px solid #e2e8ff;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

/* =========================
   MODULE: FORM FIELDS
   ========================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.7rem;
  margin-bottom: 0.8rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

label {
  font-size: 0.78rem;
  color: #4b5563;
}

input[type="text"],
input[type="email"],
select {
  border-radius: 10px;
  border: 1px solid #c7d2fe;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  outline: none;
  background: #f9fafb;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.start-note {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 0.7rem;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* =========================
   MODULE: SUMMARY CARD
   ========================= */
.summary-row {
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.4;
}

.summary-helper {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.summary-row strong {
  color: #111827;
}

/* =========================
   MODULE: QUESTION AREA
   ========================= */
.question-card {
  margin-top: 0.6rem;
  border-radius: 18px;
  padding: 1rem 1.1rem 1.2rem;
}

.question-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.question-top-right {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
}

.progress-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.progress-bar-bg {
  width: 160px;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #2563eb);
  transition: width 0.25s ease-out;
}

.progress-bar-label {
  font-size: 0.72rem;
  color: #4b5563;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.78rem;
}

.question-meta {
  font-size: 0.78rem;
  color: #6b7280;
}

.question-text {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.option-row {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s, transform 0.08s;
}

.option-row:hover {
  background: #f3f4ff;
  transform: translateY(-1px);
}

.option-row.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  background: #eff6ff;
}

.opt-letter {
  font-weight: 600;
  color: #4b5563;
  width: 1.4rem;
}

.opt-text {
  text-align: left;
}

/* =========================
   MODULE: BOTTOM CONTROLS
   ========================= */
.exam-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.control-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-ghost,
.btn-outline {
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-ghost {
  border: none;
  background: #f3f4f6;
  color: #374151;
}

.btn-outline {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
}

.btn-ghost-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-ghost-danger:hover {
  background: #fecaca;
}

.score-text {
  font-size: 0.8rem;
  color: #374151;
}

/* =========================
   MODULE: FEEDBACK ANIMATIONS
   ========================= */
.correct-pulse {
  animation: pulseSuccess 0.5s ease-out;
}

@keyframes pulseSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); box-shadow: 0 0 12px rgba(34, 197, 94, 0.6); }
  100% { transform: scale(1); }
}

.wrong-shake {
  animation: shakeWrong 0.35s ease-in-out;
}

@keyframes shakeWrong {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.hint-box {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: #4b5563;
  background: #fef9c3;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  border: 1px dashed #eab308;
}

.answer-box {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #14532d;
  background: #ecfdf5;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  border: 1px solid #bbf7d0;
}

/* =========================
   MODULE: REPORT OVERLAY
   ========================= */
.report-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.report-overlay.hidden {
  display: none;
}

.report-card {
  width: min(640px, 94%);
  background: #ffffff;
  border-radius: 20px;
  padding: 1.4rem 1.6rem 1.5rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  border: 1px solid #dbe4ff;
}

.report-title {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  color: #0b3c91;
}

.report-subtitle {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 0.7rem;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
  margin-bottom: 0.8rem;
  font-size: 0.86rem;
}

.report-label {
  color: #6b7280;
}

.report-value {
  font-weight: 600;
  color: #111827;
}

.report-metrics {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.metric-pill {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #eff6ff;
  color: #1d4ed8;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.btn-small {
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
}

/* =========================
   MODULE: STREAK GLOW
   ========================= */
.streak-glow {
  animation: streakGlow 0.8s ease-out;
}

@keyframes streakGlow {
  0% { color: #1e3a8a; transform: scale(1); }
  40% { color: #22c55e; transform: scale(1.2); text-shadow: 0 0 10px rgba(34, 197, 94, 0.7); }
  100% { color: #1e3a8a; transform: scale(1); text-shadow: none; }
}

/* =========================
   MODULE: HIDE SETUP AFTER START
   ========================= */
body.exam-started #setupSection {
  display: none !important;
}

/* =========================
   MODULE: EXPLANATION PANEL
   ========================= */
#explanationPanel .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: #1e3a8a;
}

.exp-block {
  padding: 0.6rem 0.7rem;
  border-left: 3px solid #2563eb;
  background: #f0f5ff;
  border-radius: 6px;
  margin-bottom: 0.7rem;
  font-size: 0.85rem;
  white-space: pre-line;
}

#explanationPanel {
  transform-origin: top;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

#explanationPanel.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.exp-good { border-left-color: #16a34a; background: #ecfdf5; }
.exp-neutral { border-left-color: #2563eb; background: #eff6ff; }
.exp-warn { border-left-color: #eab308; background: #fef9c3; }
.exp-danger { border-left-color: #b91c1c; background: #fee2e2; }

/* =========================
   MODULE: MILESTONE TOAST
   ========================= */
#milestoneToast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  color: #ffffff;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

#milestoneToast.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   MODULE: RESPONSIVE (MOBILE FIRST)
   ========================= */
@media (max-width: 768px) {
  body { padding: 0.8rem; }
  .top-grid { grid-template-columns: 1fr; }
  .question-card { padding: 0.9rem 0.85rem 1rem; }
  .report-grid { grid-template-columns: 1fr; }
}
