/* Spotifry Web — gaya Spotify Web Player / referensi Resona (bukan salinan Spotify):
   latar gelap, panel #181818, sidebar hitam, teks #b3b3b3, aksen hijau #1ed760.
   Nama/logo tetap Spotifry. Albert Sans / Figtree. */
:root{
  --bg:#121212; --page-bg:#000000; --sidebar-bg:#000000;
  --surface:#181818; --surface-2:#282828; --hover:#2a2a2a;
  --ink:#ffffff; --muted:#b3b3b3; --border:#232323;
  --accent:#1ed760; --accent-ink:#000000;
  --radius:8px; --player-h:90px; --nav-h:64px;
  --shadow:0 8px 24px rgba(0,0,0,.5);
}
[data-theme="dark"]{
  --bg:#121212; --page-bg:#000000; --sidebar-bg:#000000;
  --surface:#181818; --surface-2:#282828; --hover:#2a2a2a;
  --ink:#ffffff; --muted:#b3b3b3; --border:#232323;
  --accent:#1ed760; --accent-ink:#000000;
  --shadow:0 8px 24px rgba(0,0,0,.5);
}
[data-theme="black"]{
  --bg:#000000; --page-bg:#000000; --sidebar-bg:#000000;
  --surface:#121212; --surface-2:#1f1f1f; --hover:#1a1a1a;
  --ink:#ffffff; --muted:#b3b3b3; --border:#1a1a1a;
  --accent:#1ed760; --accent-ink:#000000;
  --shadow:0 8px 24px rgba(0,0,0,.6);
}
[data-theme="light"]{
  --bg:#ffffff; --page-bg:#f2f2f2; --sidebar-bg:#ffffff;
  --surface:#f4f4f4; --surface-2:#e9e9e9; --hover:#ececec;
  --ink:#111111; --muted:#5c5c5c; --border:#e3e3e3;
  --accent:#1ed760; --accent-ink:#000000;
  --shadow:0 8px 24px rgba(0,0,0,.10);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:"Albert Sans","Figtree",system-ui,-apple-system,"Segoe UI",sans-serif;
  background:var(--page-bg); color:var(--ink); font-size:16px; line-height:1.5;
  -webkit-tap-highlight-color:transparent;
}
a{color:var(--accent);text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;padding:0}
input,select{font:inherit;color:inherit}
img{display:block}
h1{font-size:28px;margin:0 0 4px;font-weight:800;letter-spacing:-.02em}
h2{font-size:20px;margin:28px 0 12px;font-weight:800;letter-spacing:-.01em}
h3{font-size:16px;margin:0}
p{margin:0 0 10px}
.muted{color:var(--muted)}
.small{font-size:13px}
.hidden{display:none!important}

