/* ============================================================
   VOCAB PRACTICE MODULE — dùng chung design token với classroom.css
   (--matcha-*, --text-*, --border-color, --radius-*, --shadow-*)
   ============================================================ */

/* ---------- Thẻ giới thiệu (đặt dưới "Lớp đang học") ---------- */
.vocab-teaser{
  display:flex;
  flex-wrap:wrap;
  gap:24px;
  align-items:center;
  justify-content:space-between;
  background:linear-gradient(135deg, var(--matcha-pale) 0%, #fff 70%);
  border:1px solid var(--border-color);
  border-radius:var(--radius-l);
  padding:24px clamp(18px,3vw,30px);
  margin-bottom:26px;
  box-shadow:var(--shadow-soft);
}
.vocab-teaser-info{ flex:1; min-width:240px; }
.vocab-teaser-info h3{ margin:2px 0 6px; font-size:19px; color:var(--text-dark); }
.vocab-teaser-sub{ margin:0 0 12px; font-size:13.5px; color:var(--text-muted); max-width:440px; }
.vocab-teaser-stats{ display:flex; gap:18px; flex-wrap:wrap; }
.vocab-teaser-stats span{ font-size:13px; color:var(--text-muted); }
.vocab-teaser-stats strong{ color:var(--matcha-primary-dark); font-size:16px; margin-right:4px; }

.vocab-level-picker{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  max-width:520px;
}
.vocab-level-chip{
  --chip-color:#7EA88A;
  cursor:pointer;
  border:1.5px solid var(--chip-color);
  background:var(--white);
  border-radius:var(--radius-m);
  padding:10px 14px;
  min-width:130px;
  text-align:left;
  font-family:var(--font-main);
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.vocab-level-chip:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-card);
  background:color-mix(in srgb, var(--chip-color) 10%, white);
}
.vocab-level-chip .chip-label{
  display:block;
  font-weight:700;
  font-size:13.5px;
  color:var(--chip-color);
  margin-bottom:2px;
}
.vocab-level-chip .chip-desc{
  display:block;
  font-size:11.5px;
  color:var(--text-muted);
}
.vocab-level-chip .chip-progress{
  display:block;
  font-size:10.5px;
  color:var(--text-faint);
  margin-top:4px;
}

/* ---------- Khu vực luyện tập (section riêng) ---------- */
#vocab-practice-section{ max-width:900px; }

.vocab-practice-header{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  margin:6px 0 22px;
}
.vocab-level-badge{
  display:inline-block;
  padding:7px 16px;
  border-radius:var(--radius-pill);
  background:var(--matcha-badge-bg);
  color:var(--matcha-badge-text);
  font-weight:600;
  font-size:13.5px;
}
.vocab-live-stats{ display:flex; gap:22px; flex-wrap:wrap; }
.vocab-live-stat{ text-align:center; }
.vocab-live-stat .stat-label{
  display:block;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--text-faint);
  margin-bottom:2px;
}
.vocab-live-stat strong{ font-size:19px; color:var(--matcha-primary-dark); }

/* ---------- Thẻ câu hỏi từ vựng ---------- */
.vocab-card{
  background:var(--white);
  border:1px solid var(--border-color);
  border-radius:var(--radius-l);
  padding:clamp(22px,4vw,36px);
  box-shadow:var(--shadow-card);
  text-align:center;
}
.vocab-word-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  flex-wrap:wrap;
}
#vocab-word,
.vocab-word-display{
  font-size:clamp(28px,5vw,38px);
  margin:0;
  color:var(--text-dark);
  letter-spacing:.01em;
}
.vocab-speak-btn{
  border:none;
  cursor:pointer;
  width:46px; height:46px;
  border-radius:50%;
  background:var(--matcha-primary);
  color:var(--white);
  font-size:19px;
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s ease, background .15s ease;
  flex:none;
}
.vocab-speak-btn:hover{ background:var(--matcha-primary-dark); transform:scale(1.06); }
.vocab-speak-btn:active{ transform:scale(.94); }
.vocab-speak-btn.speaking{ animation:vocab-pulse 1s ease-in-out infinite; }
@keyframes vocab-pulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(126,168,138,.45); }
  50%{ box-shadow:0 0 0 8px rgba(126,168,138,0); }
}

.vocab-phonetic{
  margin:10px 0 4px;
  color:var(--text-muted);
  font-size:15px;
}
.vocab-pos{
  display:inline-block;
  font-size:11.5px;
  color:var(--matcha-primary-dark);
  background:var(--matcha-badge-bg);
  padding:2px 10px;
  border-radius:var(--radius-pill);
  margin-bottom:14px;
}

.vocab-accent-toggle{
  display:flex;
  justify-content:center;
  gap:16px;
  margin:4px 0 22px;
  font-size:13px;
  color:var(--text-muted);
}
.vocab-accent-toggle label{ cursor:pointer; display:flex; align-items:center; gap:5px; }

