/*
 * style-hybrid.css — Hybrid (A + B + C)
 * Sidebar navigation + section accents + Lesson of the Day
 * Loads AFTER style-tuscan.css (which provides base tokens + component styles)
 */

/* ── Section accent palette ──────────────────────────────────────── */
:root {
  --sidebar-w: 220px;
  --c-vocab:   #3ecfc0;   /* teal       */
  --c-verbs:   #e07a5f;   /* terracotta */
  --c-quiz:    #fbbf24;   /* bright amber */
  --c-sent:    #7abf82;   /* sage green  */
  --c-read:    #5bb8a8;   /* seafoam     */
  --c-idioms:  #f5cc6a;   /* warm gold   */
  --c-ref:     #a09070;   /* warm stone  */
}

/* ── Hide old top bars (replaced by sidebar) ─────────────────────── */
.ita-level-bar,
.ita-tabs-bar { display: none !important; }

/* ── Layout shell ────────────────────────────────────────────────── */
.hybrid-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.hybrid-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #0e0c09;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding: 1.25rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hybrid-level-group {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.hybrid-section-label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 0 0 0.4rem 0.15rem;
  opacity: 0.55;
}

.hybrid-levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin-top: 0.25rem;
}
.hybrid-levels .ita-level-btn {
  font-size: 0.78rem;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  width: 100%;
  text-align: center;
}

/* ── Streak in sidebar ───────────────────────────────────────────── */
.hybrid-streak-wrap {
  padding: 0.6rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}
.hybrid-streak-wrap .ita-streak {
  width: 100%;
  justify-content: center;
  border-radius: 8px;
}

/* ── Sidebar nav list ────────────────────────────────────────────── */
.hybrid-nav {
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem;
  flex: 1;
}
.hybrid-nav .hybrid-section-label {
  padding-left: 0.5rem;
  margin-bottom: 0.15rem;
}

.hybrid-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.52rem 0.75rem;
  border-radius: 8px;
  margin: 1px 0;
  color: var(--text-soft) !important;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none !important;
  border-bottom: none !important;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.hybrid-nav-item:hover {
  background: var(--surface-soft);
  color: var(--text) !important;
}
.hybrid-nav-icon {
  font-size: 0.95rem;
  width: 1.3rem;
  text-align: center;
  flex-shrink: 0;
}

/* Active — default (dashboard) uses brand amber */
.hybrid-nav-item.active {
  background: rgba(232, 168, 80, 0.12);
  color: var(--brand) !important;
}

/* Per-section active accents */
.hybrid-nav-item.h-vocab.active       { background: rgba(62,207,192,0.1);  color: var(--c-vocab) !important; }
.hybrid-nav-item.h-verbs.active       { background: rgba(224,122,95,0.1);  color: var(--c-verbs) !important; }
.hybrid-nav-item.h-grammarquiz.active { background: rgba(251,191,36,0.1);  color: var(--c-quiz)  !important; }
.hybrid-nav-item.h-sentences.active   { background: rgba(122,191,130,0.1); color: var(--c-sent)  !important; }
.hybrid-nav-item.h-reading.active     { background: rgba(91,184,168,0.1);  color: var(--c-read)  !important; }
.hybrid-nav-item.h-idioms.active      { background: rgba(245,204,106,0.1); color: var(--c-idioms)!important; }
.hybrid-nav-item.h-grammar.active     { background: rgba(160,144,112,0.1); color: var(--c-ref)   !important; }
.hybrid-nav-item.h-speak.active       { background: rgba(232, 168, 80, 0.12); color: var(--brand)!important; }

/* ── Main content ────────────────────────────────────────────────── */
.hybrid-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem;
  max-width: 960px;
}

