﻿/* === dashboard === */
/* ════════ Dashboard — 2-column redesign ════════ */

/* ── Mobile header (shown on mobile only) ── */
.dash-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.dash-header-left { display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0; }
.dash-greeting-wrap { flex: 1; min-width: 0; }

.dash-greeting {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text);
  line-height: 1.3;
}

.dash-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.dash-streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #F59E0B;
  color: #92400E;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
}

.dash-streak-label { font-weight: var(--font-weight-medium); }
.dash-theme-toggle { width: 34px; height: 34px; }

/* ── 2-column layout (desktop) ── */
.dash-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.dash-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-stats-panel {
  width: 296px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  scrollbar-width: none;
}

.dash-stats-panel::-webkit-scrollbar { display: none; }

/* ── Hero banner ── */
.dash-hero {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: linear-gradient(135deg, #F0EEFF 0%, #E8F4FF 60%, #EEF2FF 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-7);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .dash-hero {
  background: linear-gradient(135deg, #1E1B4B 0%, #1A2540 60%, #1E293B 100%);
  border-color: rgba(99, 102, 241, 0.2);
}

.dash-hero-content { flex: 1; min-width: 0; z-index: 1; }

.dash-hero-eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.dash-hero-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.dash-hero-accent {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--primary);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.dash-hero-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.dash-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.dash-hero-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.dash-hero-illus {
  font-size: 5rem;
  flex-shrink: 0;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.25));
  animation: heroFloat 3s ease-in-out infinite;
  user-select: none;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── Quick action cards ── */
.dash-qa-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.dash-qa-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.dash-qa-card:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.dash-qa-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  line-height: 1;
  flex-shrink: 0;
}

.dash-qa-info { display: flex; flex-direction: column; gap: 2px; }

.dash-qa-title {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text);
  white-space: nowrap;
}

.dash-qa-sub {
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Section header ── */
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-section-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  color: var(--text);
}

.dash-see-all {
  background: none;
  border: none;
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.dash-see-all:hover { background: var(--primary-light); }

/* ── Word of the day (3-column) ── */
.dash-wotd-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  min-height: 160px;
}

.dash-wotd-img {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-wotd-img-emoji {
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2));
}

.dash-wotd-body {
  flex: 1;
  padding: var(--space-4);
  min-width: 0;
  border-right: 1px solid var(--border);
}

.dash-wotd-badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
}

.dash-wotd-word {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text);
  margin-bottom: 4px;
}

.dash-wotd-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.dash-wotd-phonetic {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
}

.dash-wotd-speak {
  background: none;
  border: none;
  font-size: var(--text-base);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: var(--transition);
}

.dash-wotd-speak:hover { transform: scale(1.15); }

.dash-wotd-type {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  background: var(--info-light);
  color: var(--info-text);
  margin-bottom: var(--space-2);
}

.dash-wotd-meaning {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.dash-wotd-ex {
  width: 200px;
  flex-shrink: 0;
  background: var(--primary-light);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
}

.dash-wotd-ex-label {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--primary);
}

.dash-wotd-ex-text {
  font-size: var(--text-xs);
  color: var(--text);
  line-height: 1.6;
  font-style: italic;
}

