/* ==========================================================================
   HALAMAN: Home / Dashboard — NihongoDo v3
   Mencakup: hero XP bar, kana overview, mastery, review due, daily challenge,
   weak/strong kana, streak, lesson list, heatmap, quick actions.
   ========================================================================== */

/* ─── HERO XP BAR ────────────────────────────────────────── */
.hero-xp-wrap {
  width: 100%;
  max-width: 480px;
  margin: var(--space-3) auto;
}
.hero-xp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.hero-level {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-light);
  background: var(--gold-ghost);
  padding: 2px 8px;
  border-radius: 99px;
}
.hero-xp-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}
.hero-xp-bar-bg {
  height: 6px;
  border-radius: 99px;
  background: var(--ink-4);
  overflow: hidden;
}
.hero-xp-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.6s var(--ease);
}

/* ─── KANA OVERVIEW CARD ─────────────────────────────────── */
.kana-overview-card {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ko-stats {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.ko-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ko-num {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.ko-learned {
  color: var(--gold-light);
}
.ko-mastered {
  color: var(--jade-light);
}
.ko-lbl {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.ko-bar {
  height: 8px;
  border-radius: 99px;
  margin: 0;
}
.ko-scripts {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.ko-script {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--ink-2);
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
  flex: 1;
  min-width: 140px;
}
.ko-script:hover {
  border-color: var(--indigo-light);
  transform: translateY(-1px);
}
.ko-glyph {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  color: var(--indigo-light);
}
.ko-script-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ko-script-name {
  font-weight: 700;
  font-size: 14px;
}
.ko-script-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold-light);
}
.ko-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

/* ─── MASTERY CARD ───────────────────────────────────────── */
.mastery-card {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mc-label-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0;
  font-weight: 600;
  font-family: var(--font-mono);
}
.mc-big {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.mc-num {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--indigo-light);
}
.mc-label-text {
  font-size: 13px;
}
.mc-bar-bg {
  height: 8px;
  border-radius: 99px;
  background: var(--ink-4);
  overflow: hidden;
}
.mc-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--indigo-light);
  transition:
    width 0.6s var(--ease),
    background 0.3s;
}
.mc-desc {
  font-size: 11px;
  margin: 0;
  line-height: 1.5;
}
.mc-btn {
  align-self: flex-start;
  margin-top: 4px;
}

/* ─── REVIEW DUE CARD ────────────────────────────────────── */
.review-due-card {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: 140px;
  justify-content: center;
}
.review-due-card.has-due {
  border-color: var(--shu-dim);
  background: linear-gradient(135deg, var(--ink-2), rgba(200, 69, 46, 0.07));
}
.review-due-card.no-due {
  border-color: var(--jade-dim);
  background: linear-gradient(135deg, var(--ink-2), rgba(0, 180, 120, 0.05));
}
.rdc-icon {
  font-size: 32px;
  line-height: 1;
}
.rdc-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rdc-count {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--shu-light);
  line-height: 1;
}
.rdc-label {
  font-weight: 700;
  font-size: 15px;
}
.rdc-sub {
  font-size: 12px;
}
.rdc-btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ─── DAILY CHALLENGE CARD ───────────────────────────────── */
.daily-challenge-card {
  padding: var(--space-4);
}
.dc-loading {
  color: var(--text-faint);
  font-size: 13px;
  padding: var(--space-2);
}
.dc-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.dc-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}
.dc-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dc-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.dc-desc {
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}
.dc-xp {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
  background: var(--gold-ghost);
  padding: 3px 8px;
  border-radius: 99px;
}
.dc-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.dc-bar {
  flex: 1;
  height: 10px;
  border-radius: 99px;
  background: var(--ink-4);
  overflow: hidden;
}
.dc-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--indigo-light);
  transition: width 0.5s var(--ease);
}
.dc-fill.done {
  background: var(--jade-light);
}
.dc-progress {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}
.dc-claim-btn {
  display: block;
  width: 100%;
  margin-top: var(--space-2);
}
.dc-claimed {
  display: block;
  text-align: center;
  color: var(--jade-light);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-top: var(--space-2);
}
.dc-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

