*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --accent: #f5c518;
  --bg-glass: rgba(0,0,0,0.45);
  --bg-glass-light: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.12);
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.55);
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: #0a0a0f;
  overflow-x: hidden;
}

/* BACKGROUND */
.bg-video {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: brightness(0.45) saturate(1.2);
}

.bg-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.6) 100%);
  transition: background 0.8s ease;
}

/* TOPBAR */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  background: transparent;
}

.topbar-time {
  font-size: 0.9rem;
  font-weight: 300;
  opacity: 0.8;
  letter-spacing: 0.05em;
}

.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.8;
  white-space: nowrap;
}

.live-dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}
.live-dot.hidden {
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.topbar-right {
  display: flex;
  gap: 0.75rem;
}

.icon-btn {
  background: var(--bg-glass-light);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.15); }

/* VIBE TOGGLE CAPSULE */
.vibe-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(18,18,28,0.55), rgba(18,18,28,0.55)) padding-box,
    linear-gradient(140deg, rgba(255,255,255,0.5), rgba(255,255,255,0.06) 45%, rgba(255,255,255,0.28)) border-box;
  color: var(--text);
  padding: 0.4rem 0.7rem;
  border-radius: 24px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow:
    0 6px 20px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.22);
  transition: all 0.25s;
  max-width: 200px;
}
.vibe-toggle:hover { box-shadow: 0 6px 26px rgba(245,197,24,0.28), inset 0 1px 0 rgba(255,255,255,0.3); }
.vibe-toggle-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vibe-toggle-caret { opacity: 0.6; font-size: 0.65rem; }

/* HERO */
.hero {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  text-align: center;
  padding: 0 1rem;
}

.vibe-label {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 1rem;
}

.vibe-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 4px 32px rgba(0,0,0,0.5);
  margin-bottom: 1.5rem;
  transition: opacity 0.4s;
}

.vibe-quote {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 300;
  opacity: 0.7;
  font-style: italic;
  letter-spacing: 0.02em;
}

/* VIBE SELECTOR */
.vibe-selector {
  position: fixed;
  right: 1.5rem;
  top: 4.4rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(18,18,28,0.55), rgba(18,18,28,0.55)) padding-box,
    linear-gradient(140deg, rgba(255,255,255,0.5), rgba(255,255,255,0.06) 45%, rgba(255,255,255,0.28)) border-box;
  border-radius: 18px;
  padding: 0.4rem;
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow:
    0 10px 34px rgba(0,0,0,0.38),
    inset 0 1px 0 rgba(255,255,255,0.22);
  width: max-content;
  max-width: 220px;
}

.vibe-selector {
  position: fixed;
  right: 1.5rem;
  top: 4.4rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(18,18,28,0.55), rgba(18,18,28,0.55)) padding-box,
    linear-gradient(140deg, rgba(255,255,255,0.5), rgba(255,255,255,0.06) 45%, rgba(255,255,255,0.28)) border-box;
  border-radius: 18px;
  padding: 0.4rem;
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow:
    0 10px 34px rgba(0,0,0,0.38),
    inset 0 1px 0 rgba(255,255,255,0.22);
  width: max-content;
  max-width: 220px;
}

