/* ════════ Learn Tab — Học từ mới (2-column session) ════════ */

/* ── Setup grid: chọn chủ đề ── */
.lp-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.lp-setup-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.lp-setup-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.lp-setup-card--done { opacity: 0.65; }
.lp-setup-card--done:hover { transform: none; box-shadow: none; }

.lp-setup-banner {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lp-setup-emoji { font-size: 2.5rem; }
.lp-setup-info  { padding: 12px 14px; }
.lp-setup-name  { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.lp-setup-count { font-size: 0.78rem; color: var(--text-muted); margin: 4px 0 6px; }
.lp-setup-prog-track { height: 3px; background: var(--border); border-radius: var(--radius-pill); }
.lp-setup-prog-fill  { height: 100%; background: var(--primary); border-radius: var(--radius-pill); }

/* ── Session 2-column layout ── */
.lp-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.lp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Page header row ── */
.lp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lp-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.lp-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.lp-header-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lp-mode-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  background: var(--card);
  cursor: pointer;
}

.lp-dots-btn {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 2px;
  line-height: 1;
}

/* ── Progress card ── */
.lp-prog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.lp-prog-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.lp-prog-row span:last-child {
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}

.lp-prog-track {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 6px;
}

.lp-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.lp-prog-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

/* ── Word card ── */
.lp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.lp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.lp-card-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
}

.lp-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.lp-icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ── Word + image row ── */
.lp-word-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.lp-word-col { flex: 1; min-width: 0; }

