﻿/* ============================================
   VentiStudio Music Complete Spotify-like UI
   ============================================ */

/* --- Reset & Variables --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-base: #121212;
  --bg-surface: #181818;
  --bg-elevated: #242424;
  --bg-highlight: #2a2a2a;
  --bg-card: #1a1a2e;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --accent-dark: #4f46e5;
  --green: #1db954;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255, 255, 255, 0.06);
  --sidebar-width: 240px;
  --player-height: 90px;
  --player-mobile-height: 64px;
  --radius: 10px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr var(--player-height);
  grid-template-areas:
    "sidebar main"
    "player player";
}

a { color: inherit; text-decoration: none; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  gap: 0.5rem;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-logo img { border-radius: 8px; }

.sidebar-logo span {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-highlight);
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active svg {
  opacity: 1;
  color: var(--accent);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  grid-area: main;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.main-content::-webkit-scrollbar { width: 8px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--bg-highlight); border-radius: 4px; }
.main-content::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.sidebar-toggle:hover { background: var(--bg-highlight); }

.topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.topbar-back:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 500px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  transition: all var(--transition);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar input::placeholder { color: var(--text-muted); }

.sort-select select {
  padding: 0.6rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 500px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

.sort-select select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================
   HOME VIEW
   ============================================ */
.home-welcome {
  padding: 2.5rem 1.5rem 1rem;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
}

.home-welcome h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.home-welcome p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Sections --- */
.home-section {
  padding: 0 1.5rem;
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color var(--transition);
}

.section-link:hover { color: var(--text-primary); }

/* --- Quick Picks (Recently Played) --- */
.quick-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.quick-pick {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.quick-pick:hover {
  background: rgba(255, 255, 255, 0.1);
}

.quick-pick img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  flex-shrink: 0;
}

.quick-pick-info {
  padding: 0 0.85rem;
  min-width: 0;
  flex: 1;
}

.quick-pick-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-pick-artist {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-pick-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  margin-right: 0.75rem;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.quick-pick:hover .quick-pick-play {
  opacity: 1;
  transform: translateX(0);
}

.quick-pick-play svg {
  width: 16px;
  height: 16px;
  margin-left: 2px;
}

/* --- Horizontal Scroll --- */
.horizontal-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.horizontal-scroll::-webkit-scrollbar { height: 6px; }
.horizontal-scroll::-webkit-scrollbar-track { background: transparent; }
.horizontal-scroll::-webkit-scrollbar-thumb { background: var(--bg-highlight); border-radius: 3px; }

/* --- Artist Card (horizontal scroll) --- */
.artist-card {
  flex-shrink: 0;
  width: 160px;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  scroll-snap-align: start;
}

.artist-card:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.artist-card-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.artist-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* --- Album Card (horizontal scroll & grid) --- */
.album-card {
  flex-shrink: 0;
  width: 180px;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s;
  scroll-snap-align: start;
}

.album-card:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.album-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.album-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Artists Grid (full page) --- */
.artists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.25rem;
  padding: 1rem 1.5rem 8rem;
}

.artist-card-lg {
  padding: 1.25rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.artist-card-lg:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.artist-card-lg-image {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.artist-card-lg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-card-lg-name {
  font-size: 1rem;
  font-weight: 700;
}

.artist-card-lg-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* --- Albums Grid (full page) --- */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  padding: 1rem 1.5rem 8rem;
}

/* ============================================
   VIEW HEADER
   ============================================ */
.view-header {
  padding: 2rem 1.5rem 1rem;
}

.view-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.view-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   ARTIST PAGE HERO
   ============================================ */
.artist-hero {
  position: relative;
  padding: 0;
  overflow: hidden;
  min-height: 280px;
}

.artist-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 0%, var(--bg-base) 100%),
    var(--hero-cover, none) center / cover no-repeat;
  filter: blur(40px) brightness(0.5);
  transform: scale(1.2);
  z-index: 0;
}

.artist-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 3rem 1.5rem 1rem;
}

.artist-hero-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.artist-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-hero-info {
  min-width: 0;
  padding-bottom: 0.5rem;
}

.artist-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.artist-hero-name {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.artist-hero-stats {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.artist-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
}

/* --- Action Buttons --- */
.btn-play-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: 500px;
  background: var(--accent);
  color: white;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-play-all:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px var(--accent-glow);
  background: var(--accent-dark);
}

.btn-play-all svg {
  width: 20px;
  height: 20px;
}

.btn-shuffle-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: 500px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-shuffle-all:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   ALBUM PAGE HERO
   ============================================ */
.album-hero {
  position: relative;
  overflow: hidden;
  min-height: 260px;
}

