/* Styles riêng cho public/luyen-tap/*.html - dùng chung với site.css (biến màu --primary, --border...). */

.q-card {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.q-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.q-body { flex: 1; min-width: 0; }
.q-type { font-size: 0.78em; color: #64748B; margin-bottom: 4px; }
.q-instruction { font-style: italic; color: #475569; font-size: 0.92em; margin-bottom: 6px; }
.q-text { font-weight: 700; margin-bottom: 10px; }
.q-input input[type=text] { margin-bottom: 4px; }
.q-hint { font-size: 0.82em; color: #64748B; margin-top: -8px; margin-bottom: 8px; }
.q-option { display: block; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.q-option input { margin-right: 6px; }
.q-opt-correct { background: var(--green-container); color: var(--green); font-weight: 700; }
.q-opt-wrong { background: #fbe5e3; color: var(--red); font-weight: 700; text-decoration: line-through; }
.q-opt-icon { text-decoration: none; font-weight: 700; }
.q-result { margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 0.94em; }
.q-correct { background: var(--green-container); color: var(--green); }
.q-incorrect { background: #fbe5e3; color: var(--red); }
.q-explain-btn { margin-top: 8px; }
.q-explain-box { margin-top: 8px; background: var(--tint); border-radius: 8px; padding: 10px 12px; font-size: 0.92em; }

/* Thanh tiến trình ETA lúc tạo đề */
.eta-bar-outer { width: 100%; height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.eta-bar-inner { height: 100%; width: 0%; background: var(--primary); border-radius: 4px; }
.eta-bar-text { text-align: center; font-size: 0.85em; color: #64748B; margin-top: 6px; }

/* Đồng hồ đếm giờ */
.timer-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--tint);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.timer-box.review { background: #fff3cd; color: #8a6d1a; }
.timer-box.urgent { background: #fbe5e3; color: var(--red); }
.timer-label { font-weight: 400; font-size: 0.82em; color: #475569; }

.p-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.p-badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.82em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p-text { flex: 1; line-height: 1.8; }

.passage-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  white-space: pre-wrap;
  line-height: 1.8;
  box-shadow: var(--shadow);
}
.section-title { color: var(--primary); font-size: 1.15em; margin: 24px 0 10px; }
.audio-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.context-line { font-style: italic; color: #475569; margin-bottom: 8px; }

.score-card {
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}
.score-card .score-big { font-size: 2em; font-weight: 700; color: var(--primary); }
.warn-late { background: #fbe5e3; color: var(--red); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }

/* Prompt header (chip Task/Part) - dùng cho Viết/Nói */
.prompt-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.prompt-chip { background: var(--tint); color: var(--primary); font-weight: 700; font-size: 0.85em; padding: 4px 12px; border-radius: 999px; }
.prompt-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.prompt-card .prompt-text { font-weight: 700; font-size: 1.05em; line-height: 1.6; }
.prompt-card .chart-type-label { font-size: 0.8em; color: #64748B; margin-bottom: 6px; }
.prompt-card .chart-description { font-style: italic; color: #475569; margin-top: 10px; }

/* Ô viết bài (Writing essay) */
.essay-box {
  width: 100%;
  min-height: 260px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1em;
  line-height: 1.6;
  resize: vertical;
}
.word-count { text-align: right; color: #64748B; font-size: 0.88em; margin-top: 6px; }
.paste-blocked-hint { display: none; color: var(--red); font-size: 0.85em; margin-top: 6px; }

/* Đếm số lần rời tab trong lúc làm bài */
.tab-warn { color: #D97706; font-size: 0.85em; margin-top: 4px; text-align: right; }

/* Biểu đồ Writing Task 1 (SVG thuần) */
.chart-svg-wrap { text-align: center; margin: 12px 0; }
.chart-svg { width: 100%; max-width: 560px; height: auto; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.chart-legend-item { font-size: 0.85em; color: #475569; display: inline-flex; align-items: center; }
.chart-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.chart-table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.chart-table th, .chart-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: center; font-size: 0.9em; }
.chart-table th { background: var(--tint); }

/* Tiêu chí chấm điểm (Writing/Speaking) */
.criteria-block { margin-bottom: 14px; }
.criteria-block .criteria-name { font-weight: 700; margin-bottom: 2px; }
.criteria-block .criteria-comment { color: #475569; font-size: 0.95em; }
.idea-box { background: var(--tint); border-radius: 10px; padding: 14px 16px; margin-top: 12px; white-space: pre-wrap; }

/* Ghi âm (Speaking) */
.rec-btn { background: var(--primary); color: #fff; border: none; border-radius: 999px; padding: 12px 28px; font-weight: 700; cursor: pointer; font-size: 1em; }
.rec-btn.recording { background: var(--red); }
.transcript-box { width: 100%; min-height: 100px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); font-family: inherit; margin-top: 8px; }

/* Tiến trình 5 giai đoạn Đề thi hoàn chỉnh */
.stage-progress { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.stage-step { flex: 1; min-width: 80px; text-align: center; padding: 8px 4px; border-radius: 8px; background: var(--tint); color: #64748B; font-size: 0.85em; font-weight: 600; }
.stage-step.active { background: var(--primary); color: #fff; }
.stage-step.done { background: var(--green-container); color: var(--green); }
