:root {
    --bg: #0d0e12;
    --bg-soft: #14161c;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.09);
    --border-soft: rgba(255, 255, 255, 0.06);
    --text: #e4e6ee;
    --text-muted: #7b8094;
    --text-faint: #565b6e;
    --accent: #9ca3af;
    --accent-soft: rgba(156, 163, 175, 0.18);
    --accent-dim: #4b5563;
    --accent-text: #ffffff;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-lg: 1.4rem;
    --radius-md: 0.9rem;
    --radius-sm: 0.5rem;
}

body {
    font-family: var(--font-ui);
    background: radial-gradient(ellipse at top, #171922, var(--bg) 60%);
    color: var(--text);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease-in-out;
    position: relative;
    z-index: 1;
}

body.player-active-bg { background-color: #0c0a08; }
body.detail-active-bg { background-color: #17140f; }

/* Video Background */
.video-background-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
}
.video-background-container.active { opacity: 1; }
.video-background-container video {
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}
.video-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(10, 9, 7, 0.35), rgba(10, 9, 7, 0.7));
    z-index: 1;
}

/* Pages */
.page {
    width: 100%;
    max-width: 800px;
    padding: 1rem;
    display: none;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    background-color: transparent;
}
.page.active { display: flex; }
#playerPage { max-width: 100%; }

header {
    width: 100%;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text);
}
header h1 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text);
    margin: 0;
}
header p.header-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.4rem;
    font-weight: 400;
}

/* Search */
.search-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin-bottom: 1.6rem;
}
.search-icon {
    position: absolute;
    left: 1.1rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
    transition: color 0.3s ease;
}
.search-box:focus-within .search-icon { color: var(--accent); }
.search-box input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 2.6rem 0.8rem 2.8rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font-ui);
    outline: none;
    transition: all 0.25s ease;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box input:focus {
    background: var(--surface-hover);
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.clear-search-btn {
    position: absolute;
    right: 0.6rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    display: none;
}
.search-box.has-text .clear-search-btn { display: block; }
.clear-search-btn:hover { color: var(--text); }

/* Category filters */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2.2rem;
    width: 100%;
    grid-column: 1 / -1;
}
.filter-btn {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    padding: 0.55rem 1.3rem;
    border-radius: 2rem;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}
.filter-btn:hover {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface);
}
.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    color: var(--accent-text);
    border-color: var(--accent);
    font-weight: 600;
}



/* Tracklist (bukan kartu seragam — baris bernomor dengan garis tipis) */
.song-list {
    list-style: none;
    padding: 0;
    width: 100%;
    max-width: 750px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding-bottom: 170px;
}

.song-list li {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    padding: 1rem 1.3rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.song-list li:hover .song-art-list {
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.song-art-list {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    margin-right: 1.1rem;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.song-info-list h3 {
    font-family: var(--font-display);
    margin: 0 0 0.25rem 0;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text);
}
.song-info-list p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.loading-songs {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    background: transparent !important;
    cursor: default !important;
}
.loading-songs:hover { background: transparent !important; }

/* Back button */
.back-btn {
    position: absolute;
    top: 1.5rem; left: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    color: var(--text);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-ui);
    z-index: 10;
    transition: all 0.2s ease;
}
.back-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border);
}
.back-btn i { margin-right: 0.5rem; }

/* Music Player */
.music-player-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    min-height: 90vh;
    padding-top: 3rem;
    padding-left: 8vw;
    box-sizing: border-box;
}

.music-player-box {
    background: rgba(15, 16, 21, 0.6);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 460px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.focus-mode-btn {
    position: absolute;
    top: 1.2rem; right: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    z-index: 5;
}
.focus-mode-btn:hover { background: var(--surface-hover); color: var(--text); }

.player-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}
.album-art-player {
    width: 88px; height: 88px;
    border-radius: var(--radius-sm);
    margin-right: 1.2rem;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}
.track-info-player h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin: 0 0 0.3rem 0;
    color: var(--text);
}
.track-info-player p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.lyrics-container {
    height: 220px;
    overflow-y: auto;
    background: transparent;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.9;
    text-align: left;
    scroll-behavior: smooth;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}
.lyrics-container::-webkit-scrollbar { width: 5px; }
.lyrics-container::-webkit-scrollbar-track { background: transparent; }
.lyrics-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.lyrics-container::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