.album-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 0%, var(--bg-base) 100%),
    var(--hero-cover, none) center / cover no-repeat;
  filter: blur(40px) brightness(0.5);
  transform: scale(1.2);
  z-index: 0;
}

.album-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 3rem 1.5rem 1rem;
}

.album-hero-cover {
  width: 200px;
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.album-hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-hero-info {
  min-width: 0;
  padding-bottom: 0.5rem;
}

.album-hero-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.album-hero-name {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.album-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.album-hero-artist {
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
}

.album-hero-artist:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

.album-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
}

/* ============================================
   TRACK TABLE (list view)
   ============================================ */
.track-table {
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem;
}

.album-tracklist {
  padding: 0 1.5rem 8rem;
}

.track-row {
  display: grid;
  grid-template-columns: 32px 44px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.album-tracklist .track-row {
  grid-template-columns: 32px 1fr auto;
}

.track-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.track-row.playing {
  background: rgba(99, 102, 241, 0.1);
}

.track-row.playing .track-row-title {
  color: var(--accent-light);
}

.track-row-num {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 32px;
}

.track-row-cover {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
}

.track-row-info {
  min-width: 0;
}

.track-row-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.track-row-album {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 0.1rem;
}

.track-row-plays {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: 0.5rem;
}

/* ============================================
   TRACK GRID (cards)
   ============================================ */
.track-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.15rem;
  padding: 0.5rem 0 2rem;
}

/* When track-list is used directly (allTracks view) */
.view-header + .track-list {
  padding: 0.5rem 1.5rem 8rem;
}

.track {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.9rem;
}

.track:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.track.playing {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.track img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 0.7rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.track-play-overlay {
  position: absolute;
  right: 0.9rem;
  bottom: 4.2rem;
  width: 42px;
  height: 42px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
}

.track:hover .track-play-overlay {
  opacity: 1;
  transform: translateY(0);
}

.track-play-overlay svg {
  width: 18px;
  height: 18px;
  fill: white;
  stroke: none;
  margin-left: 2px;
}

.track-title {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-info { margin-top: 0.25rem; }

.track-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0.1rem 0;
}

.artist-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.artist-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state svg {
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 1rem;
}

.empty-state h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   BOTTOM PLAYER (Desktop)
   ============================================ */
.player {
  grid-area: player;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  height: var(--player-height);
  z-index: 200;
  gap: 1rem;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
  max-width: 280px;
}

.player-album-art {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.player-album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-track-info { min-width: 0; }

.player-track-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.player-track-artist {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0.1rem 0 0;
  transition: color var(--transition);
}

.player-track-artist:hover { color: var(--text-primary); }

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex: 2;
  max-width: 600px;
}

.player-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 50%;
  transition: all var(--transition);
}

.ctrl-btn:hover {
  color: var(--text-primary);
  transform: scale(1.08);
}

.ctrl-btn.active { color: var(--accent); }

.ctrl-play {
  background: var(--text-primary);
  color: var(--bg-base) !important;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all var(--transition);
}

.ctrl-play:hover {
  transform: scale(1.06);
  background: #fff;
}

.ctrl-play svg { margin-left: 1px; }

.player-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.time {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.progress-wrapper {
  position: relative;
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  overflow: visible;
}

.progress-wrapper:hover { height: 6px; }

.progress-bar {
  position: absolute;
  height: 100%;
  width: 0%;
  background: var(--text-primary);
  border-radius: 4px;
  transition: background 0.1s;
}

.progress-wrapper:hover .progress-bar { background: var(--accent); }

.progress-handle {
  position: absolute;
  height: 12px;
  width: 12px;
  background: var(--text-primary);
  border-radius: 50%;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.progress-wrapper:hover .progress-handle {
  transform: translate(-50%, -50%) scale(1);
}

.player-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 280px;
  justify-content: flex-end;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
}

input[type="range"]:hover { background: rgba(255, 255, 255, 0.15); }

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
  border: none;
}

/* ============================================
   MOBILE PLAYER (compact bar)
   ============================================ */
.player-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-mobile-height);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  padding: 0 0.75rem;
  gap: 0.5rem;
}

.pm-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  min-width: 0;
}

.pm-cover {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.pm-text { min-width: 0; }

.pm-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.pm-artist {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0.1rem 0 0;
}

.pm-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pm-controls .ctrl-btn { color: var(--text-primary); }

.pm-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.pm-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s linear;
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
}

.sidebar-overlay.active,
.sidebar.open ~ .sidebar-overlay { display: block; }

/* ============================================
   LED FULLSCREEN
   ============================================ */
#fullscreenLed {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: #0a0a0f;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#fullscreenLed .led-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

#fullscreenLed .led-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 2rem;
}

#fullscreenLed .led-album {
  max-width: 320px;
  max-height: 320px;
  width: 80vmin;
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

