:root{
  --bg-0:#0A0A0B; --bg-1:#111113; --card:#17171A; --card-hover:#1E1E22;
  --text:rgba(255,255,255,0.94); --text-dim:rgba(255,255,255,0.55); --text-faint:rgba(255,255,255,0.32);
  --accent-1:#FF7A47; --accent-2:#D8542E;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  --sidebar-w: 236px; --right-w: 290px; --player-h: 84px;
}
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html, body { height: 100%; overflow-x: hidden; max-width: 100%; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }
::selection { background: var(--accent-1); color: #fff; }
*:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; border-radius: 4px; }

input[type="file"]#fileInput, input[type="file"]#folderInput { display: none !important; }

body{
  margin:0; color:var(--text); font-family:var(--font);
  background: radial-gradient(900px 600px at 8% 0%, rgba(255,122,71,0.14) 0%, transparent 55%),
              radial-gradient(800px 700px at 95% 15%, rgba(90,79,224,0.12) 0%, transparent 55%),
              radial-gradient(1000px 800px at 50% 100%, rgba(58,165,160,0.10) 0%, transparent 55%), var(--bg-0);
  background-attachment:fixed;
}
svg{ display:block; }
.icon{ width:16px; height:16px; flex-shrink:0; }

.drop-overlay {
  position: fixed; inset: 0; background: rgba(255, 122, 71, 0.9); z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.2s ease; backdrop-filter: blur(10px);
}
.drop-overlay.show { opacity: 1; visibility: visible; }
.drop-overlay h2 { font-size: 28px; font-weight: 700; color: #fff; }

.app{ display:grid; grid-template-columns: var(--sidebar-w) 1fr var(--right-w); min-height:100vh; padding-bottom:var(--player-h); }

/* Sidebar */
.sidebar{ background:rgba(10,10,12,0.5); backdrop-filter:blur(26px) saturate(150%); padding:22px 18px; display:flex; flex-direction:column; gap:26px; position:sticky; top:0; height:100vh; overflow-y:auto; }
.logo{ font-size:16px; font-weight:700; letter-spacing:-0.3px; display:flex; align-items:center; gap:9px; }
.logo .icon{ width:18px; height:18px; color:var(--accent-1); }
.nav-group .nav-label{ font-size:11px; letter-spacing:1px; text-transform:uppercase; color:var(--text-faint); margin-bottom:10px; padding:0 10px; }
.nav-item{ display:flex; align-items:center; gap:11px; padding:9px 10px; border-radius:10px; font-size:13.5px; color:var(--text-dim); cursor:pointer; transition:background 150ms ease, color 150ms ease; white-space:nowrap; }
.nav-item:hover{ background:rgba(255,255,255,0.05); color:var(--text); }
.nav-item.active{ background:rgba(255,255,255,0.07); color:var(--text); font-weight:600; }
.sidebar-footer{ margin-top:auto; font-size:10.5px; color:var(--text-faint); padding:0 10px; line-height:1.5; }

/* Main Content */
.main-col{ min-width:0; padding:22px 28px 40px; }
.topbar{ display:flex; align-items:center; gap:16px; margin-bottom:26px; }
.hamburger{ display:none; background:none; border:none; color:var(--text); cursor:pointer; padding:4px; align-items:center; justify-content:center; }
.search-box{ flex:1; max-width:360px; position:relative; }
.search-box .icon{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--text-faint); }
.search-box input{ width:100%; background:rgba(255,255,255,0.06); backdrop-filter:blur(18px) saturate(150%); color:var(--text); border:none; outline:none; border-radius:12px; padding:10px 14px 10px 36px; font-size:13px; font-family:var(--font); }
.search-box input::placeholder{ color:var(--text-faint); }
.topbar-actions{ margin-left:auto; display:flex; align-items:center; gap:10px; }
.pill-btn{ background:rgba(255,255,255,0.06); backdrop-filter:blur(18px) saturate(150%); color:var(--text); border:none; border-radius:20px; padding:9px 16px; font-size:12.5px; font-weight:600; cursor:pointer; display:flex; align-items:center; gap:7px; transition:transform 100ms ease; }
.pill-btn:hover{ background:rgba(255,255,255,0.1); }
.pill-btn.accent{ background:linear-gradient(135deg, var(--accent-1), var(--accent-2)); color:#1a0800; }
.track-count-chip{ font-size:11.5px; color:var(--text-faint); font-family:var(--font-mono); }

/* Hero */
.hero{ position:relative; border-radius:22px; padding:34px; margin-bottom:34px; overflow:hidden; background:linear-gradient(120deg, var(--accent-1) 0%, var(--accent-2) 55%, #7a2c17 100%); min-height:230px; display:flex; align-items:flex-end; }
.hero-inner{ position:relative; z-index:1; max-width:520px; }
.hero-eyebrow{ font-size:11px; letter-spacing:2px; text-transform:uppercase; color:rgba(255,255,255,0.75); font-weight:700; margin-bottom:10px; }
.hero-title{ font-size:clamp(26px, 4vw, 38px); font-weight:700; letter-spacing:-1px; margin-bottom:10px; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hero-sub{ font-size:13.5px; color:rgba(255,255,255,0.85); margin-bottom:20px; }
.hero-meta{ display:flex; align-items:center; gap:14px; }
.hero-like{ width:38px; height:38px; border-radius:50%; background:rgba(0,0,0,0.25); display:flex; align-items:center; justify-content:center; color:#fff; cursor:pointer; flex-shrink:0; }
.hero-meta-text{ font-size:12.5px; color:rgba(255,255,255,0.85); font-weight:600; }
.hero-play{ margin-left:auto; width:52px; height:52px; border-radius:50%; background:#fff; color:#20120a; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 10px 24px rgba(0,0,0,0.3); }

/* Grid & Card */
.section-head{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:16px; }
.section-head h2{ font-size:16px; font-weight:700; margin:0; }
.track-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap:18px; }
.track-card{ background:transparent; cursor:pointer; border-radius:12px; padding:8px; transition:background 150ms ease; position: relative; }
.track-card:hover{ background:rgba(255,255,255,0.05); }
.card-art{ width:100%; aspect-ratio:1/1; border-radius:12px; margin-bottom:10px; display:flex; align-items:center; justify-content:center; position:relative; overflow:hidden; background-size: cover !important; background-position: center !important; }
.card-art .icon{ width:28px; height:28px; color:rgba(255,255,255,0.55); }
.card-art .play-overlay{ position:absolute; right:8px; bottom:8px; width:32px; height:32px; border-radius:50%; background:var(--accent-1); color:#20120a; display:flex; align-items:center; justify-content:center; opacity:0; transform:translateY(4px); transition:all 150ms ease; }

.card-download {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  opacity: 0; transition: opacity 150ms ease, background 150ms ease; z-index: 5;
}
.track-card:hover .card-download { opacity: 1; }
.card-download:hover { background: var(--accent-1); color: #000; }
.card-download.loading { animation: pulse 1s infinite; pointer-events: none; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.8); opacity: 0.5; } 100% { transform: scale(1); opacity: 1; } }

.track-card:hover .play-overlay{ opacity:1; transform:translateY(0); }
.track-card.playing .card-art .play-overlay{ opacity:1; transform:translateY(0); background:#fff; }
.card-title{ font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom:2px; }
.track-card.playing .card-title{ color:var(--accent-1); }
.card-sub{ font-size:11.5px; color:var(--text-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.empty-state{ grid-column:1/-1; text-align:center; padding:50px 20px; color:var(--text-faint); font-size:13px; }

/* Right Panel */
.right-panel{ background:rgba(255,255,255,0.03); backdrop-filter:blur(24px) saturate(150%); padding:22px 20px; position:sticky; top:0; height:100vh; display:flex; flex-direction:column; }
.rp-tabs { display: flex; gap: 16px; margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.rp-tab { font-size: 12.5px; color: var(--text-faint); cursor: pointer; padding-bottom: 8px; position: relative; }
.rp-tab.active { color: var(--text); font-weight: 700; }
.rp-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent-1); }
.rp-content { display: none; flex: 1; overflow-y: auto; }
.rp-content.active { display: block; }

/* Queue List */
.queue-row{ display:flex; align-items:center; gap:10px; padding:8px 6px; border-radius:10px; cursor:pointer; font-size:12.5px; transition: border-color 0.2s; border-top: 2px solid transparent; }
.queue-row:hover{ background:rgba(255,255,255,0.06); }
.queue-row.playing{ background:rgba(255,122,71,0.12); }
.queue-row.drag-over { border-top: 2px solid var(--accent-1); background:rgba(255,255,255,0.03); }
.queue-thumb{ width:32px; height:32px; border-radius:8px; flex-shrink:0; display:flex; align-items:center; justify-content:center; background-size: cover !important; background-position: center !important; }
.queue-name-col { flex:1; min-width:0; pointer-events: none; }
.queue-name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--text); }
.queue-row.playing .queue-name{ color:var(--accent-1); font-weight:600; }
.queue-artist { font-size:10px; color:var(--text-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.queue-remove{ background:none; border:none; color:var(--text-faint); cursor:pointer; padding:4px; opacity:0; }
.queue-row:hover .queue-remove{ opacity:1; }

/* Lyrics List */
#lyricsList { text-align: center; padding: 20px 0 60px; }
.lrc-line { font-size: 13.5px; color: var(--text-faint); margin-bottom: 18px; transition: all 0.3s ease; line-height: 1.5; }
.lrc-line.active { color: var(--accent-1); font-size: 15px; font-weight: 700; transform: scale(1.05); text-shadow: 0 0 10px rgba(255,122,71,0.3); }

/* Player Bar */
.player-bar{ position:fixed; left:0; right:0; bottom:0; height:var(--player-h); background:rgba(10,10,11,0.85); backdrop-filter:blur(24px) saturate(160%); display:grid; grid-template-columns: 1fr 2fr 1fr; align-items:center; padding:0 22px; z-index:50; transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1); }
.pb-chevron { display: none; }
.pb-left{ display:flex; align-items:center; gap:12px; min-width:0; }
.pb-thumb{ width:48px; height:48px; border-radius:10px; flex-shrink:0; display:flex; align-items:center; justify-content:center; background-size: cover !important; background-position: center !important; }
.pb-info{ min-width:0; }
.pb-title{ font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pb-sub{ font-size:11.5px; color:var(--text-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pb-center{ display:flex; flex-direction:column; align-items:center; gap:6px; min-width:0; }
.pb-controls{ display:flex; align-items:center; gap:18px; }
.pb-btn{ background:none; border:none; color:var(--text-dim); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; transition:transform 100ms ease; }
.pb-btn.active{ color:var(--accent-1); }
.pb-play{ width:34px; height:34px; border-radius:50%; background:#fff; color:#0A0A0B; }
.pb-seek-row{ display:flex; align-items:center; gap:9px; width:100%; max-width:520px; }
.pb-time{ font-size:10.5px; color:var(--text-faint); font-family:var(--font-mono); min-width:32px; text-align:center; flex-shrink:0; }
.pb-right{ display:flex; align-items:center; justify-content:flex-end; gap:14px; position: relative; }

/* Vol Popup */
.vol-container { position: relative; display: flex; align-items: center; justify-content: center; }
.vol-popup { position: absolute; bottom: calc(100% + 20px); right: -14px; background: rgba(255,255,255,0.04); backdrop-filter: blur(28px) saturate(150%); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 16px 12px; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.95); transition: all 0.2s ease; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 100; }
.vol-popup.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.vol-slider-wrapper { width: 24px; height: 110px; display: flex; align-items: center; justify-content: center; }
.vol-slider-wrapper input[type=range] { width: 110px; margin: 0; transform: rotate(-90deg); }

/* Input Range Styles */
input[type=range]{ -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px; background-color: rgba(255,255,255,0.14); background-image: linear-gradient(var(--accent-1), var(--accent-1)); background-size: var(--progress, 0%) 100%; background-repeat: no-repeat; outline: none; cursor: pointer; margin: 8px 0; }
input[type=range]::-webkit-slider-thumb{ -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
#volume { background-image: linear-gradient(#fff, #fff); }

.backdrop{ display:none; position:fixed; inset:0; background:rgba(0,0,0,0.55); z-index:60; }
.backdrop.show{ display:block; }

/* Mobile Lirik */
.pb-lyrics-toggle { display: none; }
.mobile-lyrics-container { display: none; flex: 1; overflow-y: auto; width: 100%; padding: 0; text-align: center; }
#mobileLyricsList { padding: 20px 0 60px; }

/* Mobile Responsive */
@media (max-width:1180px){ .app{ grid-template-columns: var(--sidebar-w) 1fr; } .right-panel{ display:none; } }
@media (max-width:860px){
  .app{ grid-template-columns: 1fr; }
  .sidebar{ position:fixed; left:0; top:0; bottom:0; width:240px; transform:translateX(-100%); transition:transform 220ms ease; z-index:70; }
  .sidebar.show{ transform:translateX(0); }
  .hamburger{ display:flex; }
  .hero{ min-height:190px; }
}
@media (max-width:600px){
  :root{ --player-h:78px; }
  .player-bar { grid-template-columns: auto 1fr auto; padding: 0 12px; cursor: pointer; }
  .pb-left .pb-info, .vol-container { display:none; }
  .pb-seek-row{ max-width:none; }
  .track-grid{ grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  
  .player-bar.expanded { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100dvh; background: var(--bg-0); z-index: 100; display: flex; flex-direction: column; padding: 40px 24px; cursor: default; }
  .player-bar.expanded .pb-chevron { display: flex; align-items: center; justify-content: center; position: absolute; top: 15px; left: 50%; transform: translateX(-50%); padding: 10px; color: var(--text-dim); }
  
  .player-bar.expanded .pb-lyrics-toggle { display: block; position: absolute; top: 15px; right: 15px; font-size: 13px; color: var(--accent-1); font-weight: bold; padding: 10px; cursor: pointer; z-index: 10; letter-spacing: 1px; }
  .player-bar.expanded.show-lyrics .pb-left { display: none !important; }
  .player-bar.expanded.show-lyrics .mobile-lyrics-container { display: block; margin-top: 50px; margin-bottom: auto; }
  .player-bar.expanded.show-lyrics .pb-lyrics-toggle { color: #fff; }

  .player-bar.expanded .pb-left { flex-direction: column; margin-top: 6vh; }
  .player-bar.expanded .pb-left .pb-info { display: flex; flex-direction: column; align-items: center; margin-top: 24px; }
  .player-bar.expanded .pb-thumb { width: clamp(200px, 70vw, 320px); height: clamp(200px, 70vw, 320px); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
  .player-bar.expanded .pb-title { font-size: 24px; text-align: center; margin-bottom: 6px; }
  .player-bar.expanded .pb-sub { display: block; font-size: 15px; text-align: center; }
  
  .player-bar.expanded .pb-center { margin-top: auto; margin-bottom: 6vh; width: 100%; }
  .player-bar.expanded .pb-controls { gap: 24px; margin-bottom: 30px; justify-content: center; }
  .player-bar.expanded .pb-play { width: 64px; height: 64px; }
  
  .player-bar.expanded .pb-right { position: absolute; bottom: 45px; right: 25px; width: auto; }
  .player-bar.expanded .vol-container { display: flex; }
  .player-bar.expanded .vol-popup { bottom: calc(100% + 20px); right: -10px; }
}

/* Profil & Pengaturan */
.profile-header {
  display: flex; align-items: center; gap: 20px; margin-bottom: 34px;
  background: linear-gradient(120deg, var(--card) 0%, rgba(255,255,255,0.02) 100%);
  padding: 30px; border-radius: 22px; border: 1px solid rgba(255,255,255,0.05);
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}
.profile-info h2 { margin: 0 0 6px 0; font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.profile-info p { margin: 0; font-size: 14px; color: var(--text-faint); }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.profile-card {
  background: rgba(255,255,255,0.02); backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 24px;
}
.profile-card h3 { margin: 0 0 16px 0; font-size: 15px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 12px;}
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13.5px; color: var(--text-dim); }
.stat-value { font-weight: 700; color: #fff; font-size: 16px; }

/* Swatches Tema */
.theme-swatches { display: flex; gap: 14px; margin-top: 16px; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: transform 0.2s ease, outline 0.2s ease;
  outline: 2px solid transparent; outline-offset: 3px;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { outline-color: var(--text); }

/* Sleep Timer Items */
.timer-opt {
  padding: 8px 12px; width: 100%; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--text-dim); cursor: pointer; transition: background 0.2s, color 0.2s; text-align: center;
}
.timer-opt:hover { background: rgba(255,255,255,0.08); color: #fff; }
#timerBtn.active { color: var(--accent-1); animation: pulse-glow 2s infinite; }
@keyframes pulse-glow { 0% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 10px var(--accent-1); } 100% { text-shadow: 0 0 0 transparent; } }

/* Playlist Tambahan */
.card-add-playlist {
  position: absolute; top: 8px; left: 8px; width: 30px; height: 30px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  opacity: 0; transition: all 150ms ease; z-index: 5;
}
.track-card:hover .card-add-playlist { opacity: 1; }
.card-add-playlist:hover { background: var(--accent-1); color: #000; transform: scale(1.1); }

/* Modal Tambah ke Playlist */

.playlist-modal-content {
  background: var(--card); border: 1px solid rgba(255,255,255,0.1);
  padding: 24px; border-radius: 16px; width: 90%; max-width: 320px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.playlist-opt-btn {
  width: 100%; text-align: left; background: rgba(255,255,255,0.05);
  border: none; color: #fff; padding: 12px 16px; border-radius: 8px;
  margin-bottom: 8px; cursor: pointer; transition: background 0.2s; font-family: var(--font);
}
.playlist-opt-btn:hover { background: var(--accent-1); color: #000; font-weight: 600;}

/* Indikator Hapus Playlist di Sidebar */
.nav-item-playlist { justify-content: space-between; padding-right: 4px; }
.delete-pl-btn { background: none; border: none; color: var(--text-faint); cursor: pointer; opacity: 0; transition: opacity 0.2s, color 0.2s; padding: 4px; }
.nav-item:hover .delete-pl-btn { opacity: 1; }
.delete-pl-btn:hover { color: #ff4a4a; }

.playlist-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  z-index: 999999; display: flex; align-items: center; justify-content: center;
  opacity: 1; visibility: hidden; transition: all 0.2s ease;
}
.playlist-modal.show { opacity: 1; visibility: visible; }

.profile-avatar-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  background-size: cover !important;
  background-position: center !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
  overflow: hidden;
}

.avatar-edit-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--card-hover);
  border: 2px solid var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.avatar-edit-badge:hover {
  background: var(--accent-1);
  color: #000;
  transform: scale(1.1);
}

.edit-name-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.edit-name-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}