/* ─── WEAK / STRONG KANA ─────────────────────────────────── */
.wk-card {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.wk-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0;
  font-weight: 700;
  font-family: var(--font-mono);
}
.wk-action {
  align-self: flex-start;
}
.wk-empty {
  font-size: 13px;
  margin: 0;
}
.mini-kana-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.mini-kana-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  border: 1px solid var(--border);
}
.mini-kana-card.weak {
  border-color: var(--shu-dim);
}
.mini-kana-card.strong {
  border-color: var(--jade-dim);
}
.mkc-char {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  width: 30px;
  text-align: center;
  flex-shrink: 0;
}
.mkc-romaji {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  width: 36px;
  flex-shrink: 0;
}
.mkc-bar {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--ink-4);
  overflow: hidden;
}
.mkc-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s var(--ease);
}

/* ─── STREAK & AKTIVITAS ─────────────────────────────────── */
.streak-card,
.recent-act-card {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.streak-nums {
  display: flex;
  gap: var(--space-4);
  align-items: flex-end;
}
.streak-num-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.streak-num {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--shu-light);
}
.streak-num-longest {
  font-size: 24px;
  color: var(--text-soft);
}
.streak-unit {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.streak-cal-label {
  font-size: 10px;
  color: var(--text-ghost);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.streak-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.streak-dot {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--ink-4);
}
.streak-dot.active {
  background: var(--jade);
}
.streak-dot.today {
  background: var(--shu);
  box-shadow: 0 0 6px rgba(200, 69, 46, 0.4);
}

/* Aktivitas hari ini */
.activity-today {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.act-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
}

/* ─── LESSON LIST ────────────────────────────────────────── */
.page-home .stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.lesson-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}
.lesson-item:hover {
  border-color: var(--indigo-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.li-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  flex-shrink: 0;
  background: var(--indigo-ghost);
  color: var(--indigo-light);
  transition:
    transform var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.lesson-item:hover .li-icon {
  animation: kfIconSwap 0.45s var(--ease) forwards;
  background: var(--gold-ghost);
  color: var(--gold-light);
}
.lesson-item:hover .li-arrow {
  transform: translateX(3px);
}
.li-arrow {
  transition: transform var(--dur-fast) var(--ease);
  font-size: 20px;
  color: var(--text-ghost);
  flex-shrink: 0;
}
.li-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.li-title {
  font-size: 14px;
  font-weight: 700;
}
.li-desc {
  font-size: 12px;
}
.li-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--ink-4);
  overflow: hidden;
  margin-top: 4px;
}
.li-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--jade-light);
  transition: width 0.4s;
}

/* ─── HEATMAP CARD WRAP ──────────────────────────────────── */
.heatmap-card-wrap {
  overflow-x: auto;
  padding: var(--space-3);
}

/* ─── ACTION CARDS (Quick Actions) ──────────────────────── */
.page-home .action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: var(--space-3);
}
.page-home .act-icon {
  font-size: 28px;
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease);
}
.page-home .action-card:hover .act-icon {
  animation: kfIconSwap 0.45s var(--ease) forwards;
}
.page-home .act-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.page-home .act-desc {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0;
  flex: 1;
  line-height: 1.5;
}
.page-home .action-card .c-button {
  margin-top: auto;
}

/* ─── MODULE CARDS ───────────────────────────────────────── */
.page-home .module-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--space-3);
  text-decoration: none;
  color: inherit;
}
.m-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.m-glyph {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  color: var(--indigo-light);
}
.m-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-faint);
}
.m-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.m-desc {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0;
  line-height: 1.5;
  flex: 1;
}
.m-foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 2px;
}
