/* ============================================
   SmartKoala — Citizenship Practice Test
   Tool-specific styles only
   ============================================ */

/* ── Quiz Wrapper ── */
.quiz-wrapper {
  max-width: 640px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

/* ── Screen Management ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Setup Screen ── */
.setup-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.setup-hero {
  font-size: 3.5rem;
  margin-bottom: 0.8rem;
  display: block;
}

.setup-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 0.4rem;
}

.setup-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.setup-pills {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.info-pill {
  background: var(--green-pale);
  border: 1.5px solid var(--green-light);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--green-dark);
}

.mode-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  text-align: left;
}

.mode-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.8rem;
}

.mode-btn {
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--grey-bg);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.mode-btn:hover {
  border-color: var(--green-light);
}

.mode-btn.selected {
  border-color: var(--green-dark);
  background: var(--green-pale);
}

.mode-btn-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.25rem;
}

.mode-btn-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Quiz Header ── */
.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.q-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.timer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--green-pale);
  border: 1.5px solid var(--green-light);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.timer.urgent {
  background: #fee2e2;
  border-color: #f87171;
  color: #dc2626;
}

/* ── Progress Bar ── */
.progress-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 1.4rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green-mid);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ── Question Card ── */
.question-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.q-section-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.q-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 1.4rem;
}

/* ── Answer Buttons ── */
.answers {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.answer-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--grey-bg);
  text-align: left;
  cursor: pointer;
  font-size: 0.93rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.15s;
  line-height: 1.4;
  font-family: inherit;
}

.answer-btn:hover:not(:disabled) {
  border-color: var(--green-light);
  background: var(--green-pale);
}

.answer-btn:disabled {
  cursor: default;
}

.answer-letter {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text-muted);
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.15s;
}

.answer-btn.correct {
  border-color: #16a34a;
  background: #dcfce7;
}

.answer-btn.correct .answer-letter {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.answer-btn.wrong {
  border-color: #dc2626;
  background: #fee2e2;
}

.answer-btn.wrong .answer-letter {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

.answer-btn.reveal {
  border-color: #16a34a;
  background: #dcfce7;
  opacity: 0.75;
}

.answer-btn.reveal .answer-letter {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

/* ── Explanation ── */
.explanation {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  background: var(--green-bg);
  border-left: 4px solid var(--green-mid);
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: none;
}

.explanation.visible {
  display: block;
}

.next-btn-wrap {
  margin-top: 1.2rem;
  display: none;
}

.next-btn-wrap.visible {
  display: block;
}

/* ── End-mode: Skip feedback, just Next ── */
.end-next-wrap {
  margin-top: 1.5rem;
}

/* ── Results Screen ── */
.result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.result-verdict {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.result-verdict.pass {
  background: #dcfce7;
  border: 2px solid #16a34a;
}

.result-verdict.fail {
  background: #fee2e2;
  border: 2px solid #dc2626;
}

.verdict-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.4rem;
}

.verdict-text {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.3rem;
}

.result-verdict.pass .verdict-text { color: #15803d; }
.result-verdict.fail .verdict-text { color: #dc2626; }

.verdict-sub {
  font-size: 0.92rem;
}

.result-verdict.pass .verdict-sub { color: #166534; }
.result-verdict.fail .verdict-sub { color: #b91c1c; }

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.r-stat {
  background: var(--green-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 0.5rem;
  text-align: center;
}

.r-stat.highlight {
  background: var(--green-pale);
  border-color: var(--green-light);
}

.r-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.r-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: -0.5px;
}

.wrong-answers-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.wrong-item {
  padding: 1rem;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  margin-bottom: 0.8rem;
  background: #fff5f5;
}

.wrong-item-q {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.wrong-item-yours {
  font-size: 0.83rem;
  color: #dc2626;
  margin-bottom: 0.25rem;
}

.wrong-item-correct {
  font-size: 0.83rem;
  color: #16a34a;
  font-weight: 700;
}

.wrong-item-explain {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.45;
  font-style: italic;
}

.all-correct-msg {
  text-align: center;
  padding: 1.5rem;
  background: var(--green-pale);
  border-radius: 10px;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.btn-secondary {
  width: 100%;
  padding: 0.9rem;
  background: var(--white);
  color: var(--green-dark);
  border: 2px solid var(--green-dark);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--green-pale);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .mode-btns { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .result-actions { grid-template-columns: 1fr; }
  .question-card { padding: 1.3rem; }
  .setup-card { padding: 1.8rem 1.3rem; }
  .result-card { padding: 1.3rem; }
}
