/* ===== Theme system v20261008d ===== */

html[data-theme="violet"]  { --accent:#c084fc; --accent-2:#a855f7; --accent-glow:rgba(192,132,252,.45); }
html[data-theme="ocean"]   { --accent:#22d3ee; --accent-2:#0891b2; --accent-glow:rgba(34,211,238,.4); }
html[data-theme="rose"]    { --accent:#fb7185; --accent-2:#e11d48; --accent-glow:rgba(244,63,94,.4); }
html[data-theme="emerald"] { --accent:#34d399; --accent-2:#059669; --accent-glow:rgba(16,185,129,.4); }
html[data-theme="sunset"]  { --accent:#fbbf24; --accent-2:#d97706; --accent-glow:rgba(245,158,11,.4); }
html[data-theme="midnight"]{ --accent:#818cf8; --accent-2:#4f46e5; --accent-glow:rgba(99,102,241,.45); }

html[data-mode="night"] {
  --bg-primary:#12101c; --bg-secondary:#1a1625; --bg-card:#221e32;
  --bg-hover:#2c2740; --bg-elevated:#2a2540;
  --text:#faf8ff; --text-secondary:#e9e4f5; --text-muted:#b4a8c9;
  --border:#3a3450; --border-light:#4a4360;
}
html[data-mode="night"] body { background:#12101c; color:#faf8ff; }

html[data-mode="day"] {
  --bg-primary:#f4f1fb; --bg-secondary:#ffffff; --bg-card:#ffffff;
  --bg-hover:#efeaf8; --bg-elevated:#faf8ff;
  --text:#1e1b2e; --text-secondary:#3b3550; --text-muted:#6b6280;
  --border:#ddd6ec; --border-light:#ebe6f5;
  --shadow:0 12px 28px -10px rgba(80,40,140,.12);
}
html[data-mode="day"] body { background:#f4f1fb; color:#1e1b2e; }
html[data-mode="day"] .main-header {
  background:rgba(255,255,255,.92) !important;
  border-bottom:1px solid #ddd6ec;
}
html[data-mode="day"] .main-footer {
  background:#ebe6f5 !important;
  color:#3b3550;
}
html[data-mode="day"] .song-card,
html[data-mode="day"] .stat-item {
  background:#fff !important;
  box-shadow:0 8px 24px rgba(60,40,100,.08);
}

/* Footer FORCE */
.main-footer {
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  margin-top:60px !important;
  padding-bottom:110px !important;
  background:var(--bg-secondary) !important;
  border-top:1px solid var(--border) !important;
  position:relative !important;
  z-index:10 !important;
}
.footer-content {
  display:grid !important;
  grid-template-columns:1.4fr 1fr 1fr;
  gap:32px;
  padding:28px 0 20px;
}
@media(max-width:800px){ .footer-content{ grid-template-columns:1fr !important; } }

/* Countdown - numbers ALWAYS white (banner is dark) */
.countdown {
  display:flex !important;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
  margin:22px 0 !important;
}
.countdown-item {
  min-width:82px;
  padding:18px 14px 14px;
  border-radius:20px;
  background:linear-gradient(165deg, rgba(168,85,247,.35), rgba(0,0,0,.45)) !important;
  border:1px solid rgba(192,132,252,.5) !important;
  text-align:center;
  animation:cdPulse 2.8s ease-in-out infinite;
  box-shadow:0 8px 24px rgba(0,0,0,.3);
}
.countdown-item:nth-child(2){ animation-delay:.15s; }
.countdown-item:nth-child(3){ animation-delay:.3s; }
.countdown-item:nth-child(4){ animation-delay:.45s; }
@keyframes cdPulse {
  0%,100%{ transform:translateY(0); }
  50%{ transform:translateY(-5px); }
}
.countdown-item .cd-icon {
  display:block !important;
  font-size:1rem;
  color:#e9d5ff !important;
  margin-bottom:6px;
}
.countdown-item .num {
  display:block !important;
  font-size:2rem !important;
  font-weight:800 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  font-variant-numeric:tabular-nums;
  line-height:1.1;
  text-shadow:0 0 18px rgba(192,132,252,.6) !important;
  min-height:1.2em;
}
.countdown-item .label {
  display:block !important;
  font-size:.72rem !important;
  margin-top:6px;
  font-weight:600;
  color:#e9d5ff !important;
}

/* Theme FAB */
.theme-fab-wrap {
  position:fixed !important;
  left:16px !important;
  bottom:96px !important;
  z-index:99999 !important;
}
.theme-fab {
  width:56px; height:56px; border-radius:50%; border:none; cursor:pointer;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#fff; font-size:1.35rem;
  box-shadow:0 8px 30px var(--accent-glow);
  animation:fabBeat 2s ease-in-out infinite;
}
@keyframes fabBeat {
  0%,100%{ transform:scale(1); }
  50%{ transform:scale(1.08); }
}
.theme-panel {
  display:none;
  position:absolute; bottom:68px; left:0; width:270px;
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:18px; padding:14px;
  box-shadow:0 16px 40px rgba(0,0,0,.35);
  z-index:100000;
}
.theme-panel.open { display:block !important; }
.theme-panel-head {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:12px; font-weight:700; color:var(--text);
}
.theme-panel-head button {
  background:transparent; border:none; color:var(--text-muted); cursor:pointer; font-size:1.1rem;
}
.theme-mode-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
.mode-btn {
  padding:11px; border-radius:12px; border:1px solid var(--border);
  background:var(--bg-secondary); color:var(--text); cursor:pointer;
  font-family:inherit; font-size:.88rem; font-weight:600;
}
.mode-btn.active {
  border-color:var(--accent); color:var(--accent);
  background:rgba(168,85,247,.15);
}
.theme-label { font-size:.78rem; color:var(--text-muted); margin-bottom:8px; }
.theme-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.theme-swatch {
  border:2px solid var(--border); border-radius:12px; padding:10px 4px;
  background:var(--bg-secondary); cursor:pointer; font-family:inherit;
  font-size:.72rem; color:var(--text-muted);
}
.theme-swatch::before {
  content:''; display:block; width:24px; height:24px; border-radius:50%;
  background:var(--sw); margin:0 auto 6px; box-shadow:0 0 12px var(--sw);
}
.theme-swatch.active { border-color:var(--sw); color:var(--text); }

#headerThemeBtn, #headerModeBtn { color:var(--accent) !important; }

.song-card { transition:transform .3s, box-shadow .3s, border-color .3s !important; }
.song-card:hover {
  transform:translateY(-6px) !important;
  border-color:var(--accent) !important;
  box-shadow:0 16px 36px var(--accent-glow) !important;
}

/* ===== Logo brand ===== */
.logo {
  display: flex !important;
  align-items: center;
  gap: 10px;
  max-width: 220px;
  text-decoration: none !important;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.logo-title {
  font-size: 1.05rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  letter-spacing: -0.02em;
}
.logo-domain {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  opacity: 0.85;
}
.logo-domain::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 5px;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--accent);
  animation: domainPulse 2s ease-in-out infinite;
}
@keyframes domainPulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.logo-icon, .logo-avatar {
  width: 42px; height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
}
.logo-icon {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 1.1rem;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ===== Theme panel FIXED position (always visible) ===== */
.theme-fab-wrap {
  position: fixed !important;
  left: 16px !important;
  bottom: 100px !important;
  z-index: 99999 !important;
  pointer-events: auto !important;
}
.theme-panel {
  display: none;
  position: fixed !important;
  left: 16px !important;
  bottom: 165px !important;
  width: 280px !important;
  background: #1a1625 !important;
  border: 1px solid rgba(192,132,252,0.4) !important;
  border-radius: 20px !important;
  padding: 16px !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 40px rgba(168,85,247,0.2) !important;
  z-index: 100000 !important;
  color: #faf8ff !important;
}
.theme-panel.open {
  display: block !important;
  animation: panelPop .22s ease !important;
}
@keyframes panelPop {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to { opacity: 1; transform: none; }
}
html[data-mode="day"] .theme-panel {
  background: #ffffff !important;
  color: #1e1b2e !important;
  border-color: #ddd6ec !important;
  box-shadow: 0 16px 40px rgba(80,40,140,0.18) !important;
}
.theme-panel-head { color: inherit !important; }
.mode-btn {
  background: rgba(255,255,255,0.06) !important;
  color: inherit !important;
}
html[data-mode="day"] .mode-btn {
  background: #f4f1fb !important;
  color: #1e1b2e !important;
}
.mode-btn.active {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: rgba(168,85,247,0.18) !important;
}
.theme-swatch {
  background: rgba(255,255,255,0.06) !important;
  color: inherit !important;
}
html[data-mode="day"] .theme-swatch {
  background: #f4f1fb !important;
}

/* ===== Listened songs ===== */
.song-card.listened {
  position: relative;
}
.song-card.listened::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--accent);
  opacity: 0.7;
}
.listened-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px var(--accent-glow);
  animation: listenIn .4s ease;
}
@keyframes listenIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: none; }
}
.song-cover.listened-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 40%, rgba(168,85,247,0.35));
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
}
.listened-check {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 6;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 4px 12px var(--accent-glow);
  animation: listenIn .35s ease;
}

/* Global micro animations */
.main-header {
  transition: background .35s, border-color .35s;
}
.stat-item, .song-card, .cat-chip, .quick-btn {
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s, border-color .3s, background .3s !important;
}
.cat-chip:hover, .quick-btn:hover {
  transform: translateY(-3px) scale(1.03);
}

/* ===== Theme panel HARD FIX ===== */
.theme-backdrop {
  display: none;
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.45) !important;
  z-index: 99998 !important;
}
.theme-backdrop.open {
  display: block !important;
}
.theme-fab-wrap {
  position: fixed !important;
  left: 16px !important;
  bottom: 100px !important;
  z-index: 100001 !important;
}
.theme-fab {
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  border: none !important;
  cursor: pointer !important;
  background: linear-gradient(135deg, #a855f7, #7c3aed) !important;
  color: #fff !important;
  font-size: 1.4rem !important;
  box-shadow: 0 8px 28px rgba(168,85,247,0.5) !important;
  pointer-events: auto !important;
  z-index: 100002 !important;
}
#themePanel.theme-panel,
.theme-panel {
  display: none !important;
  position: fixed !important;
  left: 16px !important;
  bottom: 170px !important;
  width: 290px !important;
  max-width: calc(100vw - 32px) !important;
  background: #1e1b2e !important;
  color: #faf8ff !important;
  border: 1px solid rgba(168,85,247,0.45) !important;
  border-radius: 20px !important;
  padding: 16px !important;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55) !important;
  z-index: 100000 !important;
  pointer-events: auto !important;
}
#themePanel.theme-panel.open,
.theme-panel.open {
  display: block !important;
}
html[data-mode="day"] #themePanel.theme-panel,
html[data-mode="day"] .theme-panel {
  background: #ffffff !important;
  color: #1e1b2e !important;
  border-color: #c4b5fd !important;
}
.theme-panel-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 12px !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
}
.theme-panel-head button {
  background: transparent !important;
  border: none !important;
  color: inherit !important;
  cursor: pointer !important;
  font-size: 1.15rem !important;
  opacity: 0.7 !important;
}
.theme-mode-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
}
.mode-btn {
  padding: 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(168,85,247,0.3) !important;
  background: rgba(255,255,255,0.06) !important;
  color: inherit !important;
  cursor: pointer !important;
  font-family: inherit !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
}
.mode-btn.active {
  border-color: #a855f7 !important;
  color: #c084fc !important;
  background: rgba(168,85,247,0.2) !important;
}
.theme-label {
  font-size: 0.78rem !important;
  opacity: 0.7 !important;
  margin-bottom: 8px !important;
}
.theme-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
}
.theme-swatch {
  border: 2px solid rgba(255,255,255,0.12) !important;
  border-radius: 12px !important;
  padding: 10px 4px !important;
  background: rgba(255,255,255,0.05) !important;
  cursor: pointer !important;
  font-family: inherit !important;
  font-size: 0.72rem !important;
  color: inherit !important;
}
.theme-swatch::before {
  content: '' !important;
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: var(--sw) !important;
  margin: 0 auto 6px !important;
  box-shadow: 0 0 12px var(--sw) !important;
}
.theme-swatch.active {
  border-color: var(--sw) !important;
}