/* ── Section accent headings ─────────────────────────────────────── */
#section-vocab       h2 { color: var(--c-vocab);  }
#section-verbs       h2 { color: var(--c-verbs);  }
#section-grammarquiz h2 { color: var(--c-quiz);   }
#section-sentences   h2 { color: var(--c-sent);   }
#section-reading     h2 { color: var(--c-read);   }
#section-idioms      h2 { color: var(--c-idioms); }
#section-grammar     h2 { color: var(--c-ref);    }

/* Section quiz prompt headings */
#section-vocab       .ita-quiz-prompt h2 { color: var(--c-vocab);  }
#section-verbs       .ita-quiz-prompt h2 { color: var(--c-verbs);  }
#section-grammarquiz .ita-quiz-prompt h2 { color: var(--c-quiz);   }
#section-sentences   .ita-quiz-prompt h2 { color: var(--c-sent);   }
#section-reading     .ita-quiz-prompt h2 { color: var(--c-read);   }
#section-idioms      .ita-quiz-prompt h2 { color: var(--c-idioms); }

/* Top-border accent on content cards per section */
#section-vocab       .content-card { border-top: 3px solid var(--c-vocab)  !important; }
#section-verbs       .content-card { border-top: 3px solid var(--c-verbs)  !important; }
#section-grammarquiz .content-card { border-top: 3px solid var(--c-quiz)   !important; }
#section-sentences   .content-card { border-top: 3px solid var(--c-sent)   !important; }
#section-reading     .content-card { border-top: 3px solid var(--c-read)   !important; }
#section-idioms      .content-card { border-top: 3px solid var(--c-idioms) !important; }

/* ── Lesson of the Day widget ────────────────────────────────────── */
.ls-lotd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 0 14px 14px 0;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}
.ls-lotd-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.ls-lotd-header h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand);
  margin: 0;
}
.ls-lotd-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--brand);
  color: #12100e;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.ls-lotd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.ls-lotd-word {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
}
.ls-lotd-word .ls-word-it {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}
.ls-lotd-word .ls-word-en {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 2px;
}
.ls-lotd-grammar {
  background: rgba(232, 168, 80, 0.08);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
  color: var(--text-soft);
}
.ls-lotd-grammar strong { color: var(--brand); }
.ls-lotd-idiom {
  background: rgba(232, 168, 80, 0.05);
  border: 1px solid rgba(232, 168, 80, 0.2);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-soft);
}
.ls-lotd-idiom strong { font-style: normal; color: var(--text); }
/* Grammar accordion card nested inside LOTD */
.ls-lotd .ls-lotd-grammar-card {
  background: transparent;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  margin-top: 0.75rem;
}
.ls-lotd-grammar-toggle {
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 6px;
  padding: 0.35rem 0.4rem !important;
  transition: background 0.15s;
  user-select: none;
}
.ls-lotd-grammar-toggle:hover {
  background: rgba(232, 168, 80, 0.07);
}
.lotd-expand-icon {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
  background: rgba(232, 168, 80, 0.12);
  border: 1px solid rgba(232, 168, 80, 0.3);
  border-radius: 999px;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.ls-lotd-grammar-toggle:hover .lotd-expand-icon {
  background: rgba(232, 168, 80, 0.22);
}
.ls-lotd-footer {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-soft);
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Mobile bottom nav ───────────────────────────────────────────── */
.hybrid-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: #0e0c09;
  border-top: 1px solid var(--border);
}
.hybrid-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem 0.4rem;
  color: var(--text-soft) !important;
  font-size: 1.2rem;
  text-decoration: none !important;
  border-bottom: none !important;
  flex: 1;
  transition: color 0.15s;
}
.hybrid-bnav-item small {
  font-size: 0.58rem;
  margin-top: 1px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}