#fullscreenLed .led-title {
  color: #fff;
  margin: 2rem 0 0.5rem;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
}

#fullscreenLed .led-artist {
  color: var(--accent-light);
  margin: 0 0 2rem;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  font-size: 1.1rem;
  text-align: center;
}

#fullscreenLed .led-exit {
  padding: 0.75rem 2rem;
  border-radius: 500px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

#fullscreenLed .led-exit:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet: ≤ 1024px */
@media (max-width: 1024px) {
  :root { --sidebar-width: 72px; }
  .sidebar-logo span { display: none; }
  .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 0.75rem; }
  .sidebar-logo { justify-content: center; }
  .sidebar-divider { margin: 0.5rem 0.25rem; }

  .artist-hero-name { font-size: 2.2rem; }
  .album-hero-name { font-size: 2rem; }
  .artist-hero-avatar { width: 140px; height: 140px; }
  .album-hero-cover { width: 160px; height: 160px; }
}

/* Mobile: ≤ 768px */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    grid-template-areas: "main";
  }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 260px;
    transition: left 0.3s ease;
    z-index: 100;
    background: var(--bg-base);
    border-right: 1px solid var(--border);
  }

  .sidebar.open { left: 0; }

  .sidebar-logo span { display: inline; }
  .nav-item span { display: inline; }
  .nav-item { justify-content: flex-start; padding: 0.75rem 1rem; }
  .sidebar-logo { justify-content: flex-start; }
  .sidebar-toggle { display: flex; }

  .player { display: none; }
  .player-mobile { display: flex; }

  .main-content { padding-bottom: var(--player-mobile-height); }

  .home-welcome { padding: 1.5rem 1rem 0.75rem; }
  .home-welcome h1 { font-size: 1.5rem; }
  .home-section { padding: 0 1rem; }

  .quick-picks {
    grid-template-columns: 1fr;
  }

  .track-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
    padding: 0.5rem 0 2rem;
  }

  .view-header + .track-list { padding: 0.5rem 1rem 6rem; }

  .track { padding: 0.7rem; }

  .topbar { padding: 0.75rem 1rem; gap: 0.75rem; }
  .sort-select { display: none; }

  /* Artist & Album Hero responsive */
  .artist-hero-content { flex-direction: column; align-items: center; text-align: center; padding: 2rem 1rem 1rem; }
  .artist-hero-avatar { width: 120px; height: 120px; }
  .artist-hero-name { font-size: 1.8rem; }
  .artist-hero-actions { justify-content: center; }

  .album-hero-content { flex-direction: column; align-items: center; text-align: center; padding: 2rem 1rem 1rem; }
  .album-hero-cover { width: 160px; height: 160px; }
  .album-hero-name { font-size: 1.6rem; }
  .album-hero-meta { justify-content: center; }
  .album-hero-actions { justify-content: center; }

  .album-tracklist { padding: 0 1rem 6rem; }
  .track-table { padding: 0 0.25rem; }

  .artists-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; padding: 0.75rem 1rem 6rem; }
  .albums-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; padding: 0.75rem 1rem 6rem; }

  .artist-card-lg-image { width: 100px; height: 100px; }
  .view-header { padding: 1.5rem 1rem 0.75rem; }
  .view-header h1 { font-size: 1.4rem; }
}

/* Small mobile: ≤ 480px */
@media (max-width: 480px) {
  .track-list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
  }

  .track { padding: 0.55rem; }
  .track img { border-radius: 8px; margin-bottom: 0.5rem; }
  .track-title { font-size: 0.8rem; }
  .track-info p { font-size: 0.7rem; }

  .topbar { padding: 0.5rem 0.75rem; }
  .search-bar input { font-size: 0.85rem; padding: 0.5rem 0.8rem 0.5rem 2.3rem; }

  .home-welcome h1 { font-size: 1.3rem; }

  .quick-picks { gap: 0.5rem; }
  .quick-pick img { width: 48px; height: 48px; }

  .artist-card { width: 130px; padding: 0.75rem; }
  .artist-card-image { width: 90px; height: 90px; }
  .album-card { width: 140px; padding: 0.75rem; }

  .artist-hero-name { font-size: 1.5rem; }
  .album-hero-name { font-size: 1.4rem; }
  .album-hero-cover { width: 120px; height: 120px; }
  .artist-hero-avatar { width: 90px; height: 90px; }

  .track-row { gap: 0.5rem; padding: 0.4rem 0.5rem; }
  .track-row-cover { width: 36px; height: 36px; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
  50% { box-shadow: 0 2px 16px var(--accent-glow); }
}

.playing-glow {
  animation: pulse-glow 2s infinite ease-in-out;
}