.lyric-line {
    color: rgba(242, 237, 228, 0.3);
    font-family: var(--font-ui);
    font-size: 1.02rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    margin-bottom: 0.8rem;
    cursor: pointer;
}
.lyric-line:hover { color: rgba(242, 237, 228, 0.6); }
.lyric-line.highlight {
    color: #ffffff;
    font-family: var(--font-ui);
    font-weight: 600;
    letter-spacing: -0.2px;
    font-size: 1.15rem;
    transform: translateX(6px);
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.3), 0 0 24px rgba(156, 163, 174, 0.4);
}

.lyrics-container:has(.dj-mode-container) {
    -webkit-mask-image: none;
    mask-image: none;
    overflow: hidden;
}

.player-controls { margin-top: auto; }

.progress-section-player { margin-bottom: 1.5rem; }
.progress-bar-container-player {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    height: 5px;
    width: 100%;
    position: relative;
    overflow: hidden;
    touch-action: none;
    transition: height 0.2s ease;
}
.progress-bar-container-player:hover,
.progress-bar-container-player.dragging { height: 9px; }
.progress-bar-player {
    background: var(--accent);
    width: 0%;
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 0 10px var(--accent-soft);
    transition: width 0.1s linear;
}
.progress-bar-container-player.dragging .progress-bar-player { transition: none; }

.time-display-player {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-weight: 500;
}

.main-controls-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}
.control-btn-player {
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.5rem;
}
.control-btn-player:hover { color: var(--text); }
.control-btn-player.play-pause-player {
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    color: var(--accent-text);
    width: 62px; height: 62px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    font-size: 1.6rem;
    transition: all 0.25s ease;
}
.control-btn-player.play-pause-player:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(156, 163, 175, 0.3);
}
.control-btn-player.active-feature {
    color: var(--accent) !important;
}

.secondary-controls-player {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
}
.control-btn-player.small-icon { font-size: 1.05rem; color: var(--text-faint); }

.volume-control-player {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    padding: 0.6rem;
    border-radius: 2rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
}
.volume-control-player:hover {
    padding: 0.5rem 1.2rem;
    background: var(--surface-hover);
    border-color: var(--border);
}
.volume-icon-player {
    color: var(--text-muted);
    font-size: 0.95rem;
    min-width: 16px;
    text-align: center;
}
.volume-control-player:hover .volume-icon-player { color: var(--text); }
.volume-slider-player {
    width: 0; opacity: 0; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 5px; outline: none; margin: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.volume-control-player:hover .volume-slider-player {
    width: 70px; opacity: 1; margin: 0 0.8rem; pointer-events: auto;
}
.volume-slider-player::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    background: var(--accent);
    border-radius: 50%; cursor: pointer;
}

.footer-credit {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-faint);
    margin-top: 1.5rem;
}

/* Song Detail Page (jika masih dipakai) */
.song-detail-container {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    width: 100%; max-width: 400px;
    margin-top: 5rem;
    text-align: center;
}
.detail-album-art {
    width: 200px; height: 200px;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    object-fit: cover;
}
.song-detail-container h2 { font-family: var(--font-display); font-size: 2rem; margin: 0 0 0.5rem 0; color: var(--text); }
.song-detail-container p { font-size: 1.05rem; color: var(--text-muted); margin: 0.3rem 0; }
.play-from-detail-btn {
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    color: var(--accent-text);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 2.5rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.play-from-detail-btn i { margin-right: 0.75rem; }

/* Mode DJ */
.dj-mode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    gap: 1.2rem;
}
.dj-glow {
    position: absolute;
    top: 46%; left: 50%;
    width: 180px; height: 180px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(156, 163, 174, 0.4), transparent 70%);
    filter: blur(30px);
    opacity: 0.35;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}
.dj-cover-breathing {
    width: 130px; height: 130px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 35px rgba(0,0,0,0.5), 0 0 0 1px var(--border-soft);
    transition: transform 0.15s ease-out;
    position: relative;
    z-index: 1;
}
.dj-eq-canvas { width: 200px; height: 44px; }

