﻿/* ==========================================================================
   simulado-online.css — Simulado Online de Informática (F5)
   Design System Oficial F5 com Ambiente Real de Prova e Gabarito Comentado
   ========================================================================== */

:root {
  --so-bg: #07111e;
  --so-surface: #0b1a2d;
  --so-surface-hover: #10243e;
  --so-cyan: #38bdf8;
  --so-cyan-glow: rgba(56, 189, 248, 0.4);
  --so-yellow: #facc15;
  --so-yellow-glow: rgba(250, 204, 21, 0.4);
  --so-green: #4ade80;
  --so-red: #ef4444;
  --so-text: #f8fafc;
  --so-text-muted: #94a3b8;
  --so-font: 'Barlow', -apple-system, sans-serif;
  --so-font-cond: 'Barlow Condensed', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--so-bg);
  font-family: var(--so-font);
  color: var(--so-text);
  user-select: none;
  -webkit-user-select: none;
}

.so-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: relative;
  background: radial-gradient(circle at 50% 15%, #0e223d 0%, #050d18 100%);
}

/* ── Topbar ── */
.so-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1.2rem;
  background: rgba(7, 17, 30, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
  z-index: 20;
}

.so-back-btn {
  color: var(--so-cyan);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}
.so-back-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  transform: translateX(-2px);
}

.so-top-title {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.so-top-title span:first-child {
  font-family: var(--so-font-cond);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}
.so-top-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--so-yellow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.so-top-controls {
  display: flex;
  gap: 0.4rem;
}
.so-btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--so-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}
.so-btn-icon:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--so-cyan);
  border-color: rgba(56, 189, 248, 0.4);
}
.so-btn-icon svg { width: 15px; height: 15px; }

/* ── Palco Principal ── */
.so-main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.4rem 1.2rem 0.5rem;
  overflow: hidden;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  gap: 0.4rem;
}

/* ── Barra de Status da Prova ── */
.so-exam-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: rgba(11, 26, 45, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 0.4rem 0.8rem;
}