.vibe-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s;
  text-align: center;
  opacity: 0.8;
}
.vibe-btn:hover { opacity: 1; background: rgba(255,255,255,0.14); }
.vibe-btn.active {
  opacity: 1;
  border-color: rgba(245,197,24,0.7);
  color: var(--accent);
  background: rgba(245,197,24,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

/* FLOATING PLAYER */
.player {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(10,10,15,0.85);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px);
  border-radius: 50px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 460px;
  max-width: 600px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.player-thumb {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  margin-right: 0.5rem;
}
.player-thumb.spinning {
  animation: spin 3s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.player-info { flex: 1; min-width: 0; }
.player-title {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-source { font-size: 0.7rem; opacity: 0.5; margin-top: 2px; }

.player-time-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.2rem;
}

.player-time { font-size: 0.72rem; opacity: 0.5; white-space: nowrap; }

.seek-btn {
  background: var(--bg-glass-light);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  opacity: 0.8;
}
.seek-btn img { width: 20px; height: 20px; filter: brightness(0) invert(1); }
.seek-btn:hover { background: rgba(255,255,255,0.15); opacity: 1; }

.player-controls { display: flex; align-items: center; gap: 0.25rem; }

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  opacity: 0.8;
  position: relative;
}
.ctrl-btn:hover { background: rgba(255,255,255,0.1); opacity: 1; }

.ctrl-btn::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(20,20,30,0.92);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  border: 1px solid rgba(255,255,255,0.1);
}
.ctrl-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ctrl-play { font-size: 1.1rem; background: rgba(255,255,255,0.1); opacity: 1; }
.ctrl-shuffle { font-size: 0.85rem; opacity: 0.5; }
.ctrl-shuffle.active { opacity: 1; color: var(--accent); }

.player-progress-wrap {
  position: absolute;
  bottom: 0; left: 12px; right: 12px;
}
.player-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: visible;
  position: relative;
}
.player-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  border-radius: 2px;
  transition: width 0.1s linear;
}
.player-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s, left 0.1s linear;
}
.player-progress-bar:not(:hover) .player-progress-thumb:not(.dragging) {
  pointer-events: none;
}
.player-progress-bar:hover .player-progress-thumb,
.player-progress-bar.dragging .player-progress-thumb {
  opacity: 1;
}
.player-progress-thumb.dragging {
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 4px 12px rgba(245,197,24,0.5);
}

/* PLAYLIST SECTION */
.playlist-section {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  padding: 6rem 1rem 8rem;
  background: linear-gradient(180deg, transparent 0%, rgba(5,5,15,0.95) 15%);
}

.playlist-inner {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  padding: 1.5rem;
}

.song-list {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.song-list::-webkit-scrollbar {
  width: 6px;
}
.song-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
}
.song-list::-webkit-scrollbar-thumb {
  background: rgba(245,197,24,0.5);
  border-radius: 3px;
}
.song-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  opacity: 0.9;
  text-align: center;
}

/* SONG ROWS */
.song-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
}
.song-row:hover { background: rgba(255,255,255,0.09); }
.song-row.playing {
  border-color: var(--accent);
  background: rgba(245,197,24,0.08);
}

.song-thumb {
  width: 42px; height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #1a1a2e;
  flex-shrink: 0;
}

.song-name {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.song-row.playing .song-name { color: var(--accent); }

.song-playing-badge {
  font-size: 0.65rem;
  color: var(--accent);
  white-space: nowrap;
}

.song-add-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--text);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.song-add-btn:hover { background: rgba(255,255,255,0.18); }

/* QUEUE */
.queue-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.queue-badge {
  background: var(--accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.queue-hint { font-size: 0.8rem; opacity: 0.5; margin-bottom: 0.75rem; text-align: center; }

.queue-empty {
  font-size: 0.85rem;
  opacity: 0.4;
  margin-bottom: 1rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 2rem 1rem;
}

.queue-actions { display: flex; gap: 0.75rem; margin-top: 1rem; justify-content: center; }

.queue-btn {
  background: transparent;
  border: 1px solid;
  color: var(--text);
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s;
}
.queue-play { border-color: var(--accent); color: var(--accent); }
.queue-play:hover { background: rgba(245,197,24,0.1); }
.queue-clear { border-color: #f87171; color: #f87171; }
.queue-clear:hover { background: rgba(248,113,113,0.1); }



/* RESPONSIVE */
@media (max-width: 600px) {
  .player { min-width: unset; width: calc(100vw - 2rem); border-radius: 20px; flex-wrap: wrap; }
  .player-time { display: none; }
  .vibe-selector { right: 0.75rem; }
  .topbar { padding: 1rem; }
}