.hybrid-bnav-item.active                          { color: var(--brand)    !important; }
.hybrid-bnav-item.active small                    { color: var(--brand); }
.hybrid-bnav-item.h-vocab.active,
.hybrid-bnav-item.h-vocab.active small             { color: var(--c-vocab)  !important; }
.hybrid-bnav-item.h-verbs.active,
.hybrid-bnav-item.h-verbs.active small             { color: var(--c-verbs)  !important; }
.hybrid-bnav-item.h-grammarquiz.active,
.hybrid-bnav-item.h-grammarquiz.active small       { color: var(--c-quiz)   !important; }
.hybrid-bnav-item.h-reading.active,
.hybrid-bnav-item.h-reading.active small           { color: var(--c-read)   !important; }
.hybrid-bnav-item.h-grammar.active,
.hybrid-bnav-item.h-grammar.active small           { color: var(--c-ref)    !important; }

/* ── Responsive breakpoints ──────────────────────────────────────── */
/* ── Mobile level strip (only visible on mobile) ────────────────── */
.hybrid-mobile-levels {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.hybrid-mobile-levels .hybrid-section-label {
  white-space: nowrap;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .hybrid-sidebar       { display: none; }
  .hybrid-bottom-nav    { display: flex; }
  .hybrid-mobile-levels { display: flex; }
  .hybrid-main {
    padding: 1rem;
    padding-bottom: 80px;
  }
  .hybrid-layout { min-height: auto; }
  .ls-lotd-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (min-width: 769px) {
  .hybrid-bottom-nav { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════════
   Phase 3 — Engagement & Gamification
   ══════════════════════════════════════════════════════════════════ */

/* ── Sidebar: leaderboard nav accent ────────────────────────────── */
.hybrid-nav-item.h-leaderboard.active {
  background: rgba(251,191,36,0.12);
  color: #fbbf24 !important;
}

/* ── Stat sub-label (XP into level, streak best) ────────────────── */
.p3-stat-sub {
  font-size: 0.72rem;
  color: var(--text-soft);
  margin-top: 2px;
  opacity: 0.7;
}

/* ── Flame icon — animated when streak > 1 ──────────────────────── */
.p3-flame {
  font-size: 1.5rem;
  line-height: 1;
  display: block;
}
@keyframes p3-flicker {
  0%,100% { transform: scale(1)   rotate(-3deg); }
  25%      { transform: scale(1.1) rotate(3deg);  }
  50%      { transform: scale(1.05) rotate(-2deg); }
  75%      { transform: scale(1.12) rotate(2deg);  }
}
.p3-flame-lit {
  animation: p3-flicker 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(251,191,36,0.6));
}

/* ── Daily goal card — met state ────────────────────────────────── */
.p3-goal-met {
  border-color: rgba(74,222,128,0.35) !important;
  background: rgba(74,222,128,0.06) !important;
}

/* ── Celebration pulse on goal card ─────────────────────────────── */
@keyframes p3-celebrate-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); transform: scale(1); }
  50%  { box-shadow: 0 0 0 12px rgba(74,222,128,0); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); transform: scale(1); }
}
.p3-goal-celebrate {
  animation: p3-celebrate-pulse 0.6s ease-out 2;
}

