/* =============================
   WAVEBOX — style.css
   Spotify x SoundCloud Hybrid
   ============================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

/* ---- VARIABLES ---- */
:root {
  --bg-base:      #0a0a0f;
  --bg-surface:   #111118;
  --bg-card:      #16161f;
  --bg-elevated:  #1e1e2a;
  --border:       rgba(255,255,255,0.07);

  --accent:       #ff5500;
  --accent2:      #1db954;
  --accent3:      #a259ff;
  --accent-glow:  rgba(255,85,0,0.35);

  --text-primary:   #f0f0f5;
  --text-secondary: #8888aa;
  --text-muted:     #44445a;

  --sidebar-w:  240px;
  --player-h:   90px;
  --topbar-h:   64px;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* App layout (active after login) */
body:not(.auth-mode) {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  grid-template-areas:
    "sidebar main"
    "player  player";
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input { font-family: inherit; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 99px; }

/* ============================================================
   AUTH OVERLAY
============================================================ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(ellipse at 30% 40%, #1a0a2e 0%, #0a0a0f 60%),
              radial-gradient(ellipse at 80% 80%, #1a0800 0%, transparent 50%);
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
  animation: fadeIn 0.35s ease;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 800;
  color: var(--accent);
  margin-bottom: 2rem;
}
.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 800;
  margin-bottom: 0.3rem;
}
.auth-sub { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.auth-error {
  background: rgba(255,50,50,0.12);
  border: 1px solid rgba(255,80,80,0.3);
  border-radius: var(--radius-sm);
  color: #ff7070;
  font-size: 0.82rem;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}
.field-group { margin-bottom: 1rem; }
.field-group label {
  display: block;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
.field-group input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.92rem;
  padding: 0.7rem 0.9rem;
  outline: none;
  transition: var(--transition);
}
.field-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,85,0,0.15);
}
.auth-btn {
  width: 100%;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.03em;
  margin-top: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(255,85,0,0.35);
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(255,85,0,0.5); }
.auth-btn:active { transform: translateY(0); }
.auth-switch {
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-top: 1.2rem;
}
.auth-switch a { color: var(--accent); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0 0 1rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 1.5rem 1.2rem 1.2rem;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.logo-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
}
.sidebar-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 0.7rem; margin-bottom: 1.5rem;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 500;
  transition: var(--transition);
}
.nav-item i { width: 16px; text-align: center; }
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255,85,0,0.18), transparent);
  color: var(--accent);
  border-left: 3px solid var(--accent);
}
.sidebar-section-label {
  padding: 0 1.2rem 0.5rem;
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.playlist-list {
  padding: 0 0.7rem;
  display: flex; flex-direction: column; gap: 1px;
  flex: 1; overflow-y: auto;
}
.playlist-item {
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.playlist-item-name { display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; }
.playlist-item i { font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }
.playlist-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.playlist-item.active-playlist { color: var(--accent2); }
.playlist-item-del {
  opacity: 0; font-size: 0.72rem;
  color: var(--text-muted); padding: 2px 4px;
  transition: var(--transition); flex-shrink: 0;
}
.playlist-item:hover .playlist-item-del { opacity: 1; }
.playlist-item-del:hover { color: #ff5555; }
.create-playlist-btn {
  margin: 1rem 0.7rem 0;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--text-muted); font-size: 0.82rem;
  transition: var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.create-playlist-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(255,85,0,0.06);
}

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

/* TOPBAR */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(10,10,15,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem;
}
.topbar-nav { display: flex; gap: 6px; }
.nav-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-elevated); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; transition: var(--transition);
}
.nav-btn:hover { background: var(--border); color: var(--text-primary); }
.search-bar {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 99px;
  padding: 0 1rem; transition: var(--transition);
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,85,0,0.15);
}
.search-bar i { color: var(--text-muted); font-size: 0.85rem; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.88rem; padding: 0.6rem 0;
}
.search-bar input::placeholder { color: var(--text-muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.8rem; }
.username-chip {
  font-size: 0.8rem; color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 0.3rem 0.8rem; border-radius: 99px;
}
.upload-btn {
  padding: 0.45rem 1rem; border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.upload-btn:hover { border-color: #ff5555; color: #ff5555; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
  font-family: var(--font-display);
}

/* LOADING */
.loading-overlay {
  position: absolute; inset: 0; z-index: 50;
  background: var(--bg-base);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.2rem;
  color: var(--text-secondary); font-size: 0.9rem;
}
.loading-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--bg-elevated);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* PAGES */
.page { display: none; padding: 2rem 1.8rem; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-title {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 800; margin-bottom: 1.5rem;
}
.page-title.no-margin { margin-bottom: 0; }

/* HERO */
.hero-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #1a1228 0%, #0f1a14 50%, #1a0f0a 100%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2.5rem 2rem; margin-bottom: 2.5rem;
  position: relative; overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(255,85,0,0.12), transparent 60%),
              radial-gradient(ellipse at 30% 80%, rgba(162,89,255,0.08), transparent 60%);
  pointer-events: none;
}
.hero-text { flex: 1; z-index: 1; }
.hero-sub {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.15em; color: var(--accent); margin-bottom: 0.5rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: 2.8rem; font-weight: 800; line-height: 1.1; margin-bottom: 0.4rem;
}
.hero-artist { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.5rem; }
.hero-actions { display: flex; gap: 0.8rem; align-items: center; }
.btn-primary {
  padding: 0.65rem 1.5rem; border-radius: 99px;
  background: var(--accent); color: #fff;
  font-size: 0.88rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(255,85,0,0.4);
}
.btn-primary:hover { transform: scale(1.04); box-shadow: 0 6px 28px rgba(255,85,0,0.55); }
.btn-ghost {
  padding: 0.65rem 1.5rem; border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.88rem; font-weight: 500;
  display: flex; align-items: center; gap: 8px; transition: var(--transition);
}
.btn-ghost:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.btn-ghost.danger:hover { border-color: #ff5555; color: #ff5555; }
.hero-visual { position: relative; z-index: 1; }
.album-glow {
  position: absolute; width: 180px; height: 180px;
  border-radius: 50%; filter: blur(40px); opacity: 0.7;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  pointer-events: none; transition: background 0.6s ease;
}
.album-art {
  width: 160px; height: 160px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2a1a30, #1a2a20);
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  cursor: pointer; transition: transform 0.3s ease;
}
.album-art:hover { transform: scale(1.03) rotate(1deg); }
.waveform-decoration {
  display: flex; align-items: flex-end; gap: 3px;
  padding: 0 14px 14px; height: 60px; width: 100%;
}
.wave-bar {
  flex: 1; height: var(--h);
  background: rgba(255,255,255,0.3);
  border-radius: 2px 2px 0 0;
  animation: wavePulse 1.4s ease-in-out infinite alternate;
}
.wave-bar:nth-child(1){animation-delay:0s}
.wave-bar:nth-child(2){animation-delay:.1s}
.wave-bar:nth-child(3){animation-delay:.2s}
.wave-bar:nth-child(4){animation-delay:.3s}
.wave-bar:nth-child(5){animation-delay:.4s}
.wave-bar:nth-child(6){animation-delay:.5s}
.wave-bar:nth-child(7){animation-delay:.6s}
.wave-bar:nth-child(8){animation-delay:.7s}
@keyframes wavePulse {
  from { transform: scaleY(0.4); opacity: 0.4; }
  to   { transform: scaleY(1);   opacity: 1;   }
}

/* SECTION HEADER */
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1rem;
}
.section-header h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.track-count-label { font-size: 0.78rem; color: var(--text-muted); }

