/* ============================================
   FAN DASHBOARD V2 — Two-Column Bento Layout
   ============================================ */

/* Dashboard Container — Two Column Grid */
.fan-dashboard {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  padding: 0 var(--space-md);
  
}

.dash-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* ===== SIDEBAR ===== */
.dash-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
}

/* ---- Dashboard Header ---- */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.dash-header__left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-header__subtitle {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.dash-title {
  color: var(--text-primary);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.dash-header__desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 4px 0 0;
  max-width: 520px;
}

/* ---- Handle Input Bar ---- */
.handle-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 8px 8px 8px 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.handle-bar:focus-within {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.handle-bar__icon {
  color: var(--text-secondary);
  flex-shrink: 0;
  opacity: 0.6;
}

.handle-bar__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.handle-bar__input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  font-family: var(--font-body);
}

.handle-bar__input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.handle-bar__save {
  padding: 10px 24px;
  border-radius: 10px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3px;
  transition: transform 0.1s, opacity 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.handle-bar__save:hover { opacity: 0.85; }
.handle-bar__save:active { transform: scale(0.97); }

/* ---- Bento Stats Grid (4 cards) ---- */
.stats-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.stat-card__icon--episodes { background: rgba(129, 140, 248, 0.12); color: #818cf8; }
.stat-card__icon--hours { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.stat-card__icon--level { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.stat-card__icon--streak { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.stat-card__value {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1px;
}

.stat-card__value--level {
  font-size: 18px;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.stat-card__value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-card__value-unit {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
}

.stat-card__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0.6;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-card__sub {
  font-size: 11px;
  opacity: 0.4;
  margin-top: 4px;
  color: var(--text-primary);
}

/* Accent line on hover */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.stat-card:hover::before { opacity: 1; }
.stat-card--episodes::before { background: linear-gradient(90deg, #818cf8, #6366f1); }
.stat-card--hours::before { background: linear-gradient(90deg, #34d399, #10b981); }
.stat-card--level::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.stat-card--streak::before { background: linear-gradient(90deg, #ef4444, #f97316); }

/* ---- Share Card Section ---- */
.share-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.share-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-section__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.share-section__copy-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
}

.share-section__copy-btn:hover { background: var(--border-color); }
.share-section__copy-btn:active { transform: scale(0.97); }

/* ---- Leaderboard Section ---- */
.leaderboard-section { flex-grow: 1; display: flex; flex-direction: column;
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border-color);
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.leaderboard-header__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.leaderboard-header__live {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Status Banner */
.lb-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-primary);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-primary);
  opacity: 0.85;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.lb-status__mode {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.lb-status__dot--live { background: #10b981; }
.lb-status__dot--local { background: #f59e0b; }
.lb-status__date { font-weight: 800; }

.lb-top-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.lb-top-info__title {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lb-top-info__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0.7;
  background: var(--bg-primary);
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

/* Podium — Top 3 */
.lb-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.lb-podium-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.lb-podium-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.lb-podium-card--gold {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.06) 0%, var(--bg-primary) 100%);
}

.lb-podium-card--silver {
  border-color: rgba(148, 163, 184, 0.4);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.06) 0%, var(--bg-primary) 100%);
}

.lb-podium-card--bronze {
  border-color: rgba(217, 119, 6, 0.3);
  background: linear-gradient(180deg, rgba(180, 83, 9, 0.06) 0%, var(--bg-primary) 100%);
}



.lb-podium__rank { font-size: 26px; font-weight: 900; line-height: 1; }

.lb-podium__rank--gold {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.lb-podium__rank--silver {
  background: linear-gradient(135deg, #94a3b8, #cbd5e1);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.lb-podium__rank--bronze {
  background: linear-gradient(135deg, #b45309, #d97706);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.lb-podium__handle { font-weight: 800; font-size: 13px; color: var(--text-primary); word-break: break-all; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.lb-podium__level { font-size: 10px; font-weight: 600; color: var(--text-secondary); }
.lb-podium__stats { font-weight: 900; font-size: 15px; color: var(--text-primary); margin-top: 2px; }
.lb-podium__hours { font-size: 10px; font-weight: 600; color: var(--text-secondary); }

.lb-you-badge {
  font-size: 9px;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Leaderboard Rows */
.lb-rows { display: flex; flex-direction: column; gap: 6px; }

.lb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  transition: background 0.15s, transform 0.15s;
}

.lb-row:hover { background: var(--border-color); transform: translateX(2px); }

.lb-row--you { border-color: var(--text-primary);  }
.lb-row--you::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #f59e0b, #fbbf24);
}

.lb-row__left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lb-row__rank { font-weight: 900; font-size: 15px; min-width: 32px; color: var(--text-primary); opacity: 0.6; }
.lb-row__info { min-width: 0; }
.lb-row__handle { font-weight: 800; font-size: 13px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.lb-row__level { font-size: 10px; font-weight: 600; color: var(--text-secondary); margin-top: 1px; }
.lb-row__right { text-align: right; flex-shrink: 0; }
.lb-row__count { font-weight: 900; font-size: 13px; color: var(--text-primary); }
.lb-row__hours { font-size: 10px; font-weight: 600; color: var(--text-secondary); margin-top: 1px; }

.lb-your-standing { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-color); }
.lb-your-standing__label { font-size: 11px; font-weight: 700; color: var(--text-primary); opacity: 0.5; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

.lb-empty { padding: 36px 20px; text-align: center; background: var(--bg-primary); border-radius: 14px; border: 1px dashed var(--border-color); font-size: 14px; color: var(--text-primary); opacity: 0.6; line-height: 1.6; }
.lb-loading { padding: 32px; text-align: center; color: var(--text-primary); opacity: 0.5; font-size: 13px; }

/* ===== SIDEBAR COMPONENTS ===== */

/* Brand Card */
.sidebar-brand {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  color: var(--text-primary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.sidebar-brand__header { display: flex; flex-direction: column; gap: 8px; }

.sidebar-brand__badge {
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  width: fit-content;
}

.sidebar-brand__name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.sidebar-brand__name strong { font-weight: 900; }
.sidebar-brand__tagline { font-size: 12px; color: var(--text-secondary); }

.sidebar-brand__episode {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.sidebar-brand__episode:hover { 
  background: var(--bg-primary); 
  border-color: var(--text-primary);
}

.sidebar-brand__play-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--bg-primary);
}

.sidebar-brand__ep-info { min-width: 0; }
.sidebar-brand__ep-label { font-size: 10px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-brand__ep-title { font-size: 14px; font-weight: 800; color: var(--text-primary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand__ep-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-brand__continue {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s, opacity 0.2s;
}

.sidebar-brand__continue:hover { opacity: 0.9; }
.sidebar-brand__continue:active { transform: scale(0.98); }

/* Sidebar Section (Quick Stats / Activity) */
.sidebar-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 20px;
}

.sidebar-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sidebar-section__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Quick Stats */
.quick-stats-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qs-row__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qs-row__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qs-row__icon--episodes { background: rgba(129, 140, 248, 0.12); color: #818cf8; }
.qs-row__icon--hours { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.qs-row__icon--streak { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.qs-row__icon--level { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }

.qs-row__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.qs-row__value {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Activity Timeline */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon--watch { background: rgba(129, 140, 248, 0.12); color: #818cf8; }
.activity-icon--streak { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.activity-icon--level { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }

.activity-info { min-width: 0; padding-top: 2px; }
.activity-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.activity-time { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-top: 2px; }
.activity-empty { font-size: 13px; color: var(--text-secondary); text-align: center; padding: 20px 0; opacity: 0.7; }

/* ---- Entrance Animations ---- */
.dash-animate {
  opacity: 0;
  transform: translateY(16px);
  animation: dashFadeIn 0.5s ease forwards;
}

.dash-main > .dash-animate:nth-child(1) { animation-delay: 0.05s; }
.dash-main > .dash-animate:nth-child(2) { animation-delay: 0.1s; }
.dash-main > .dash-animate:nth-child(3) { animation-delay: 0.15s; }
.dash-main > .dash-animate:nth-child(4) { animation-delay: 0.2s; }
.dash-main > .dash-animate:nth-child(5) { animation-delay: 0.25s; }

.dash-sidebar > .dash-animate:nth-child(1) { animation-delay: 0.15s; }
.dash-sidebar > .dash-animate:nth-child(2) { animation-delay: 0.25s; }
.dash-sidebar > .dash-animate:nth-child(3) { animation-delay: 0.35s; }

@keyframes dashFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .fan-dashboard {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
  }
  .stats-bento {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .fan-dashboard {
    gap: 20px;
    padding: 0 var(--space-sm);
  }

  .stats-bento {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card { padding: 18px 14px; }
  .stat-card__value { font-size: 26px; }
  .stat-card__value--level { font-size: 15px; }

  .lb-podium {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lb-podium-card {
    flex-direction: row;
    text-align: left;
    padding: 14px 16px;
    gap: 14px;
  }

  .leaderboard-section { flex-grow: 1; display: flex; flex-direction: column; padding: 18px 14px; }
  .handle-bar { padding: 6px 6px 6px 14px; }
  .handle-bar__label { display: none; }

  .dash-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dash-title { font-size: 20px; }
  .stat-card { padding: 14px 12px; }
  .stat-card__value { font-size: 22px; }
  .stats-bento { grid-template-columns: 1fr 1fr; }
  .lb-row { padding: 10px 12px; }
  .handle-bar__save { padding: 10px 16px; font-size: 12px; }
}

#leaderboard-list { flex-grow: 1; display: flex; flex-direction: column; }
