/* ════════════════════════════════════════
   WEAK PRACTICE — luyện từ yếu 2 bước
════════════════════════════════════════ */

.wp-wrap {
  padding: 16px 16px calc(var(--nav-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* Progress bar */
.wp-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wp-progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.wp-progress-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.wp-exit-btn {
  width: 30px; height: 30px;
  border: none; background: none;
  color: var(--text-muted); font-size: 1rem;
  cursor: pointer; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.wp-exit-btn:hover { background: var(--red-light); color: var(--red); }
.wp-counter {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Step indicator — simplified text only */
.wp-steps {
  text-align: center;
  padding: 0 0 4px;
  min-height: 20px;
}
.wp-step-lbl {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); letter-spacing: 0.2px;
}

/* Word card */
.wp-word-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.wp-word-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 10px;
}
.wp-example-context {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
  margin: 4px 0 6px;
  min-height: 0;
}
.wp-word-vi {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.wp-word-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* MCQ options */
.wp-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wp-opt {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.wp-opt:hover:not(:disabled) { border-color: var(--purple); background: var(--purple-light); }
.wp-opt--correct { border-color: var(--green) !important; background: var(--green-light) !important; color: var(--green) !important; }
.wp-opt--wrong   { border-color: var(--red)   !important; background: var(--red-light)   !important; color: var(--red)   !important; }

/* Typing input */
.wp-typing-input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}
.wp-typing-input:focus { border-color: var(--purple); }
.wp-typing-input--correct { border-color: var(--green) !important; background: var(--green-light); }
.wp-typing-input--wrong   { border-color: var(--red)   !important; background: var(--red-light); }

/* Compact feedback — 1 dòng ngay dưới options/input */
.wp-fb-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.4;
  animation: fadeIn 0.15s ease;
}
.wp-fb-compact--ok     { background: rgba(5,150,105,0.08);  color: #065F46; border: 1px solid rgba(5,150,105,0.22); }
.wp-fb-compact--bad    { background: rgba(220,38,38,0.06);  color: #991B1B; border: 1px solid rgba(220,38,38,0.2); }
.wp-fb-compact--almost { background: rgba(217,119,6,0.07);  color: #92400E; border: 1px solid rgba(217,119,6,0.28); }
.wp-fb-compact strong { font-weight: 800; }
.wp-fb-ph { font-size: 0.8rem; opacity: 0.7; margin-left: 2px; }
.wp-progress-note { font-size: 0.82rem; font-weight: 600; color: #92400E; background: rgba(217,119,6,0.1); border-radius: 6px; padding: 5px 10px; margin-bottom: 6px; }

/* Bottom sheet — MCQ feedback nổi lên trên content */
.wp-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
  background: rgba(0,0,0,0.45);
  animation: fadeIn 0.2s ease;
}
.wp-sheet-backdrop.hidden { display: none; }

.wp-quiz-sheet {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 300;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 28px rgba(0,0,0,0.18);
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  max-height: 72vh;
  overflow-y: auto;
  animation: slideUpFade 0.22s ease-out;
}
.dark-mode .wp-quiz-sheet { background: var(--bg); }

/* Compact feedback spacing khi ở trên input */
#wp-typing-feedback:not(.hidden),
#wp-dictation-feedback:not(.hidden) { margin-bottom: 10px; }

/* Nút Tiếp tục — flow tự nhiên sau feedback */
.wp-continue-btn {
  width: 100%;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(14,165,233,0.3);
  transition: opacity 0.15s;
  animation: slideUpFade 0.18s ease;
}
.wp-continue-btn:hover { opacity: 0.9; }
.wp-continue-btn.hidden { display: none; }


/* ── New elements (redesign cấp độ) ────────────────────────────── */
#wp-body {
  width: 100%;
  flex: 1;          /* điền hết chiều cao còn lại trong .wp-wrap */
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Flashcard card mở rộng điền body, căn giữa nội dung theo chiều dọc */
.wp-word-card--expand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Trong focus mode, wp-wrap điền hết chiều cao page */
#app.focus-mode .wp-wrap {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
}
.wp-flash-reveal {
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid var(--purple);
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}
.wp-flash-english {
  font-size: 2rem; font-weight: 800;
  color: var(--purple); margin-bottom: 4px;
}
.wp-flash-ph { font-size: 0.9rem; color: var(--text-muted); }
.wp-flash-def {
  font-size: 0.82rem; color: var(--text-muted);
  margin-top: 6px; font-style: italic;
}
.wp-word-pos {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  color: var(--purple); background: rgba(99,102,241,0.1);
  border-radius: 20px; padding: 2px 10px; margin-top: 4px;
}
/* Fillin flat layout */
.wp-fillin-wrap {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
}
.wp-fillin-instruction {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); text-align: center;
}
.wp-fillin-vi {
  font-size: 1.6rem; font-weight: 800; color: var(--text);
  text-align: center; line-height: 1.25;
}
.wp-fillin-sentence {
  font-size: 1rem; line-height: 2; font-weight: 500;
  color: var(--text); text-align: center;
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 14px 16px;
}

/* Inline input trong câu — thay thế ___ */
.fillin-inline-input {
  display: inline-block;
  width: 110px; min-width: 60px;
  border: none; border-bottom: 2px solid var(--text-muted);
  border-radius: 0; outline: none; background: transparent;
  font-size: 1rem; font-family: inherit; font-weight: 700;
  color: var(--text); text-align: center;
  padding: 0 4px 1px; vertical-align: baseline;
  transition: border-color 0.15s, color 0.15s;
}
.fillin-inline-input:focus { border-bottom-color: var(--purple); color: var(--purple); }
.fillin-inline-input:disabled { opacity: 1; }
.wp-fillin-no-ctx {
  font-size: 0.82rem; color: var(--text-muted);
  text-align: center; font-style: italic;
}