/* Mini Player */
.mini-player {
    position: fixed;
    left: 50%;
    bottom: 1.2rem;
    transform: translate(-50%, 120%);
    width: min(92%, 750px);
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 0.9rem 1.3rem;
    background: rgba(18, 19, 25, 0.9);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    cursor: pointer;
    z-index: 50;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.mini-player.show { transform: translate(-50%, 0); }
.mini-art { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.mini-info { flex: 1; min-width: 0; }
.mini-info h4 {
    font-family: var(--font-display);
    margin: 0; font-size: 0.92rem; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-info p {
    margin: 0.15rem 0 0 0; font-size: 0.74rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-nav-btn {
    background: none; border: none; color: var(--text-muted);
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; font-size: 1.1rem;
    transition: background 0.2s ease, color 0.2s ease;
}
.mini-nav-btn:hover { background: var(--surface-hover); color: var(--text); }
.mini-play-btn {
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    border: none;
    color: var(--accent-text);
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; font-size: 1.35rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mini-play-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 22px rgba(156, 163, 175, 0.3);
}

.mini-progress-container {
    position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}
.mini-progress-bar { height: 100%; background: var(--accent); }

.favorite-btn {
    border: none;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    margin-left: auto;
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    color: #ff6b8b;
    transform: scale(1.08);
}

.favorite-btn.active {
    color: #ff6b8b;
    text-shadow: 0 0 12px rgba(255, 107, 139, 0.35);
}

.player-fav-btn {
    position: absolute;
    top: 1.2rem;
    right: 4.2rem;
}


/* Mode Fokus */
body.focus-mode .music-player-container { justify-content: center; padding-left: 0; }
body.focus-mode .music-player-box {
    background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    border: none; box-shadow: none; max-width: 700px; width: 100%;
}
body.focus-mode .player-header,
body.focus-mode .player-controls,
body.focus-mode .back-btn { transition: opacity 0.4s ease, transform 0.4s ease; }
body.focus-mode .lyrics-container { height: 60vh; font-size: 1.15rem; transition: height 0.4s ease; }
body.focus-mode .lyric-line { font-size: 1.3rem; }
body.focus-mode .lyric-line.highlight { font-size: 1.55rem; }
body.focus-mode.focus-idle .player-header,
body.focus-mode.focus-idle .player-controls,
body.focus-mode.focus-idle .back-btn,
body.focus-mode.focus-idle .focus-mode-btn {
    opacity: 0; pointer-events: none; transform: translateY(-10px);
}
body.focus-mode.focus-idle .back-btn { transform: translateX(-10px); }

/* Navigasi bawah */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: none;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    background: rgba(13, 14, 18, 0.88);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-top: 1px solid var(--border-soft);
    z-index: 60;
}
body.on-home .bottom-nav { display: flex; }

.nav-tab {
    flex: 1;
    max-width: 160px;
    background: none;
    border: none;
    color: var(--text-faint);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}
.nav-tab i { font-size: 1.15rem; }
.nav-tab:hover { color: var(--text-muted); }
.nav-tab.active { color: var(--accent-text); }

/* Mini player naik di atas nav saat di beranda */
body.on-home .mini-player { bottom: 4.9rem; }
body.on-home .mini-player:not(.show) { opacity: 0; pointer-events: none; }

/* Tombol favorit ikut hilang di mode fokus saat idle */
body.focus-mode.focus-idle .player-fav-btn {
    opacity: 0; pointer-events: none;
}

/* Pilihan Favorit / Playlist */
.library-tabs {
    display: none;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}
body.lib-mode .library-tabs { display: flex; }
.lib-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-faint);
    padding: 0.4rem 1.1rem;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.lib-tab:hover { color: var(--text-muted); }
.lib-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); }

/* Daftar playlist: pencarian dan filter kategori tidak relevan */
body.playlist-overview .search-box,
body.playlist-overview .category-filters { display: none; }

