/* ===== CSS VARIABLES / THEMES ===== */
:root {
  --bg: #0d0d0d;
  --bg2: #121212;
  --surface: #181818;
  --surface2: #232323;
  --surface3: #2a2a2a;
  --border: #2a2a2a;
  --text: #ffffff;
  --text-muted: #b3b3b3;
  --text-dim: #6a6a6a;
  --accent: #1db954;
  --accent-hover: #1ed760;
  --accent2: #1a73e8;
  --danger: #e84b4b;
  --sidebar-w: 240px;
  --player-h: 90px;
  --radius: 8px;
  --transition: 0.2s ease;
}

body.light-theme {
  --bg: #f0f2f5;
  --bg2: #ffffff;
  --surface: #ffffff;
  --surface2: #f0f2f5;
  --surface3: #e4e6ea;
  --border: #dde1e7;
  --text: #1c1c1e;
  --text-muted: #4a4a4a;
  --text-dim: #888888;
  --accent: #1db954;
  --accent-hover: #18a348;
}

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

html { font-size: 15px; }

body {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  grid-template-areas:
    "sidebar main"
    "player  player";
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ===== SIDEBAR ===== */
.sidebar {
  grid-area: sidebar;
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  gap: 4px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 16px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
  user-select: none;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-item.active {
  color: var(--text);
  background: var(--surface2);
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 18px 12px 6px;
  text-transform: uppercase;
}

.sidebar-playlists {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.playlist-item {
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.playlist-item:hover {
  color: var(--text);
  background: var(--surface);
}

.create-playlist-btn {
  margin-top: auto;
  padding: 10px 12px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.create-playlist-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-nav { display: flex; gap: 6px; }

.nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.nav-btn:hover { background: var(--surface3); color: var(--text); }

.search-container {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 0 14px;
  gap: 8px;
  transition: border-color var(--transition);
}

.search-container:focus-within {
  border-color: var(--accent);
}

.search-icon { color: var(--text-dim); flex-shrink: 0; }

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 8px 0;
}

.search-input::placeholder { color: var(--text-dim); }

.search-btn {
  padding: 6px 14px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}

.search-btn:hover { background: var(--accent-hover); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  background: var(--surface2);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition);
}

.theme-toggle:hover { background: var(--surface3); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== PAGES ===== */
.page {
  display: none;
  flex: 1;
  overflow-y: auto;
}

.page.active { display: flex; flex-direction: column; }

.page-content {
  padding: 28px 24px 120px;
  max-width: 1400px;
}

/* ===== HERO ===== */
.hero-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

body.light-theme .hero-section {
  background: linear-gradient(135deg, #1db954 0%, #1a73e8 100%);
}

.hero-section::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(29,185,84,0.25) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-text h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.hero-text p {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
}

/* ===== SECTIONS ===== */
.section { margin-bottom: 36px; }

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

.section-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.see-all {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--transition);
}

.see-all:hover { color: var(--text); }

/* ===== CARD GRID ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.track-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.track-card:hover {
  background: var(--surface2);
  transform: translateY(-2px);
}

.track-card:hover .card-play-btn { opacity: 1; transform: translateY(0); }

.card-art-wrap {
  position: relative;
  margin-bottom: 12px;
}

.card-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface2);
  display: block;
}

.card-play-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.card-play-btn svg { fill: #000; margin-left: 2px; }

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.card-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  letter-spacing: 0.5px;
}

.badge-deezer { background: rgba(255,0,92,0.85); }
.badge-itunes { background: rgba(252,88,45,0.85); }
.badge-jamendo { background: rgba(29,185,84,0.85); color: #000; }

/* ===== SKELETONS ===== */
@keyframes shimmer {
  0% { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton-card, .skeleton-row {
  background: var(--surface);
  border-radius: 12px;
  animation: shimmer 1.4s infinite linear;
  background-image: linear-gradient(90deg, var(--surface) 0%, var(--surface3) 50%, var(--surface) 100%);
  background-size: 600px 100%;
}

.skeleton-card {
  height: 210px;
}

.skeleton-row {
  height: 64px;
  margin-bottom: 8px;
  border-radius: var(--radius);
}

/* ===== CARD LIST (rows) ===== */
.card-list { display: flex; flex-direction: column; gap: 4px; }

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.list-item:hover { background: var(--surface); }
.list-item.playing { background: var(--surface2); }
.list-item.playing .list-title { color: var(--accent); }

.list-num {
  width: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.list-item.playing .list-num { color: var(--accent); }

.list-art {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
}

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

.list-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.list-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-duration {
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-shrink: 0;
  padding: 0 8px;
}

.list-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity var(--transition);
}

.list-item:hover .list-actions { opacity: 1; }

.list-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}

.list-btn:hover { color: var(--text); background: var(--surface3); }
.list-btn.liked { color: var(--danger); }

.source-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* ===== SEARCH PAGE ===== */
#page-search h1 { font-size: 2rem; font-weight: 800; margin-bottom: 20px; }

.big-search-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 40px;
  padding: 0 16px;
  gap: 12px;
  margin-bottom: 24px;
  transition: border-color var(--transition);
}

.big-search-wrap:focus-within { border-color: var(--accent); }

.big-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.1rem;
  padding: 14px 0;
}

.big-search-input::placeholder { color: var(--text-dim); }

.big-search-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.big-search-btn:hover { color: var(--accent); }

.search-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 7px 18px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--text-muted); color: var(--text); }

.filter-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.search-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  min-height: 20px;
}