.lp-word {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.lp-phonetic-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lp-phonetic {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.lp-accent {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.lp-type-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--border-light);
  color: var(--text-muted);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  font-weight: var(--font-weight-medium);
}

.lp-meaning {
  font-size: 1.05rem;
  font-weight: var(--font-weight-semibold);
  color: var(--primary);
  line-height: 1.4;
}

/* Topic gradient illustration */
.lp-img-col {
  width: 180px;
  height: 150px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lp-img-emoji { font-size: 4rem; filter: drop-shadow(0 4px 12px rgba(0,0,0,.2)); }

/* ── Example box ── */
.lp-example-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.lp-ex-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.lp-ex-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 4px;
}

.lp-hl { font-weight: 700; font-style: normal; color: var(--primary); }

.lp-ex-vi {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Rating buttons ── */
.lp-rating-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.lp-listen-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.lp-listen-btn:hover { border-color: var(--primary); color: var(--primary); }

.lp-rate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid;
  cursor: pointer;
  transition: var(--transition);
  min-height: 56px;
}

.lp-rate-lbl { font-size: 0.875rem; font-weight: var(--font-weight-semibold); }
.lp-rate-sub { font-size: 0.68rem; opacity: 0.75; }

.lp-forgot { background: #FEF2F2; border-color: #FCA5A5; color: #DC2626; }
.lp-forgot:hover { background: #FEE2E2; border-color: #EF4444; }

.lp-hard { background: #FFFBEB; border-color: #FCD34D; color: #D97706; }
.lp-hard:hover { background: #FEF3C7; border-color: #F59E0B; }

.lp-good { background: #ECFDF5; border-color: #6EE7B7; color: #059669; }
.lp-good:hover { background: #D1FAE5; border-color: #10B981; }

/* ── Session word chips ── */
.lp-chips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lp-chips-title { font-size: 0.875rem; font-weight: var(--font-weight-semibold); color: var(--text); }

.lp-see-all {
  font-size: 0.8rem;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: var(--font-weight-medium);
}

.lp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lp-chip {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
}
.lp-chip--current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.lp-chip--done    { background: var(--success-light); border-color: var(--success); color: var(--success-text); }
.lp-chip--again   { background: var(--danger-light);  border-color: var(--danger);  color: var(--danger-text); }
.lp-chip--future  { opacity: 0.45; }

/* ── Right info panel ── */
.lp-info-panel {
  width: 270px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lp-info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.lp-info-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.lp-topic-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 0.875rem;
}
.lp-topic-name { font-weight: var(--font-weight-semibold); color: var(--text); }

.lp-stat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.lp-stat-row  { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-muted); }
.lp-stat-row strong { color: var(--text); font-weight: var(--font-weight-semibold); }

/* ── Learning modes ── */
.lp-mode-list { display: flex; flex-direction: column; gap: 4px; }
.lp-mode-opt  {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
}
.lp-mode-icon { font-size: 1rem; flex-shrink: 0; }
.lp-mode-on   { background: var(--primary-light); color: var(--primary); font-weight: var(--font-weight-semibold); }
.lp-mode-off  { color: var(--text-muted); opacity: 0.65; }

/* ── Memory tip ── */
.lp-tip-card {
  background: linear-gradient(135deg, #FEFBEB, #FEF3C7);
  border-color: #FDE68A;
}
.lp-tip-row  { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.lp-tip-bulb { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.lp-tip-text { font-size: 0.82rem; color: #92400E; line-height: 1.55; }
.lp-tip-dots { display: flex; gap: 5px; justify-content: center; }
.lp-dot      { width: 7px; height: 7px; border-radius: 50%; background: #D1D5DB; }
.lp-dot-active, .lp-dot.active { background: var(--primary); }

/* ── Done screen ── */
.lp-done-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 40px 20px;
}
.lp-done-wrap.hidden { display: none; }

.lp-done-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
}
.lp-done-icon    { font-size: 3.5rem; margin-bottom: 16px; }
.lp-done-title   { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.lp-done-sub     { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 28px; }
.lp-done-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .lp-info-panel { width: 240px; }
  .lp-img-col { width: 140px; height: 120px; }
}

@media (max-width: 900px) {
  .lp-layout { flex-direction: column; }
  .lp-info-panel { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .lp-info-card { flex: 1; min-width: 240px; }
}

@media (max-width: 640px) {
  .lp-word-row { flex-direction: column; }
  .lp-img-col  { width: 100%; height: 120px; }
  .lp-rating-row { flex-wrap: wrap; }
  .lp-listen-btn { width: 100%; justify-content: center; }
  .lp-rate { min-height: 50px; }
  .lp-setup-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lp-done-card { padding: 32px 20px; }
}


/* ════════ Flashcard Session (used by fcSession overlay) ════════ */

.fc-header { margin-bottom: var(--space-4); }

.fc-progress-track {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.fc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.fc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fc-counter {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
}

/* ── Card flip ── */
.flashcard {
  perspective: 1200px;
  max-width: 560px;
  margin: 0 auto var(--space-6);
  cursor: pointer;
  user-select: none;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  padding-top: 55%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard-inner.flipped { transform: rotateY(180deg); }

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}

.flashcard-front {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
}

.flashcard-back {
  background: var(--card);
  border: 1px solid var(--border);
  transform: rotateY(180deg);
  color: var(--text);
}

.fc-type-badge {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  padding: 3px 12px;
  background: var(--white-20);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fc-word {
  font-size: 2.6rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-3);
  text-align: center;
  letter-spacing: -0.5px;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.fc-phonetic {
  font-size: var(--text-base);
  opacity: 0.85;
  margin-bottom: var(--space-3);
}

.fc-hint {
  font-size: var(--text-xs);
  opacity: 0.6;
  margin-top: var(--space-2);
}

.fc-speak-btn {
  background: var(--white-20);
  border: none;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: var(--text-base);
  cursor: pointer;
  color: #fff;
  transition: var(--transition);
  margin-bottom: var(--space-2);
}

.fc-speak-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

.fc-speak-back {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-muted);
  margin-top: var(--space-3);
  margin-bottom: 0;
}

.fc-speak-back:hover { background: rgba(0, 0, 0, 0.13); }

.fc-meaning {
  font-size: 1.7rem;
  font-weight: var(--font-weight-bold);
  color: var(--primary);
  margin-bottom: var(--space-2);
  text-align: center;
}

.fc-divider {
  width: 40px;
  height: 2px;
  background: var(--border);
  border-radius: var(--radius-pill);
  margin: var(--space-3) auto;
}

.fc-example {
  font-size: var(--text-sm);
  color: var(--text);
  text-align: center;
  font-style: italic;
  margin-bottom: 6px;
}

.fc-example-vi {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

.fc-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.fc-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.fc-key-hint {
  font-size: var(--text-xs);
  color: var(--text-light);
  font-style: italic;
}

@media (max-width: 640px) {
  .fc-key-hint { display: none; }
}

/* ── Done screen: stats + again list ── */
.fc-done-stats { margin: var(--space-3) 0; }

.fc-done-stat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.fc-done-stat {
  font-size: var(--text-sm);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-semibold);
}

.fc-done-stat.ok    { background: var(--success-light); color: var(--success-text); }
.fc-done-stat.again { background: var(--danger-light);  color: var(--danger-text); }
.fc-done-stat.score { background: var(--primary-light); color: var(--primary); font-size: 1.1rem; }

.fc-again-section {
  margin: var(--space-4) 0;
  text-align: left;
}

.fc-again-title {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fc-again-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.fc-again-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--danger-light);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.fc-ai-word    { font-weight: var(--font-weight-bold); color: var(--danger-text); }
.fc-ai-meaning { color: var(--text-muted); font-size: var(--text-xs); }


/* ════════ Practice Setup Card ════════ */

.setup-card {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-7);
}

.setup-title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-5);
}

.topic-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.topic-btn {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: var(--card);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  transition: var(--transition);
}

.topic-btn:hover  { border-color: var(--primary); color: var(--primary); }
.topic-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.setup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-2);
}

.setup-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field-label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
}

.radio-group { display: flex; gap: var(--space-4); }

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  cursor: pointer;
  color: var(--text);
}

.setup-grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}