.dash-wotd-ex-vi {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Popular topics ── */
.dash-pop-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.dash-pop-scroll::-webkit-scrollbar { display: none; }

.dash-pop-card {
  width: 140px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
  text-align: left;
}

.dash-pop-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.dash-pop-banner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-pop-emoji {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.dash-pop-info {
  padding: 10px 12px 12px;
  background: var(--card);
}

.dash-pop-name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-pop-stat {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dash-pop-prog {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.dash-pop-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

/* ── Streak card (right panel) ── */
.dash-streak-card {
  background: linear-gradient(135deg, #FFFBEB, #FFF7ED);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
}

[data-theme="dark"] .dash-streak-card {
  background: linear-gradient(135deg, #1C1407, #1A1500);
  border-color: #78350F;
}

.dash-streak-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.dash-streak-fire-big { font-size: 2.4rem; line-height: 1; }

.dash-streak-nums { display: flex; flex-direction: column; line-height: 1; }

.dash-streak-num {
  font-size: 2rem;
  font-weight: 800;
  color: #92400E;
  line-height: 1;
}

[data-theme="dark"] .dash-streak-num { color: #FBBF24; }

.dash-streak-numlabel {
  font-size: var(--text-xs);
  color: #B45309;
  font-weight: var(--font-weight-medium);
  margin-top: 2px;
}

[data-theme="dark"] .dash-streak-numlabel { color: #D97706; }

.dash-streak-sub {
  font-size: var(--text-xs);
  color: #B45309;
  margin-bottom: 12px;
  line-height: 1.4;
}

[data-theme="dark"] .dash-streak-sub { color: #D97706; }

/* Week row */
.dash-week-row {
  display: flex;
  gap: 4px;
}

.dash-week-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.5);
}

[data-theme="dark"] .dash-week-cell { background: rgba(255,255,255,0.05); }

.dash-week-cell--today {
  background: rgba(245,158,11,0.2);
  border: 1px solid #FCD34D;
}

.dash-week-cell--done { background: rgba(245,158,11,0.12); }

.dash-week-lbl {
  font-size: 0.58rem;
  font-weight: var(--font-weight-bold);
  color: #92400E;
  text-transform: uppercase;
}

[data-theme="dark"] .dash-week-lbl { color: #D97706; }

.dash-week-ico {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
}

.dash-week-cell--done .dash-week-ico { color: inherit; }

/* ── Daily goal card (right panel) ── */
.dash-goal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
}

.dash-goal-card-title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text);
  margin-bottom: var(--space-3);
}

.dash-goal-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dash-goal-ring-wrap {
  position: relative;
  flex-shrink: 0;
  width: 110px;
  height: 110px;
}

.dash-goal-ring-wrap svg { transform: rotate(-90deg); }

.dash-goal-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.dash-goal-ring-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.dash-goal-ring-sub {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
  text-align: center;
}

.dash-goal-info { flex: 1; min-width: 0; }

.dash-goal-status {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text);
  margin-bottom: 4px;
}

.dash-goal-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

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

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

.dash-goal-btn {
  font-size: var(--text-xs);
  min-height: 36px;
  width: 100%;
  margin-top: var(--space-2);
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 3px 10px rgba(79,70,229,0.3);
}

.dash-goal-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ── Study calendar ── */
.dash-cal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
}

.dash-cal-header { margin-bottom: 12px; }

.dash-cal-title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text);
}

.dash-cal-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.dash-cal-lbl {
  text-align: center;
  font-size: 0.58rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-muted);
  padding: 2px 0;
}

.dash-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dash-cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  font-size: 0.65rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  line-height: 1;
  min-height: 26px;
}

.dash-cal-day--today {
  background: var(--primary);
  color: #fff;
  font-weight: var(--font-weight-bold);
}

.dash-cal-day--active:not(.dash-cal-day--today) {
  color: var(--primary);
  font-weight: var(--font-weight-semibold);
}

.dash-cal-dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--success);
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.dash-cal-day--today .dash-cal-dot { background: rgba(255,255,255,0.8); }

.dash-cal-day--other {
  color: var(--text-light);
  opacity: 0.35;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .dash-stats-panel { width: 260px; }
  .dash-wotd-ex { width: 160px; }
}

@media (max-width: 1050px) {
  .dash-layout { flex-direction: column; }
  .dash-stats-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .dash-streak-card,
  .dash-goal-card,
  .dash-cal-card { flex: 1; min-width: 220px; }
  .dash-qa-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 780px) {
  .dash-qa-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-wotd-ex { display: none; }
  .dash-wotd-img { width: 110px; }
}

@media (max-width: 640px) {
  .dash-header { display: flex; }
  .dash-layout { gap: 16px; }
  .dash-content { gap: 14px; }
  .dash-stats-panel { flex-direction: column; }
  .dash-streak-card, .dash-goal-card, .dash-cal-card { min-width: 0; }
  .dash-qa-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .dash-hero { padding: var(--space-5); gap: var(--space-3); border-radius: var(--radius-lg); }
  .dash-hero-title { font-size: 1.5rem; }
  .dash-hero-accent { font-size: var(--text-sm); }
  .dash-hero-desc { font-size: var(--text-xs); margin-bottom: var(--space-3); }
  .dash-hero-illus { font-size: 3.5rem; }
  .dash-wotd-img { width: 90px; }
  .dash-wotd-img-emoji { font-size: 2.5rem; }
  .dash-pop-card { width: 120px; }
}

