﻿/* =============================================================================
   CAYA Charts â€” Billboard-style charts page
   ============================================================================= */

/* â”€â”€ Hero â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.charts-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  color: #fff;
  padding: var(--space-12, 48px) 0 var(--space-8, 32px);
}
.charts-hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-6, 24px);
}
.charts-hero__eyebrow {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #e94560;
  display: block;
  margin-bottom: 4px;
}
.charts-hero__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  margin: 0;
  line-height: 1;
  letter-spacing: -.02em;
  color: #fff;
}
.charts-hero__sub {
  color: rgba(255,255,255,.65);
  font-size: .9375rem;
  margin: var(--space-2, 8px) 0 0;
}
.charts-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4, 16px) var(--space-6, 24px);
  padding-top: var(--space-4, 16px);
  border-top: 1px solid rgba(255,255,255,.1);
}
.charts-hero__stat { display: flex; flex-direction: column; }
.charts-hero__stat-val {
  font-size: 1.375rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.charts-hero__stat-lbl {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-top: 3px;
}

/* â”€â”€ Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.charts-page { padding-top: var(--space-8, 32px); }
.charts-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-8, 32px);
  align-items: start;
}

/* â”€â”€ Tabs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.charts-tabs {
  display: flex;
  gap: 0;
  position: relative;
  margin-bottom: var(--space-4, 16px);
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  /* Border-bottom via pseudo-element so overflow-x:auto can't clip the active underline */
}
.charts-tabs::-webkit-scrollbar { display: none; }
.charts-tabs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-border, #e8e8ec);
  pointer-events: none;
}
.charts-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-3, 12px) var(--space-4, 16px);
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text-muted, #888);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  transition: color .15s;
  flex-shrink: 0;
}
/* Active indicator drawn with ::after so it sits above the container line */
.charts-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 1;
  transition: background .15s;
}
.charts-tab:hover { color: var(--color-primary, #1a1a2e); }
.charts-tab--active {
  color: #e94560;
}
.charts-tab--active::after {
  background: #e94560;
}

/* â”€â”€ Period selector â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.charts-period-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-5, 20px);
  font-size: .8125rem;
}
.charts-period-label {
  color: var(--color-text-muted, #888);
  font-weight: 600;
}
.charts-period-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1.5px solid var(--color-border, #e8e8ec);
  color: var(--color-text-muted, #888);
  text-decoration: none;
  font-size: .75rem;
  font-weight: 600;
  transition: background .12s, color .12s, border-color .12s;
}
.charts-period-btn:hover { border-color: #e94560; color: #e94560; }
.charts-period-btn--active {
  background: #e94560;
  border-color: #e94560;
  color: #fff;
}

/* â”€â”€ Chart list â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.charts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chart-row {
  display: grid;
  grid-template-columns: 44px 68px 1fr 80px 32px;
  align-items: start;
  gap: var(--space-3, 12px);
  padding: 14px var(--space-2, 8px);
  border-radius: var(--radius-md, 8px);
  background: #fff;
  transition: background .12s;
  position: relative;
  min-height: 80px;
}
.chart-row:hover { background: #f8f9fb; }
.chart-row--top3 { background: linear-gradient(90deg, #fffbf0, #fff); }
.chart-row--top3:hover { background: linear-gradient(90deg, #fff5da, #f8f9fb); }

/* Position */
.chart-row__pos {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  flex-shrink: 0;
  align-self: center;
  padding-top: 4px;
}
.chart-pos-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  font-size: .9rem;
  font-weight: 900;
  flex-shrink: 0;
  line-height: 1;
}
.chart-pos-medal--1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #4a2e00; }
.chart-pos-medal--2 { background: linear-gradient(135deg, #C0C0C0, #A8A8A8); color: #1a1a2e; }
.chart-pos-medal--3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }
.chart-pos-num {
  font-size: .875rem;
  font-weight: 700;
  color: var(--color-text-muted, #aaa);
  min-width: 28px;
  text-align: center;
}

/* Thumb */
.chart-row__thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f1f2;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.chart-row__thumb img { width: 100%; height: 100%; object-fit: contain; object-position: center; background: #f0f1f2; display: block; }
.chart-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.4);
  color: #fff;
  font-size: .7rem;
  opacity: 0;
  transition: opacity .15s;
}
.chart-row:hover .chart-thumb-play { opacity: 1; }

/* Info */
.chart-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.chart-row__title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--color-primary, #1a1a2e);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.chart-row__title:hover { color: #e94560; }
.chart-row__artist {
  font-size: .8125rem;
  color: var(--color-text-muted, #888);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.chart-row__artist:hover { color: #e94560; }
.chart-row__meta {
  font-size: .72rem;
  color: var(--color-text-muted, #aaa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score bar */
.chart-row__bar-wrap {
  height: 4px;
  background: #f0f1f2;
  border-radius: 2px;
  overflow: hidden;
}
.chart-row__bar {
  height: 100%;
  background: linear-gradient(90deg, #e94560, #ff7043);
  border-radius: 2px;
  transition: width .4s ease;
  min-width: 2px;
}
.chart-row--top3 .chart-row__bar { background: linear-gradient(90deg, #FFD700, #e94560); }

/* Share button */
.chart-row__share {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s, background .12s;
  min-height: unset;
  min-width: unset;
}
.chart-row:hover .chart-row__share { color: #888; }
.chart-row__share:hover { color: #e94560; background: #fff0f2; }

/* Empty state */
.charts-empty {
  text-align: center;
  padding: var(--space-16, 64px) var(--space-8, 32px);
  color: var(--color-text-muted, #888);
}
.charts-empty span { font-size: 3rem; display: block; margin-bottom: var(--space-4, 16px); }
.charts-empty p { font-size: .9375rem; }

/* â”€â”€ Sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.charts-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: var(--space-5, 20px); }
.charts-sidebar__ad { border-radius: var(--radius-md, 8px); overflow: hidden; }
.charts-sidebar__card {
  background: #fff;
  border: 1px solid var(--color-border, #e8e8ec);
  border-radius: var(--radius-md, 12px);
  padding: var(--space-4, 16px) var(--space-5, 20px);
}
.charts-sidebar__card-title {
  font-size: .875rem;
  font-weight: 800;
  color: var(--color-primary, #1a1a2e);
  margin: 0 0 var(--space-3, 12px);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.charts-sidebar__stats-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
}
.charts-sidebar__stats-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8125rem;
  padding-bottom: var(--space-2, 8px);
  border-bottom: 1px solid #f4f5f7;
}
.charts-sidebar__stats-list li:last-child { border-bottom: none; padding-bottom: 0; }
.charts-sidebar__stat-lbl { color: var(--color-text-muted, #888); }
.charts-sidebar__stats-list strong { font-weight: 700; color: #e94560; }

.charts-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.charts-sidebar__nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-2, 8px) var(--space-3, 12px);
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text-muted, #666);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.charts-sidebar__nav-link:hover { background: #f4f5f7; color: #1a1a2e; }
.charts-sidebar__nav-link.is-active { background: #fff0f2; color: #e94560; }

/* â”€â”€ Responsive â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1024px) {
  .charts-layout { grid-template-columns: 1fr; }
  .charts-sidebar { position: static; }
  .charts-sidebar__card { display: none; } /* show only ad on mobile */
}
@media (max-width: 768px) {
  .chart-row { grid-template-columns: 32px 44px 1fr 0; gap: 8px; }
  .chart-row__bar-wrap { display: none; }
  .chart-row__share { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
  .charts-hero__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* â”€â”€ Access control styles â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Locked tab */
.charts-tab--locked {
  opacity: .6;
  cursor: pointer;
}
.charts-tab--locked:hover {
  color: #888;
  border-bottom-color: transparent;
}

/* Access denied notice */
.charts-access-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: .875rem;
  color: #5d4037;
  margin-bottom: var(--space-4, 16px);
}
.charts-access-notice a { color: #e94560; font-weight: 600; text-decoration: underline; }

/* Blurred revenue stat for non-artists */
.charts-hero__stat-val--locked {
  display: flex;
  align-items: center;
  gap: 8px;
}
.charts-stat-blur {
  filter: blur(5px);
  user-select: none;
  color: rgba(255,255,255,.8);
  font-size: 1.375rem;
  font-weight: 800;
}
.charts-stat-lock-badge {
  font-size: .9rem;
  text-decoration: none;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.charts-stat-lock-badge:hover { background: rgba(255,255,255,.25); }

/* â”€â”€ Login gate overlay â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.charts-gate {
  text-align: center;
  padding: var(--space-16, 64px) var(--space-8, 32px);
  background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%);
  border: 2px dashed var(--color-border, #e8e8ec);
  border-radius: var(--radius-lg, 16px);
  margin: var(--space-4, 16px) 0;
}
.charts-gate__icon { font-size: 2.5rem; margin-bottom: var(--space-3, 12px); }
.charts-gate__title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary, #1a1a2e);
  margin: 0 0 var(--space-3, 12px);
}
.charts-gate__msg {
  font-size: .9375rem;
  color: var(--color-text-muted, #666);
  max-width: 420px;
  margin: 0 auto var(--space-5, 20px);
}
.charts-gate__sub {
  font-size: .8125rem;
  color: var(--color-text-muted, #aaa);
  margin-top: var(--space-3, 12px);
}
.charts-gate__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* â”€â”€ Billboard-style position movement badges â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.chart-move {
  display: block;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
  margin-top: 3px;
  border-radius: 4px;
  padding: 1px 3px;
  line-height: 1.3;
  min-width: 24px;
}
.chart-move--new  { background: #e94560; color: #fff; font-size: .55rem; }
.chart-move--up   { background: #22c55e; color: #fff; }
.chart-move--down { background: #ef4444; color: #fff; }
.chart-move--same { color: #ccc; background: none; font-size: .75rem; }

@media (max-width: 768px) {

/* @media mobile — chart row */
@media (max-width: 768px) {
  .chart-row { grid-template-columns: 44px 56px 1fr 0; }
}

/* Streaming platform icon links */
.chart-row__stream-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.chart-stream-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity .15s, transform .12s;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.chart-stream-icon svg { width: 18px; height: 18px; display: block; flex-shrink: 0; fill: #fff; }
.chart-stream-icon:hover { opacity: .85; transform: scale(1.18); }