/* EMPTY LIBRARY */
.empty-library {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-secondary);
}
.empty-library i { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; display: block; }
.empty-library h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.5rem; }
.empty-library p { font-size: 0.88rem; line-height: 1.7; }
.empty-library code {
  background: var(--bg-elevated); padding: 1px 6px;
  border-radius: 4px; font-size: 0.82rem; color: var(--accent);
}

/* TRACK GRID */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 2.5rem;
}
.track-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1rem;
  cursor: pointer; transition: var(--transition); position: relative; overflow: hidden;
}
.track-card:hover { transform: translateY(-4px); border-color: rgba(255,85,0,0.3); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.card-art {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm);
  margin-bottom: 0.75rem; display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem; position: relative; overflow: hidden;
}
.card-play-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s; border-radius: var(--radius-sm);
}
.track-card:hover .card-play-overlay { opacity: 1; }
.track-card.now-playing .card-play-overlay { opacity: 1; background: rgba(0,0,0,0.3); }
.card-play-overlay i {
  font-size: 1.5rem; color: #fff; background: var(--accent);
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(255,85,0,0.6);
}
.card-title {
  font-size: 0.88rem; font-weight: 600; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-artist { font-size: 0.76rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-duration { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* TRACK LIST */
.track-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 2rem; }
.track-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem 0.8rem; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition); position: relative;
}
.track-row:hover { background: var(--bg-elevated); }
.track-row.playing-row { background: rgba(255,85,0,0.08); }
.track-row.playing-row .row-title { color: var(--accent); }
.row-num { width: 24px; text-align: center; font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }
.row-art {
  width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; overflow: hidden; background: var(--bg-elevated);
}
.row-info { flex: 1; min-width: 0; }
.row-title { font-size: 0.88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-artist { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.row-meta { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.row-duration { font-size: 0.78rem; color: var(--text-secondary); width: 38px; text-align: right; }
.row-like { color: var(--text-muted); font-size: 0.85rem; transition: var(--transition); padding: 4px; }
.row-like:hover, .row-like.liked { color: var(--accent); }
.row-add-playlist { color: var(--text-muted); font-size: 0.82rem; transition: var(--transition); padding: 4px; }
.row-add-playlist:hover { color: var(--accent2); }
.row-waveform { display: none; align-items: flex-end; gap: 2px; height: 20px; margin-left: 0.5rem; }
.track-row.playing-row .row-waveform { display: flex; }
.row-waveform span {
  width: 3px; background: var(--accent); border-radius: 1px;
  animation: wavePulse 0.8s ease-in-out infinite alternate;
}
.row-waveform span:nth-child(1){height:8px;animation-delay:0s}
.row-waveform span:nth-child(2){height:14px;animation-delay:.15s}
.row-waveform span:nth-child(3){height:10px;animation-delay:.3s}
.row-waveform span:nth-child(4){height:18px;animation-delay:.1s}
.row-waveform span:nth-child(5){height:12px;animation-delay:.25s}
.empty-msg { color: var(--text-muted); font-size: 0.9rem; padding: 1rem; }

/* LIBRARY TABS */
.library-tabs { display: flex; gap: 8px; margin-bottom: 1.2rem; }
.lib-tab {
  padding: 0.45rem 1.1rem; border-radius: 99px;
  border: 1px solid var(--border); font-size: 0.83rem; color: var(--text-secondary);
  transition: var(--transition);
}
.lib-tab:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.lib-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* PLAYLIST HEADER */
.playlist-header {
  display: flex; align-items: flex-end; gap: 1.5rem;
  margin-bottom: 2rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.playlist-icon {
  width: 100px; height: 100px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; flex-shrink: 0;
}
.playlist-header-info { flex: 1; }
.playlist-type-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 0.3rem; }
.playlist-track-count { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.4rem; }
.playlist-header-actions { display: flex; gap: 0.8rem; align-items: center; }

/* ============================================================
   PLAYER BAR
============================================================ */
.player-bar {
  grid-area: player;
  background: rgba(14,14,20,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1.5rem; gap: 1rem; z-index: 200;
}
.player-track-info { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.player-art {
  width: 50px; height: 50px; border-radius: 8px;
  background: var(--bg-elevated); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; overflow: hidden; color: var(--text-muted);
}
.player-meta { min-width: 0; }
.player-title { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.player-artist { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.like-btn { color: var(--text-muted); font-size: 1rem; transition: var(--transition); padding: 6px; flex-shrink: 0; }
.like-btn:hover, .like-btn.liked { color: var(--accent); }
.player-center { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.player-controls { display: flex; align-items: center; gap: 0.5rem; }
.ctrl-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--text-secondary); transition: var(--transition);
}
.ctrl-btn:hover { color: var(--text-primary); background: var(--bg-elevated); }
.ctrl-btn.active { color: var(--accent2); }
.ctrl-btn.play-pause {
  width: 42px; height: 42px;
  background: var(--text-primary); color: var(--bg-base);
  font-size: 0.95rem; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.ctrl-btn.play-pause:hover { transform: scale(1.06); background: #fff; }
.player-progress-wrap {
  display: flex; align-items: center; gap: 8px;
  width: 380px;
}
.time-label { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; min-width: 34px; }
.time-label:last-child { text-align: right; }
.progress-bar-outer {
  flex: 1; height: 4px; background: var(--bg-elevated);
  border-radius: 99px; cursor: pointer; position: relative; transition: height 0.15s;
}
.progress-bar-outer:hover { height: 6px; }
.progress-bar-inner {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 99px; width: 0%;
}
.progress-thumb {
  position: absolute; width: 12px; height: 12px;
  background: #fff; border-radius: 50%;
  top: 50%; transform: translate(-50%, -50%);
  left: 0%; box-shadow: 0 0 6px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.progress-bar-outer:hover .progress-thumb { opacity: 1; }
.player-right { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }
.waveform-mini { display: flex; align-items: flex-end; gap: 2px; height: 24px; }
.wm-bar { width: 3px; height: var(--h); background: var(--text-muted); border-radius: 1px; transition: background 0.3s; }
.wm-bar.active-wm { background: var(--accent); animation: wavePulse 0.9s ease-in-out infinite alternate; }
.volume-slider {
  -webkit-appearance: none; appearance: none;
  width: 80px; height: 4px; border-radius: 99px;
  background: var(--bg-elevated); outline: none; cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-primary); cursor: pointer;
}

/* CONTEXT MENU */
.context-menu {
  position: fixed; z-index: 9000;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.4rem 0;
  min-width: 180px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  animation: fadeIn 0.15s ease;
}
.context-menu-item {
  padding: 0.55rem 1rem;
  font-size: 0.85rem; cursor: pointer; color: var(--text-secondary);
  transition: var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.context-menu-item:hover { background: var(--bg-card); color: var(--text-primary); }
.context-menu-item i { width: 14px; text-align: center; font-size: 0.78rem; }
.context-menu-sep { height: 1px; background: var(--border); margin: 0.3rem 0; }

/* RESPONSIVE */
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .sidebar-logo span.logo-text,
  .nav-item span,
  .sidebar-section-label,
  .playlist-list,
  .create-playlist-btn { display: none; }
  .sidebar-logo { justify-content: center; padding: 1.5rem 0.5rem; }
  .nav-item { justify-content: center; }
  .nav-item i { width: auto; }
}
@media (max-width: 700px) {
  .track-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 1.8rem; }
  .hero-visual { display: none; }
  .player-right { display: none; }
  .player-progress-wrap { width: 200px; }
  .username-chip { display: none; }
}

/* ============================================================
   ARTIST PROFILES
============================================================ */

/* ── PROFILE PAGE ── */
.profile-banner-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.profile-banner {
  width: 100%; height: 220px;
  background: linear-gradient(135deg, #1a0a2e, #0f1a14, #1a0f0a);
  background-size: cover; background-position: center;
  position: relative;
}
.profile-banner::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 80px;
  background: linear-gradient(to bottom, transparent, rgba(10,10,15,0.8));
}
.profile-header {
  display: flex; align-items: flex-end; gap: 1.5rem;
  padding: 0 1.5rem 1.5rem;
  position: relative;
}
.profile-pfp-wrap {
  flex-shrink: 0;
  margin-top: -50px;
  z-index: 2;
}
.profile-pfp {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 4px solid var(--bg-base);
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 800;
  color: #fff;
  background-size: cover; background-position: center;
  overflow: hidden;
}
.profile-pfp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-header-info { flex: 1; min-width: 0; padding-bottom: 0.2rem; }
.profile-name-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.2rem; }
.profile-display-name {
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 800;
  line-height: 1.1;
}
.verified-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 99px;
  background: rgba(29,185,84,0.12); color: var(--accent2);
  border: 1px solid rgba(29,185,84,0.3);
}
.profile-username { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.profile-bio {
  font-size: 0.88rem; color: var(--text-secondary);
  line-height: 1.65; margin-bottom: 0.8rem; max-width: 600px;
}
.profile-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.profile-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.35rem 0.8rem; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  font-size: 0.78rem; color: var(--text-secondary);
  transition: var(--transition); text-decoration: none;
}
.profile-link:hover { color: var(--text-primary); border-color: var(--accent); }
.profile-link i { font-size: 0.82rem; }
.profile-header-actions { flex-shrink: 0; padding-bottom: 0.3rem; }
.edit-profile-btn {
  padding: 0.55rem 1.2rem; border-radius: 99px;
  border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 0.85rem; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
  transition: var(--transition);
}
.edit-profile-btn:hover { border-color: var(--text-primary); color: var(--text-primary); }

/* ── SEARCH ARTIST CARD ── */
.artist-result-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 1rem; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: var(--transition); margin-bottom: 0.5rem;
}
.artist-result-card:hover { border-color: rgba(255,85,0,0.3); transform: translateX(3px); }
.artist-result-pfp {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: #fff;
  overflow: hidden;
}
.artist-result-pfp img { width: 48px; height: 48px; object-fit: cover; }
.artist-result-info { flex: 1; }
.artist-result-name { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.artist-result-sub { font-size: 0.76rem; color: var(--text-secondary); margin-top: 2px; }
.artist-section-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--text-muted); margin: 1.2rem 0 0.5rem;
}

/* ── EDIT PROFILE MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 500;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
.edit-profile-modal {
  width: 100%; max-width: 560px; max-height: 90vh;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow-y: auto;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
  animation: fadeIn 0.2s ease;
}
.epm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-surface); z-index: 10;
}
.epm-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.epm-close {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.9rem; transition: var(--transition);
}
.epm-close:hover { background: var(--bg-elevated); color: var(--text-primary); }
.epm-banner-upload {
  position: relative; height: 160px; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, #1a0a2e, #0f1a14);
}
.epm-banner-preview {
  width: 100%; height: 100%; background-size: cover; background-position: center;
}
.epm-banner-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  gap: 8px; color: #fff; font-size: 0.88rem; font-weight: 600;
  opacity: 0; transition: opacity 0.2s;
}
.epm-banner-upload:hover .epm-banner-overlay { opacity: 1; }
.epm-pfp-row { padding: 0 1.5rem; margin-top: -36px; margin-bottom: 0.5rem; position: relative; z-index: 2; }
.epm-pfp-upload {
  width: 72px; height: 72px; border-radius: 50%;
  border: 3px solid var(--bg-surface);
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  cursor: pointer; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff;
}
.epm-pfp-preview { width: 100%; height: 100%; background-size: cover; background-position: center; border-radius: 50%; }
.epm-pfp-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.85rem; opacity: 0; transition: opacity 0.2s; border-radius: 50%;
}
.epm-pfp-upload:hover .epm-pfp-overlay { opacity: 1; }
.epm-fields { padding: 0.5rem 1.5rem 1rem; }
.epm-field { margin-bottom: 1rem; }
.epm-field label {
  display: block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 0.4rem;
}
.epm-field input, .epm-field textarea {
  width: 100%; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.9rem;
  padding: 0.65rem 0.9rem; outline: none; transition: var(--transition);
  resize: vertical;
}
.epm-field input:focus, .epm-field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,85,0,0.15);
}
.epm-links-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem;
}
.epm-link-row { display: flex; align-items: center; gap: 8px; }
.epm-link-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem;
}
.epm-link-row input {
  flex: 1; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.82rem; padding: 0.5rem 0.7rem; outline: none; transition: var(--transition);
}
.epm-link-row input:focus { border-color: var(--accent); }
.epm-footer {
  display: flex; justify-content: flex-end; gap: 0.7rem;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--bg-surface);
}
.epm-cancel {
  padding: 0.6rem 1.2rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 0.85rem; transition: var(--transition);
}
.epm-cancel:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.epm-save {
  padding: 0.6rem 1.4rem; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  font-size: 0.85rem; font-weight: 700;
  display: flex; align-items: center; gap: 6px; transition: var(--transition);
  box-shadow: 0 4px 16px rgba(255,85,0,0.35);
}
.epm-save:hover { transform: translateY(-1px); }

/* ── CLICKABLE ARTIST LINKS ── */
.artist-link {
  cursor: pointer;
  transition: color var(--transition);
}
.artist-link:hover { color: var(--text-primary); text-decoration: underline; }
.card-artist .artist-link { color: var(--text-secondary); font-size: inherit; }
.row-artist .artist-link  { color: var(--text-secondary); font-size: inherit; }
.artist-link-verified { color: var(--accent2) !important; }
.artist-link-verified:hover { color: #25d466 !important; }