.muted { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

/* ===== GENRES ===== */
.browse-genres { margin-top: 32px; }
.browse-genres h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 16px; }

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.genre-card {
  height: 90px;
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  transition: transform var(--transition), filter var(--transition);
  overflow: hidden;
}

.genre-card:hover { transform: scale(1.03); filter: brightness(1.1); }

/* ===== TABS ===== */
.tabs, .library-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn, .lib-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.tab-btn:hover, .lib-tab:hover { color: var(--text); }

.tab-btn.active, .lib-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ===== NOW PLAYING BAR ===== */
.now-playing-bar {
  grid-area: player;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  height: var(--player-h);
  z-index: 100;
}

.np-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 280px;
  min-width: 0;
  flex-shrink: 0;
}

.np-art {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}

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

.np-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.np-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-like {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}

.np-like:hover { color: var(--danger); }
.np-like.liked { color: var(--danger); }

.np-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.np-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.ctrl-btn:hover { color: var(--text); transform: scale(1.1); }

.ctrl-btn.active { color: var(--accent); }

.ctrl-btn.play-btn {
  width: 44px;
  height: 44px;
  background: var(--text);
  color: var(--bg);
  border-radius: 50%;
}

.ctrl-btn.play-btn:hover {
  background: var(--accent);
  color: #000;
  transform: scale(1.05);
}

.ctrl-btn.small { width: 28px; height: 28px; }

.np-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 540px;
}

.np-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  width: 35px;
  flex-shrink: 0;
}

.np-time:last-child { text-align: right; }

.progress-bar-wrap {
  flex: 1;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  position: relative;
  transition: height 0.1s ease;
}

.progress-bar-wrap:hover .progress-bar-bg { height: 6px; }

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s linear;
}

.progress-bar-wrap:hover .progress-bar-fill { background: var(--accent-hover); }

.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.1s ease;
}

.progress-bar-wrap:hover .progress-thumb { transform: translate(-50%, -50%) scale(1); }

.buffer-bar {
  position: absolute;
  bottom: 6px;
  left: 35px;
  right: 35px;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.np-right {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 200px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.volume-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.volume-wrap:hover svg { color: var(--text); }

.volume-slider {
  width: 90px;
  height: 4px;
  -webkit-appearance: none;
  background: var(--surface3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}

.volume-slider:hover { background: var(--surface2); }

/* ===== LYRICS MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.lyrics-modal {
  width: 520px;
  max-width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.queue-modal {
  width: 420px;
  max-width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--surface3); color: var(--text); }

.lyrics-content {
  overflow-y: auto;
  flex: 1;
  font-size: 0.95rem;
  line-height: 2.2;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.lyrics-content .lyrics-line { transition: color 0.3s; }
.lyrics-content .lyrics-line.active { color: var(--text); font-size: 1.05rem; font-weight: 600; }

.lyrics-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.lyrics-not-found {
  color: var(--text-dim);
  text-align: center;
  padding: 40px 0;
  font-size: 0.9rem;
}

/* ===== QUEUE ===== */
.queue-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 4px; }

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.queue-item:hover { background: var(--surface2); }

.queue-item.current { background: var(--surface3); }
.queue-item.current .queue-title { color: var(--accent); }

.queue-art {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface2);
}

.queue-info { flex: 1; min-width: 0; }
.queue-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface3);
  color: var(--text);
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 12px;
  font-size: 0.9rem;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--surface3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PLAYING ANIMATION ===== */
.playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.playing-bars span {
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
  animation: bars 0.8s ease infinite alternate;
}

.playing-bars span:nth-child(1) { height: 8px; animation-delay: 0s; }
.playing-bars span:nth-child(2) { height: 14px; animation-delay: 0.2s; }
.playing-bars span:nth-child(3) { height: 6px; animation-delay: 0.4s; }

@keyframes bars {
  from { transform: scaleY(0.4); }
  to { transform: scaleY(1); }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg { opacity: 0.3; margin-bottom: 16px; }
.empty-state p { font-size: 0.9rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }

  .sidebar-logo span,
  .nav-item span,
  .sidebar-section-title,
  .sidebar-playlists,
  .create-playlist-btn { display: none; }

  .nav-item { justify-content: center; padding: 12px; }
  .sidebar-logo { justify-content: center; padding: 12px; }

  .np-left { width: 180px; }
  .np-right { width: 140px; }
}

@media (max-width: 650px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr var(--player-h);
    grid-template-areas:
      "header"
      "main"
      "player";
  }

  .sidebar { display: none; }

  .np-right { display: none; }
  .np-left { width: 160px; }

  .card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ===== SMOOTH FADE ===== */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