.so-timer-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.so-timer-icon { font-size: 1.3rem; }
.so-timer-text { display: flex; flex-direction: column; }
.so-timer-lbl { font-size: 0.52rem; color: var(--so-text-muted); text-transform: uppercase; font-weight: 700; }
.so-timer-clock {
  font-family: var(--so-font-cond);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--so-cyan);
  line-height: 1;
}
.so-timer-clock.warning { color: #ef4444; animation: pulseRed 1s infinite alternate; }
@keyframes pulseRed { from { opacity: 1; } to { opacity: 0.5; } }

.so-question-map {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  max-height: 56px;
  overflow-y: auto;
}
.so-q-dot {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--so-text-muted);
  font-family: var(--so-font-cond);
  font-size: 0.82rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.so-q-dot:hover { border-color: var(--so-cyan); color: #fff; }
.so-q-dot.active { border-color: var(--so-cyan); background: rgba(56, 189, 248, 0.2); color: #fff; box-shadow: 0 0 8px var(--so-cyan-glow); }
.so-q-dot.answered { background: rgba(34, 197, 94, 0.2); border-color: #22c55e; color: #4ade80; }
.so-q-dot.flagged { background: rgba(250, 204, 21, 0.2); border-color: var(--so-yellow); color: var(--so-yellow); }

.so-btn-finish {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  font-family: var(--so-font);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.so-btn-finish:hover { background: #b91c1c; transform: translateY(-2px); }

/* ── Card da Questão ── */
.so-question-card {
  flex: 1;
  background: linear-gradient(180deg, #0e223d 0%, #081628 100%);
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 0.8rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow-y: auto;
  gap: 0.5rem;
  min-height: 0;
}

.so-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.35rem;
}
.so-q-badge-row { display: flex; gap: 0.4rem; }
.so-q-board-tag {
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(250, 204, 21, 0.15);
  color: var(--so-yellow);
  border: 1px solid rgba(250, 204, 21, 0.35);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.so-q-subject-tag {
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.15);
  color: var(--so-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.so-q-counter {
  font-family: var(--so-font-cond);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--so-text-muted);
}

.so-q-enunciation {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #fff;
  user-select: text;
  -webkit-user-select: text;
}
.so-q-enunciation strong { color: var(--so-yellow); }

.so-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.so-opt-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.so-opt-item:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
}
.so-opt-item.selected {
  background: rgba(250, 204, 21, 0.15);
  border-color: var(--so-yellow);
  box-shadow: 0 0 10px var(--so-yellow-glow);
}

.so-opt-letter {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--so-cyan);
  font-family: var(--so-font-cond);
  font-size: 0.85rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.so-opt-item.selected .so-opt-letter {
  background: var(--so-yellow);
  color: #08111e;
}

.so-opt-text {
  font-size: 0.8rem;
  line-height: 1.3;
  color: #e2e8f0;
  user-select: text;
  -webkit-user-select: text;
}

.so-q-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.45rem;
}

.so-btn-flag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--so-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.so-btn-flag:hover { color: var(--so-yellow); border-color: var(--so-yellow); }
.so-btn-flag.active { background: rgba(250, 204, 21, 0.2); border-color: var(--so-yellow); color: var(--so-yellow); }

.so-nav-btns { display: flex; gap: 0.45rem; }
.so-btn-nav {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.so-btn-nav:hover { background: rgba(255, 255, 255, 0.12); }
.so-btn-nav.primary {
  background: var(--so-cyan);
  color: #08111e;
  border: none;
  font-weight: 800;
}
.so-btn-nav.primary:hover { background: #7dd3fc; }

/* ── Modais e Overlays ── */
.so-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 19, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  z-index: 50;
}
.so-overlay.hidden { display: none !important; }

.so-card {
  background: linear-gradient(145deg, #0e223d 0%, #081628 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  max-width: 520px;
  width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 1.1rem 1.3rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px var(--so-cyan-glow);
}

.so-result-icon { font-size: 2rem; margin-bottom: 0.15rem; }
.so-eyebrow {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--so-cyan);
  margin-bottom: 0.15rem;
  display: inline-block;
}
.so-title {
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  color: #fff;
}

/* ── Setup Pill Grid ── */
.so-setup-group {
  text-align: left;
  margin-bottom: 0.8rem;
}
.so-setup-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--so-cyan);
  margin-bottom: 0.35rem;
}
.so-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.4rem;
}
.so-pill-btn {
  background: rgba(7, 17, 31, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.so-pill-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--so-cyan);
}
.so-pill-btn.active {
  background: rgba(250, 204, 21, 0.15);
  border-color: var(--so-yellow);
  box-shadow: 0 0 10px var(--so-yellow-glow);
}
.so-pill-btn strong {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
}
.so-pill-btn.active strong { color: var(--so-yellow); }
.so-pill-btn small {
  font-size: 0.55rem;
  color: var(--so-text-muted);
}

.so-score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, #102a4a 0%, #081628 100%);
  border: 3px solid var(--so-yellow);
  box-shadow: 0 0 16px var(--so-yellow-glow);
  margin: 0.4rem auto 0.6rem;
}
.so-score-circle strong { font-family: var(--so-font-cond); font-size: 1.6rem; color: #fff; line-height: 1; }
.so-score-circle span { font-size: 0.42rem; font-weight: 800; color: var(--so-text-muted); }

.so-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.so-s-item {
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.35rem;
}
.so-s-item span { font-size: 0.55rem; color: var(--so-text-muted); font-weight: 700; text-transform: uppercase; }
.so-s-item strong { display: block; font-family: var(--so-font-cond); font-size: 1.05rem; }
.so-s-item strong.green { color: #4ade80; }
.so-s-item strong.cyan { color: #38bdf8; }
.so-s-item strong.gold { color: var(--so-yellow); }

.so-radar-box {
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  text-align: left;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #e2e8f0;
  margin-bottom: 0.8rem;
  max-height: 120px;
  overflow-y: auto;
}
.so-radar-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}
.so-radar-item strong { color: var(--so-yellow); }

.so-result-actions { display: flex; flex-direction: column; gap: 0.4rem; }
.so-btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 40px;
  background: linear-gradient(135deg, #fde047 0%, #facc15 50%, #eab308 100%);
  color: #08111e;
  border: 1px solid rgba(254, 240, 138, 0.6);
  border-radius: 9px;
  font-family: var(--so-font);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(250, 204, 21, 0.35);
  transition: all 0.2s ease;
}
.so-btn-play:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(250, 204, 21, 0.5); }

.so-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 35px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.so-btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

/* ── Modal de Gabarito Comentado ── */
.so-card-feedback {
  max-width: 680px;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
}
.so-fb-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
.so-btn-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  cursor: pointer;
}
.so-fb-scroll {
  flex: 1;
  overflow-y: auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 0.3rem;
}
.so-fb-item {
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem;
}
.so-fb-item.correct { border-color: rgba(74, 222, 128, 0.5); }
.so-fb-item.wrong { border-color: rgba(239, 68, 68, 0.5); }
.so-fb-qtitle { font-size: 0.82rem; font-weight: 700; color: #fff; margin-bottom: 0.35rem; }
.so-fb-expl { font-size: 0.75rem; line-height: 1.35; color: #cbd5e1; }
.so-fb-expl strong { color: var(--so-yellow); }

/* ── Toast ── */
.so-toast {
  position: absolute;
  top: 60px;
  right: 20px;
  background: rgba(14, 34, 61, 0.95);
  border: 1px solid var(--so-yellow);
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--so-yellow-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-15px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
}
.so-toast.show { opacity: 1; transform: translateY(0); }