/* Baris tombol di atas daftar Koleksi */
.song-list li.list-toolbar {
    grid-column: 1 / -1;
    background: transparent;
    border: none;
    padding: 0;
    gap: 0.6rem;
    cursor: default;
    flex-wrap: wrap;
}
.tb-btn {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    color: var(--text);
    padding: 0.55rem 1.1rem;
    border-radius: 2rem;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tb-btn:hover { background: var(--surface-hover); border-color: var(--border); }
.tb-btn i { margin-right: 0.4rem; }
.tb-btn.icon { padding: 0.55rem 0.8rem; }
.tb-btn.icon i { margin-right: 0; }
.tb-btn.primary {
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    color: var(--accent-text);
    border-color: var(--accent);
    font-weight: 600;
}

/* Kartu playlist */
.pl-art {
    width: 56px; height: 56px;
    border-radius: var(--radius-sm);
    margin-right: 1.1rem;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-hover);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Tombol ⋯ di kartu lagu */
.more-btn {
    border: none;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem 0.6rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.more-btn:hover { color: var(--text); background: var(--surface-hover); }

/* Menu lagu (bottom sheet) */
.sheet-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 85;
}
.sheet-overlay.show { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed;
    left: 50%; bottom: 0;
    width: min(480px, 100%);
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 1.2rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
    background: #14161c;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translate(-50%, 105%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
}
.sheet.show { transform: translate(-50%, 0); }
.sheet-head {
    display: flex; align-items: center; gap: 0.9rem;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-soft);
}
.sheet-head img { width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; }
.sheet-head h4 { margin: 0 0 0.2rem 0; font-size: 0.98rem; color: var(--text); }
.sheet-head p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.sheet-label {
    margin: 1rem 0 0.3rem 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.sheet-row {
    width: 100%;
    display: flex; align-items: center; gap: 0.9rem;
    background: none; border: none;
    color: var(--text);
    padding: 0.8rem 0.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}
.sheet-row:hover { background: var(--surface-hover); }
.sheet-row i { width: 18px; text-align: center; color: var(--text-muted); }
.sheet-row .fa-square-check { color: var(--accent-text); }

/* Panel antrean */
.queue-panel {
    position: fixed;
    top: 0; right: 0;
    width: min(360px, 92vw);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(18, 19, 24, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-left: 1px solid var(--border-soft);
    transform: translateX(105%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 80;
}
.queue-panel.open { transform: translateX(0); }
.queue-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.2rem 1.2rem 0.8rem;
}
.queue-head h3 { margin: 0; font-size: 1.1rem; color: var(--text); }
.queue-close {
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
}
.queue-close:hover { color: var(--text); }
.queue-list {
    list-style: none;
    margin: 0;
    padding: 0 0.6rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}
.queue-item {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.55rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}
.queue-item:hover { background: var(--surface-hover); }
.queue-item img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.q-info { flex: 1; min-width: 0; }
.q-info h4, .q-info p {
    margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.q-info h4 { font-size: 0.9rem; color: var(--text); }
.q-info p { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.15rem; }
.queue-item.current { background: var(--surface); }
.queue-item.current .q-info h4 { color: #ffffff; font-weight: 700; }
.q-now { color: var(--accent-text); font-size: 0.9rem; margin-right: 0.4rem; }
.q-remove {
    background: none; border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 50%;
}
.q-remove:hover { color: var(--text); background: var(--surface-hover); }

/* Di mode fokus saat idle, tombol antrean ikut tersembunyi lewat .player-controls */

/* Terakhir diputar */
.recent-section {
    display: none;
    width: 100%;
    max-width: 750px;
    margin-bottom: 1.6rem;
}
.recent-section.show { display: block; }
.recent-section h2 {
    margin: 0 0 0.8rem 0.2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.recent-row {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scrollbar-width: none;
}
.recent-row::-webkit-scrollbar { display: none; }
.recent-card {
    flex: 0 0 112px;
    display: flex;
    flex-direction: column;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
    font-family: var(--font-ui);
    cursor: pointer;
}
.recent-card img {
    width: 112px; height: 112px;
    border-radius: var(--radius-md);
    object-fit: cover;
    margin-bottom: 0.5rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.recent-card:hover img { transform: scale(1.05); }
.rc-title, .rc-artist {
    max-width: 112px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rc-title { font-size: 0.85rem; font-weight: 600; }
.rc-artist { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Ikon volume bisa diklik untuk mute */
.volume-icon-player { cursor: pointer; }


/* Tanda saat kartu lagu disorot / ditekan */
@media (hover: hover) {
    .song-list li:not(.list-toolbar):not(.loading-songs):hover {
        background: var(--surface-hover);
        border-color: var(--border);
    }
}
.song-list li:not(.list-toolbar):not(.loading-songs):active {
    transform: scale(0.98);
    background: var(--surface-hover);
}

/* ===== Warna dinamis ===== */
.dyn-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    background-color: #1b1d27;
    background-image: linear-gradient(to bottom,
        rgba(13, 14, 18, 0) 0%,
        rgba(13, 14, 18, 0.55) 55%,
        rgba(13, 14, 18, 0.95) 100%);
    transition: opacity 0.7s ease, background-color 0.9s ease;
}
body.dyn-on .dyn-bg { opacity: 1; }

/* Player dan mini player memakai warna lagu yang sedang diputar */
.music-player-box,
.mini-player {
    --accent: var(--dyn-accent, #9ca3af);
    --accent-dim: var(--dyn-accent-dim, #4b5563);
    --accent-soft: var(--dyn-accent-soft, rgba(156, 163, 175, 0.18));
}

/* ===== Baris Artis di Beranda ===== */
.artist-section {
    display: none;
    width: 100%;
    max-width: 750px;
    margin-bottom: 1.6rem;
}
.artist-section.show { display: block; }
.artist-section h2 {
    margin: 0 0 0.8rem 0.2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.artist-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scrollbar-width: none;
}
.artist-row::-webkit-scrollbar { display: none; }
.artist-card {
    flex: 0 0 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
    font-family: var(--font-ui);
    cursor: pointer;
}
.artist-card img {
    width: 96px; height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.artist-card:hover img { transform: scale(1.05); }
.ac-name, .ac-count {
    max-width: 96px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-name { font-size: 0.85rem; font-weight: 600; }
.ac-count { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ===== Halaman Artis ===== */
.artist-hero {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 4.5rem 1rem 1.6rem;
    margin-bottom: 1.4rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(to bottom, var(--hero-bg, #1b1d27), transparent);
}
.artist-avatar {
    width: 150px; height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.1rem;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.artist-hero h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: -0.5px;
    color: var(--text);
}
.artist-meta { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--text-muted); }
.artist-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.2rem;
}

/* Nama artis yang bisa diklik */
.artist-link { cursor: pointer; transition: color 0.2s ease; }
.artist-link:hover { color: var(--text); text-decoration: underline; }
.track-info-player p.linkable { cursor: pointer; transition: color 0.2s ease; }
.track-info-player p.linkable:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 600px) {
    .artist-avatar { width: 120px; height: 120px; }
    .artist-hero h2 { font-size: 1.6rem; }
}

/* ===== Pesan singkat (error audio, dll.) ===== */
.notice {
    position: fixed;
    left: 50%; bottom: 8.5rem;
    transform: translate(-50%, 10px);
    max-width: min(92vw, 420px);
    padding: 0.75rem 1.2rem;
    background: rgba(30, 32, 40, 0.97);
    border: 1px solid var(--border);
    border-radius: 1rem;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 130;
}
.notice.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Penanda fokus untuk pengguna keyboard ===== */
:where(button, a, select, textarea, [tabindex="0"]):focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}
.song-list li:focus-visible { border-color: var(--border); background: var(--surface-hover); }

/* Slider volume tetap bisa dijangkau keyboard (sebelumnya hanya muncul saat di-hover) */
.volume-control-player:focus-within {
    padding: 0.5rem 1.2rem;
    background: var(--surface-hover);
    border-color: var(--border);
}
.volume-control-player:focus-within .volume-slider-player {
    width: 70px; opacity: 1; margin: 0 0.8rem; pointer-events: auto;
}
.volume-slider-player:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 4px; }

/* Animasi kartu masuk */
.card-enter {
    animation: tileIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
@keyframes tileIn {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .card-enter { animation: none; }
}

/* Responsif */
@media (max-width: 600px) {
    header h1 { font-size: 2rem; }
    .music-player-box { max-width: 95%; padding: 1.5rem; border-radius: var(--radius-md); }
    .music-player-container { justify-content: center; padding-left: 0; }
    .player-header { flex-direction: column; text-align: center; margin-bottom: 1.5rem; }
    .album-art-player { width: 110px; height: 110px; margin: 0 0 1rem 0; }
    .track-info-player h2 { font-size: 1.15rem; }
    .lyrics-container { height: 160px; font-size: 0.95rem; text-align: center; }
    .control-btn-player { font-size: 1.3rem; }
    .control-btn-player.play-pause-player { width: 54px; height: 54px; font-size: 1.4rem; }
    .song-detail-container { padding: 1.5rem; max-width: 90%; }
    .detail-album-art { width: 150px; height: 150px; }
    .secondary-controls-player { flex-direction: column; gap: 1rem; }
    .volume-control-player { width: 100%; justify-content: center; }
    .dj-eq-canvas { width: 160px; height: 36px; }
    body.focus-mode .lyrics-container { height: 55vh; }
    .mini-player { left: 50%; width: 94%; padding: 0.75rem 0.9rem; gap: 0.7rem; transform: translate(-50%, 120%); }
    .mini-player.show { transform: translate(-50%, 0); }
    .mini-art { width: 48px; height: 48px; }
    .mini-play-btn { width: 52px; height: 52px; }
    .mini-nav-btn { width: 40px; height: 40px; }
}