/* Layout: 3 kolom desktop (sidebar | konten | queue), player bar bawah */
#app{
  display:grid;grid-template-columns:264px minmax(0,1fr) 320px;gap:8px;
  min-height:100vh;padding:8px 8px calc(var(--player-h) + 8px);
  background:var(--page-bg);
}
.sidebar{
  background:var(--sidebar-bg);border-radius:var(--radius);
  padding:20px 12px;display:flex;flex-direction:column;gap:4px;
  position:sticky;top:8px;height:calc(100vh - var(--player-h) - 16px);
  overflow-y:auto;
}
.brand{display:flex;align-items:center;gap:10px;padding:4px 10px 18px;font-weight:800;font-size:20px;letter-spacing:-.02em}
.brand img{width:34px;height:34px;border-radius:9px}
.nav-btn{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  padding:10px 12px;border-radius:var(--radius);font-weight:700;font-size:15px;color:var(--muted);
}
.nav-btn:hover{color:var(--ink)}
.nav-btn.active{background:var(--surface-2);color:var(--ink)}
.nav-ic{font-size:18px;width:22px;text-align:center;flex:0 0 22px}
.side-lib{margin-top:18px;min-height:0;display:flex;flex-direction:column}
.side-lib-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:4px 10px 8px;font-weight:800;font-size:15px;color:var(--muted);
}
#sidebarPlaylists{overflow-y:auto;min-height:40px}
.side-pl{
  display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  padding:6px 10px;border-radius:var(--radius);
}
.side-pl:hover{background:var(--hover)}
.side-pl img,.side-pl-fallback{
  width:44px;height:44px;border-radius:6px;object-fit:cover;flex:0 0 44px;
  background:var(--surface-2);display:flex;align-items:center;justify-content:center;font-size:18px;
}
.side-pl-meta{flex:1;min-width:0;display:flex;flex-direction:column}
.side-pl-name{font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-pl-sub{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-np{
  margin-top:auto;display:flex;align-items:center;gap:10px;
  padding:10px;border-radius:var(--radius);cursor:pointer;background:var(--surface);
}
.side-np:hover{background:var(--surface-2)}
.side-np img{width:48px;height:48px;border-radius:6px;object-fit:cover;flex:0 0 48px;background:var(--surface-2)}
.side-np-meta{flex:1;min-width:0}
.side-np-title{font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-np-artist{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-settings{margin-top:6px}
.sidebar-foot{padding:10px;font-size:12px;color:var(--muted)}

main{
  flex:1;min-width:0;background:var(--bg);border-radius:var(--radius);
  padding:20px 28px 32px;
}
.view{display:none}
.view.active{display:block}

/* Top bar */
.topbar{display:flex;align-items:center;gap:8px;margin-bottom:18px;position:sticky;top:0;z-index:20;background:var(--bg);padding:6px 0}
.top-title{font-weight:800;font-size:17px;margin-left:4px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-search{margin-left:auto}

/* Bottom nav (mobile) */
.bottomnav{
  display:none;position:fixed;left:0;right:0;bottom:var(--player-h);z-index:40;
  background:var(--page-bg);border-top:1px solid var(--border);
  padding:6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav .nav-btn{flex-direction:column;gap:2px;font-size:11px;padding:6px 4px;align-items:center;justify-content:center}

/* Home */
.home-greet{font-size:32px}
.home-sub{margin-bottom:14px}
.search-row{display:flex;gap:10px;align-items:center}
.search-box{
  flex:1;display:flex;align-items:center;gap:10px;background:var(--surface-2);
  border:1px solid var(--border);border-radius:999px;padding:11px 16px;
}
.search-box input{flex:1;border:0;background:none;outline:none;font-size:16px;min-width:0}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 4px}
.chip{
  border:0;background:var(--surface-2);border-radius:999px;
  padding:7px 14px;font-weight:700;font-size:14px;color:var(--ink);
}
.chip:hover{filter:brightness(1.15)}
.chip.active{background:var(--ink);color:var(--bg)}
.mood-chip.active{background:var(--accent);color:var(--accent-ink)}
.chip.accent.active{background:var(--accent);color:var(--accent-ink)}

/* Home grid 2 kolom ala referensi (cover kiri + judul kanan) */
.home-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:4px}
.hcard{
  display:flex;align-items:center;gap:12px;background:var(--surface-2);
  border-radius:var(--radius);overflow:hidden;text-align:left;
  padding:0 12px 0 0;min-height:64px;position:relative;
}
.hcard:hover{filter:brightness(1.18)}
.hcard img,.hcard .cover-fallback{width:64px;height:64px;object-fit:cover;flex:0 0 64px;background:var(--surface);display:flex;align-items:center;justify-content:center;font-size:22px}
.hcard-title{font-weight:800;font-size:15px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hcard-play{
  width:40px;height:40px;border-radius:50%;background:var(--accent);color:var(--accent-ink);
  display:flex;align-items:center;justify-content:center;font-size:15px;flex:0 0 40px;
  box-shadow:0 4px 14px rgba(0,0,0,.45);
}

/* Featured card */
.featured{
  display:flex;gap:22px;align-items:center;background:var(--surface);
  border-radius:var(--radius);padding:22px;margin:26px 0 6px;
}
.feat-cover{width:180px;height:180px;object-fit:cover;border-radius:var(--radius);box-shadow:var(--shadow);flex:0 0 180px;background:var(--surface-2)}
.feat-body{min-width:0}
.feat-label{font-size:12px;font-weight:800;letter-spacing:.08em;color:var(--accent);margin-bottom:6px}
.feat-title{font-size:32px;font-weight:800;line-height:1.15;letter-spacing:-.02em}
.feat-artist{color:var(--muted);margin:4px 0 16px}
.feat-btns{display:flex;gap:10px;flex-wrap:wrap}

/* Track rows ala Spotify */
.track{
  display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:var(--radius);width:100%;text-align:left;
}
.track:hover{background:var(--hover)}
.track.playing{background:var(--hover)}
.track.playing .t-title{color:var(--accent)}
.track .cover{width:48px;height:48px;border-radius:6px;object-fit:cover;background:var(--surface-2);flex:0 0 48px}
.track .cover-fallback{width:48px;height:48px;border-radius:6px;background:var(--surface-2);display:flex;align-items:center;justify-content:center;font-size:20px;flex:0 0 48px}
.track .t-meta{flex:1;min-width:0}
.track .t-title{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.track .t-sub{color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.track .t-sub button{color:var(--muted);text-decoration:underline;text-underline-offset:2px}
.track .t-sub button:hover{color:var(--accent)}
.track .t-dur{color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums}
@media (hover:hover){
  .track .icon-btn{opacity:0}
  .track:hover .icon-btn,.track:focus-within .icon-btn{opacity:1}
  .track .icon-btn.liked{opacity:1}
  .hcard-play{opacity:0;transition:opacity .15s}
  .hcard:hover .hcard-play{opacity:1}
}
.icon-btn{
  width:38px;height:38px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;
  font-size:17px;flex:0 0 38px;color:var(--muted);
}
.icon-btn:hover{color:var(--ink)}
.icon-btn.sm{width:30px;height:30px;font-size:14px;flex-basis:30px}
.icon-btn.liked{color:#1ed760}
.icon-btn.accent{color:var(--accent)}

/* Shelves / cards ala Spotify */
.shelf-row{display:flex;gap:14px;overflow-x:auto;padding-bottom:8px;scrollbar-width:thin}
.card{flex:0 0 168px;background:var(--surface);border-radius:var(--radius);padding:16px;text-align:left;position:relative}
.card:hover{background:var(--surface-2)}
.card img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:var(--radius);margin-bottom:10px;background:var(--surface-2);box-shadow:var(--shadow)}
.card .c-title{font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card .c-sub{color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-play{
  position:absolute;right:26px;bottom:74px;width:48px;height:48px;border-radius:50%;
  background:var(--accent);color:var(--accent-ink);display:flex;align-items:center;justify-content:center;
  font-size:17px;box-shadow:0 6px 18px rgba(0,0,0,.5);opacity:0;transform:translateY(8px);transition:opacity .15s,transform .15s;
  pointer-events:none;
}
.card:hover .card-play{opacity:1;transform:translateY(0)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px}
.skeleton{
  border-radius:var(--radius);background:linear-gradient(90deg,var(--surface) 25%,var(--surface-2) 50%,var(--surface) 75%);
  background-size:200% 100%;animation:shimmer 1.2s infinite;min-height:64px;
}
@keyframes shimmer{to{background-position:-200% 0}}
.empty{padding:36px 16px;text-align:center;color:var(--muted);background:var(--surface);border-radius:var(--radius)}
.spinner{width:22px;height:22px;border:3px solid var(--surface-2);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;margin:20px auto}
@keyframes spin{to{transform:rotate(360deg)}}

/* Queue panel (kanan, desktop) */
.queue-panel{
  background:var(--bg);border-radius:var(--radius);padding:18px 14px;
  position:sticky;top:8px;height:calc(100vh - var(--player-h) - 16px);
  overflow-y:auto;min-width:0;
}
.qp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.qp-head h2{margin:0;font-size:18px}
.qp-actions{display:flex;gap:2px}
#sideQueueList .queue-item{padding:8px 8px}
#sideQueueList .queue-item .icon-btn{width:28px;height:28px;font-size:13px;flex-basis:28px}

/* Player bar ala Spotify */
.playerbar{
  position:fixed;left:0;right:0;bottom:0;z-index:50;height:var(--player-h);
  background:var(--page-bg);border-top:1px solid var(--border);
  display:flex;align-items:center;gap:16px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));
}
.pb-left{flex:1;display:flex;align-items:center;gap:12px;min-width:0;max-width:32%}
.playerbar .pb-cover{width:56px;height:56px;border-radius:6px;object-fit:cover;background:var(--surface-2);flex:0 0 56px;cursor:pointer}
.playerbar .pb-meta{flex:1;min-width:0;cursor:pointer}
.playerbar .pb-title{font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.playerbar .pb-artist{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pb-center{flex:1.4;display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0}
.pb-controls{display:flex;align-items:center;gap:12px}
.pb-progress-row{display:flex;align-items:center;gap:8px;width:100%;max-width:560px}
.pb-progress{flex:1;height:4px;background:#4d4d4d;border-radius:2px;cursor:pointer;position:relative}
.pb-progress:hover{height:6px}
.pb-progress .fill{height:100%;background:var(--accent);width:0%;border-radius:2px}
.pb-time{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.play-btn{
  width:40px;height:40px;border-radius:50%;background:var(--accent);color:var(--accent-ink);
  display:inline-flex;align-items:center;justify-content:center;font-size:16px;flex:0 0 40px;
}
.play-btn:hover{transform:scale(1.05)}
.play-btn.big{width:64px;height:64px;font-size:24px;background:var(--accent);color:var(--accent-ink)}
.pb-right{flex:1;display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0}
input[type="range"]{accent-color:var(--accent)}
.vol{display:flex;align-items:center;gap:6px;color:var(--muted)}
.vol input{width:90px}

/* Now Playing */
.nowplaying{
  position:fixed;inset:0;z-index:60;background:var(--bg);overflow-y:auto;
  padding:20px 20px calc(var(--player-h) + 24px);
}
.np-head{display:flex;align-items:center;justify-content:space-between;max-width:720px;margin:0 auto 8px}
.np-body{max-width:720px;margin:0 auto}
.np-cover{width:min(78vw,340px);aspect-ratio:1;object-fit:cover;border-radius:var(--radius);margin:14px auto;box-shadow:var(--shadow);background:var(--surface-2)}
.np-title{text-align:center;font-size:22px;font-weight:800}
.np-artist{text-align:center;color:var(--muted);margin-bottom:6px}
.np-artist button{color:var(--muted);text-decoration:underline;text-underline-offset:2px}
.np-progress{display:flex;align-items:center;gap:10px;margin:18px 0 6px}
.np-progress input{flex:1}
.np-controls{display:flex;align-items:center;justify-content:center;gap:14px;margin:14px 0}
.np-extra{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.pill{border:1px solid var(--border);border-radius:999px;padding:6px 12px;font-size:13px;font-weight:600;background:var(--surface)}
.pill.active{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.lyrics{max-width:560px;margin:0 auto;text-align:center}
.lyric-line{padding:7px 10px;border-radius:10px;color:var(--muted);cursor:pointer;font-size:17px}
.lyric-line:hover{background:var(--surface)}
.lyric-line.active{color:var(--ink);font-weight:800;font-size:19px}
.lyric-line.active::before{content:"♪ "}
.queue-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--radius)}
.queue-item:hover{background:var(--hover)}
.queue-item.current{background:var(--hover)}
.queue-item.current .q-title{color:var(--accent)}
.queue-item .q-meta{flex:1;min-width:0}
.queue-item .q-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Settings / forms */
.field{margin-bottom:18px}
.field label{display:block;font-weight:700;margin-bottom:6px}
.field select,.field input[type="text"],.field input[type="number"]{
  width:100%;max-width:420px;padding:10px 12px;border:1px solid var(--border);
  border-radius:var(--radius);background:var(--surface);
}
.swatches{display:flex;gap:10px;flex-wrap:wrap}
.swatch{width:38px;height:38px;border-radius:50%;border:3px solid transparent;cursor:pointer}
.swatch.active{border-color:var(--ink)}
.btn{
  display:inline-flex;align-items:center;gap:8px;background:var(--ink);color:var(--bg);
  border-radius:999px;padding:10px 18px;font-weight:700;
}
.btn.secondary{background:var(--surface);color:var(--ink);border:1px solid var(--border)}
.btn.danger{background:#c81e1e;color:#fff}
.btn.accent{background:var(--accent);color:var(--accent-ink)}
.btn.play-green{background:var(--accent);color:var(--accent-ink);padding:12px 28px;font-size:15px}
.btnrow{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin:16px 0}
.stat-card{background:var(--surface);border-radius:var(--radius);padding:16px}
.stat-card .num{font-size:26px;font-weight:800}
.stat-card .lbl{color:var(--muted);font-size:13px}
.bar-chart{display:flex;align-items:flex-end;gap:6px;height:140px;padding-top:8px}
.bar-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.bar{width:100%;max-width:34px;background:var(--accent);border-radius:6px 6px 0 0;min-height:3px}
.bar-col span{font-size:11px;color:var(--muted)}
.playlist-card{background:var(--surface);border-radius:var(--radius);padding:16px;display:flex;align-items:center;gap:12px;margin-bottom:10px}
.playlist-card .p-meta{flex:1;min-width:0}
.toast{
  position:fixed;left:50%;bottom:calc(var(--player-h) + 16px);transform:translateX(-50%);
  background:var(--ink);color:var(--bg);padding:10px 18px;border-radius:999px;z-index:80;
  font-weight:600;box-shadow:var(--shadow);max-width:90vw;text-align:center;
}
.yt-hidden{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none;left:-9999px;top:0}
.greet{color:var(--muted);margin-bottom:2px}

/* 900–1199px: sidebar + konten, panel Queue disembunyikan */
@media (max-width:1199px){
  #app{grid-template-columns:240px minmax(0,1fr)}
  .queue-panel{display:none}
  .home-grid{grid-template-columns:1fr 1fr}
}

/* Mobile: sidebar + queue disembunyikan, navigasi bawah */
@media (max-width:899px){
  #app{display:block;padding:0 0 calc(var(--player-h) + var(--nav-h))}
  .sidebar{display:none}
  .queue-panel{display:none}
  .bottomnav{display:flex}
  main{padding:16px 16px 24px;border-radius:0}
  .topbar{position:static}
  .top-search{display:none}
  .home-greet{font-size:26px}
  .home-grid{grid-template-columns:1fr}
  .featured{flex-direction:column;align-items:flex-start;gap:14px}
  .feat-cover{width:150px;height:150px;flex-basis:150px}
  .feat-title{font-size:24px}
  .vol{display:none}
  .pb-left{max-width:44%}
  .pb-controls{gap:6px}
  #pbShuffleBtn,#pbRepeatBtn{display:none}
  .playerbar{padding-left:10px;padding-right:10px;gap:8px}
  h1{font-size:22px}
}