.vocab-options{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:6px;
  text-align:left;
}
.vocab-option-btn{
  border:1.5px solid var(--border-color);
  background:var(--surface-tint);
  border-radius:var(--radius-m);
  padding:14px 16px;
  font-family:var(--font-main);
  font-size:14.5px;
  color:var(--text-dark);
  cursor:pointer;
  transition:all .15s ease;
  display:flex;
  align-items:center;
  gap:10px;
}
.vocab-option-btn .opt-letter{
  flex:none;
  width:26px; height:26px;
  border-radius:50%;
  background:var(--white);
  border:1.5px solid var(--border-color);
  display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700; color:var(--text-muted);
}
.vocab-option-btn:hover:not(:disabled){
  border-color:var(--matcha-primary);
  background:var(--white);
  transform:translateY(-1px);
  box-shadow:var(--shadow-soft);
}
.vocab-option-btn:disabled{ cursor:default; }
.vocab-option-btn.correct{
  border-color:var(--success);
  background:var(--success-bg);
}
.vocab-option-btn.correct .opt-letter{ background:var(--success); border-color:var(--success); color:var(--white); }
.vocab-option-btn.wrong{
  border-color:var(--danger);
  background:var(--danger-bg);
}
.vocab-option-btn.wrong .opt-letter{ background:var(--danger); border-color:var(--danger); color:var(--white); }
.vocab-option-btn.dim{ opacity:.55; }

.vocab-feedback{
  margin-top:18px;
  padding:14px 18px;
  border-radius:var(--radius-m);
  text-align:left;
  font-size:14px;
  animation:vocab-pop .2s ease;
}
.vocab-feedback.is-correct{ background:var(--success-bg); border:1px solid #BEE0C6; }
.vocab-feedback.is-wrong{ background:var(--danger-bg); border:1px solid #F1C7C2; }
.vocab-feedback-text{ margin:0 0 6px; font-weight:700; }
.vocab-feedback.is-correct .vocab-feedback-text{ color:var(--success); }
.vocab-feedback.is-wrong .vocab-feedback-text{ color:var(--danger); }
.vocab-example{ margin:0; color:var(--text-muted); font-size:13.5px; white-space:pre-line; }
.vocab-points-earned{
  display:inline-block;
  margin-left:8px;
  font-size:12.5px;
  font-weight:700;
  color:var(--matcha-primary-dark);
  background:var(--matcha-badge-bg);
  padding:2px 9px;
  border-radius:var(--radius-pill);
}
@keyframes vocab-pop{
  from{ transform:translateY(-4px); opacity:0; }
  to{ transform:translateY(0); opacity:1; }
}

.vocab-next-btn{ margin-top:20px; }

/* ---------- Màn hoàn thành cấp độ ---------- */
.vocab-complete{
  text-align:center;
  padding:30px 10px 6px;
}
.vocab-complete-icon{ font-size:44px; margin-bottom:10px; }
.vocab-complete h3{ margin:0 0 8px; }
.vocab-complete p{ color:var(--text-muted); font-size:14px; margin-bottom:22px; }
.vocab-complete-actions{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }

/* ---------- Khối hiệu suất / biểu đồ ---------- */
.vocab-performance{
  margin-top:30px;
  background:var(--surface-tint);
  border:1px solid var(--border-color);
  border-radius:var(--radius-l);
  padding:24px clamp(18px,3vw,30px);
}
.vocab-performance h3{ font-size:16px; margin:0 0 18px; }
.vocab-performance-grid{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:28px;
  align-items:center;
}
.vocab-ring-box{ text-align:center; }
.vocab-ring-box .score-ring{ width:96px; height:96px; margin:0 auto 8px; }
.vocab-ring-box #vocab-ring-text,
.vocab-ring-box .vocab-ring-value{ font-size:19px; font-weight:800; color:var(--matcha-primary-dark); }
.vocab-ring-box p{ margin:0; font-size:12px; color:var(--text-muted); }

.vocab-bars{ display:flex; flex-direction:column; gap:12px; }
.vocab-bar-row{ display:flex; align-items:center; gap:10px; }
.vocab-bar-label{ flex:none; width:38px; font-size:12.5px; color:var(--text-muted); }
.vocab-bar-track{
  flex:1;
  height:12px;
  background:var(--matcha-badge-bg);
  border-radius:var(--radius-pill);
  overflow:hidden;
}
.vocab-bar-fill{
  height:100%;
  width:0%;
  border-radius:var(--radius-pill);
  transition:width .4s ease;
}
.vocab-bar-fill.correct{ background:var(--success); }
.vocab-bar-fill.wrong{ background:var(--danger); }
.vocab-bar-value{ flex:none; width:24px; text-align:right; font-size:12.5px; font-weight:700; color:var(--text-dark); }

.vocab-history{ grid-column:1 / -1; }
.vocab-history-label{ font-size:12px; color:var(--text-muted); margin-bottom:8px; }
.vocab-history-dots{ display:flex; flex-wrap:wrap; gap:6px; }
.vocab-history-dots .dot{
  width:14px; height:14px;
  border-radius:50%;
  flex:none;
}
.vocab-history-dots .dot.correct{ background:var(--success); }
.vocab-history-dots .dot.wrong{ background:var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width:640px){
  .vocab-teaser{ flex-direction:column; align-items:stretch; }
  .vocab-level-picker{ max-width:none; }
  .vocab-options{ grid-template-columns:1fr; }
  .vocab-performance-grid{ grid-template-columns:1fr; }
  .vocab-ring-box .score-ring{ margin:0 auto 8px; }
}