/* ── Goal-not-met nudge banner ──────────────────────────────────── */
.p3-goal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(232,168,80,0.1);
  border: 1px solid rgba(232,168,80,0.25);
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--text);
}
.p3-goal-banner-close {
  background: none;
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.2rem;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.p3-goal-banner-close:hover { opacity: 1; }

/* ── Achievement shelf ──────────────────────────────────────────── */
.p3-achievement-shelf {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
}
.p3-shelf-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.p3-shelf-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  opacity: 0.6;
}
.p3-shelf-count {
  font-size: 0.72rem;
  color: var(--brand);
  font-weight: 600;
}
.p3-shelf-scroll {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.p3-shelf-scroll::-webkit-scrollbar { display: none; }
.p3-badge {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 1px solid var(--border);
  cursor: default;
  transition: transform 0.15s;
}
.p3-badge:hover { transform: scale(1.15); }
.p3-badge-unlocked {
  background: rgba(232,168,80,0.1);
  border-color: rgba(232,168,80,0.3);
}
.p3-badge-locked {
  opacity: 0.3;
  filter: grayscale(1);
}

/* ── Daily goal selector ────────────────────────────────────────── */
.p3-goal-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.p3-goal-selector-label {
  font-size: 0.8rem;
  color: var(--text-soft);
}
.p3-goal-btn-group {
  display: flex;
  gap: 0.3rem;
}
.p3-goal-btn {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.p3-goal-btn:hover {
  background: rgba(232,168,80,0.1);
  color: var(--brand);
  border-color: rgba(232,168,80,0.3);
}
.p3-goal-btn.active {
  background: rgba(232,168,80,0.15);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}

/* ── Celebration toast ──────────────────────────────────────────── */
.p3-celebrate-toast {
  background: linear-gradient(135deg, #166534, #15803d);
  color: #fff;
}

/* ── Leaderboard table ──────────────────────────────────────────── */
.p3-lb-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-soft);
  border-color: var(--border) !important;
}
.p3-lb-table td {
  border-color: var(--border) !important;
  vertical-align: middle;
}
.p3-lb-me td { background: rgba(232,168,80,0.06) !important; }
.p3-lb-you {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--brand);
  color: #12100e;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  vertical-align: middle;
  margin-left: 0.35rem;
}

@media (max-width: 768px) {
  .p3-goal-selector { justify-content: center; }
  .p3-badge { width: 2rem; height: 2rem; font-size: 1rem; }
}

/* ══════════════════════════════════════════════════════════════════
   Phase 4 — SRS Spaced Repetition Review
   ══════════════════════════════════════════════════════════════════ */

/* Sidebar accent for Review tab */
.hybrid-nav-item.h-review.active {
  background: rgba(99,102,241,0.12);
  color: #818cf8 !important;
}

/* Due-count badge in sidebar */
.srs-badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  min-width: 1.3rem;
  text-align: center;
}

/* Progress row at top of SRS session */
.srs-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.srs-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
}

/* Flashcard */
.srs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.25s, border-color 0.25s;
}
.srs-card.srs-flipped {
  border-color: rgba(129,140,248,0.35);
  background: rgba(99,102,241,0.05);
}

.srs-front-text {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.srs-lapse-note {
  font-size: 0.72rem;
  color: #ef4444;
  margin-top: 0.5rem;
  display: block;
}

.srs-card-back {
  margin-top: 1.5rem;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.srs-back-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  opacity: 0.6;
  margin-bottom: 0.4rem;
}
.srs-back-text {
  font-size: 1.5rem;
  color: #818cf8;
  font-weight: 600;
}

/* Action buttons */
.srs-btn-flip {
  background: rgba(232,168,80,0.12);
  border: 1px solid rgba(232,168,80,0.3);
  color: var(--brand);
  font-weight: 600;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  transition: background 0.15s;
}
.srs-btn-flip:hover {
  background: rgba(232,168,80,0.22);
  color: var(--brand);
}

.srs-btn-again {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.75rem;
  transition: background 0.15s;
}
.srs-btn-again:hover {
  background: rgba(239,68,68,0.2);
  color: #fca5a5;
}

.srs-btn-good {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.75rem;
  transition: background 0.15s;
}
.srs-btn-good:hover {
  background: rgba(34,197,94,0.2);
  color: #86efac;
}

/* Dashboard SRS call-to-action card */
.srs-dash-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(99,102,241,0.07);
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 3px solid #818cf8;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.srs-dash-card:hover {
  background: rgba(99,102,241,0.13);
}
.srs-dash-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.srs-dash-info {
  flex: 1;
  min-width: 0;
}
.srs-dash-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.srs-dash-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 1px;
}
.srs-dash-arrow {
  color: #818cf8;
  font-size: 1.1rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .srs-front-text { font-size: 1.5rem; }
  .srs-back-text  { font-size: 1.2rem; }
}
