/* ── Professional Vocab Quiz v1.0 ── */

:root {
  --pvq-primary: #4f6af0;
  --pvq-correct: #0faa6e;
  --pvq-wrong:   #e05a5a;
  --pvq-radius:  12px;
}

.pvq-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px 56px;
  color: #1a1a2e;
}

/* ── Screens ──────────────────────────────────────────── */
.pvq-screen { display: none; }
.pvq-screen--active { display: block; }

/* ── Header ───────────────────────────────────────────── */
.pvq-header {
  text-align: center;
  padding: 36px 24px 28px;
  background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 100%);
  border-radius: 16px;
  border: 1px solid #e3e8f5;
  margin-bottom: 28px;
}

.pvq-header h2 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.4px;
}

.pvq-header p {
  color: #5a6480;
  font-size: 1.05rem;
  margin: 0;
}

/* ── Topic grid ───────────────────────────────────────── */
.pvq-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.pvq-topic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px 22px;
  border: 2px solid transparent;
  border-radius: var(--pvq-radius);
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}

.pvq-topic-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--pvq-color, var(--pvq-primary));
}

.pvq-topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border-color: var(--pvq-color, var(--pvq-primary));
}

.pvq-topic-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.pvq-topic-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a2e;
  text-align: center;
  line-height: 1.3;
}

.pvq-topic-count {
  font-size: 0.78rem;
  color: #888;
  font-weight: 400;
}

/* ── Quiz top bar ─────────────────────────────────────── */
.pvq-quiz-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-top: 8px;
}

.pvq-btn-ghost {
  padding: 8px 14px;
  border: 2px solid #dde3ec;
  border-radius: 50px;
  background: #fff;
  color: #555;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

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

.pvq-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pvq-progress-bar {
  height: 8px;
  background: #e8ebf5;
  border-radius: 50px;
  overflow: hidden;
}

.pvq-progress-fill {
  height: 100%;
  background: var(--pvq-primary);
  border-radius: 50px;
  transition: width 0.35s ease;
}

.pvq-progress-label {
  font-size: 0.75rem;
  color: #888;
}

.pvq-score-badge {
  background: #f0f4ff;
  color: var(--pvq-primary);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Question area ────────────────────────────────────── */
.pvq-question-wrap {
  background: #fff;
  border: 1.5px solid #e3e8f5;
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.05);
}

.pvq-topic-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.pvq-question-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.5;
  margin: 0 0 22px;
}

/* ── Options ──────────────────────────────────────────── */
.pvq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.pvq-option {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #dde3ec;
  border-radius: 10px;
  background: #f8f9ff;
  color: #2d3555;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  line-height: 1.4;
}

.pvq-option:hover:not(:disabled) {
  background: #eef1ff;
  border-color: var(--pvq-primary);
  transform: translateX(3px);
}

.pvq-option:disabled {
  cursor: default;
}

.pvq-option--correct {
  background: #eafaf2 !important;
  border-color: var(--pvq-correct) !important;
  color: #0d5c3a !important;
  font-weight: 600;
}

.pvq-option--wrong {
  background: #fdf0f0 !important;
  border-color: var(--pvq-wrong) !important;
  color: #8b1a1a !important;
}

/* ── Feedback box ─────────────────────────────────────── */
.pvq-feedback {
  border-radius: 10px;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.pvq-feedback--correct,
.pvq-feedback--wrong {
  max-height: 200px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.pvq-feedback--correct {
  background: #eafaf2;
  color: #0d5c3a;
  border: 1px solid #b6e8d0;
}

.pvq-feedback--wrong {
  background: #fdf0f0;
  color: #7a1515;
  border: 1px solid #f2bcbc;
}

/* ── Next button ──────────────────────────────────────── */
.pvq-btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--pvq-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.pvq-btn-primary:hover {
  background: #3d58d8;
  transform: translateY(-1px);
}

.pvq-btn-next {
  width: 100%;
  text-align: center;
}

.pvq-hidden { display: none !important; }

/* ── Results screen ───────────────────────────────────── */
.pvq-results-wrap {
  text-align: center;
  padding: 8px 0;
}

.pvq-result-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.pvq-result-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.pvq-result-sub {
  color: #5a6480;
  font-size: 1rem;
  margin: 0 0 24px;
}

.pvq-result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.pvq-big-score {
  font-size: 4rem;
  font-weight: 800;
  color: var(--pvq-primary);
  line-height: 1;
}

.pvq-big-denom {
  font-size: 2rem;
  font-weight: 600;
  color: #aab0cc;
}

.pvq-pct {
  font-size: 1.5rem;
  font-weight: 700;
  color: #888;
}

/* ── Breakdown ────────────────────────────────────────── */
.pvq-breakdown-heading {
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f2f8;
}

.pvq-breakdown-card {
  background: #f8f9ff;
  border: 1.5px solid #e3e8f5;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: left;
}

.pvq-bd-q {
  font-weight: 600;
  font-size: 0.92rem;
  color: #1a1a2e;
  margin: 0 0 8px;
}

.pvq-bd-yours, .pvq-bd-correct {
  font-size: 0.88rem;
  margin: 0 0 4px;
  color: #444;
}

.pvq-bd-label {
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.78rem;
  margin-right: 4px;
}

.pvq-bd-wrong  { background: #fce8e8; color: var(--pvq-wrong); }
.pvq-bd-right  { background: #e5f9ef; color: var(--pvq-correct); }

.pvq-bd-explain {
  font-size: 0.85rem;
  color: #5a6480;
  margin: 8px 0 0;
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid #e8ebf5;
}

.pvq-all-correct {
  text-align: center;
  color: var(--pvq-correct);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 0;
}

.pvq-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 560px) {
  .pvq-header h2      { font-size: 1.4rem; }
  .pvq-header         { padding: 24px 16px; }
  .pvq-topic-grid     { grid-template-columns: repeat(2, 1fr); }
  .pvq-question-wrap  { padding: 22px 16px 20px; }
  .pvq-question-text  { font-size: 1rem; }
  .pvq-quiz-topbar    { flex-wrap: wrap; }
  .pvq-big-score      { font-size: 3rem; }
  .pvq-result-actions { flex-direction: column; align-items: center; }
}
