/* =========================================
   VARIABEL WARNA & TEMA (SPOTIFY STYLE)
   ========================================= */
:root {
    --bg-main: #121212;
    --bg-sidebar: #000000;
    --bg-player: #181818;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #1db954;
    --hover-color: #282828;
}

/* =========================================
   RESET DASAR
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* =========================================
   LAYOUT UTAMA (SIDEBAR & MAIN CONTENT)
   ========================================= */
.app-container {
    display: flex;
    flex: 1;
    height: calc(100vh - 90px); /* 90px untuk ruang player di bawah */
}

/* Sidebar Styling */
.sidebar {
    width: 240px;
    background-color: var(--bg-sidebar);
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 999;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s ease;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--text-primary);
}

/* Main Content (Area Playlist) */
.main-content {
    flex: 1;
    background: linear-gradient(180deg, #2a2a2a 0%, var(--bg-main) 100%);
    padding: 20px;
    overflow-y: auto;
}

.topbar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.topbar h2 {
    margin-bottom: 0;
}

/* =========================================
   DAFTAR LAGU (PLAYLIST ITEM)
   ========================================= */
.song-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.song-item:hover {
    background-color: var(--hover-color);
}

/* Ikon Pengganti Gambar di List Lagu */
.cover-placeholder-small {
    width: 40px;
    height: 40px;
    background-color: #282828;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--text-secondary);
}

.song-item-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.song-item-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* =========================================
   BOTTOM PLAYER (PEMUTAR MUSIK BAWAH)
   ========================================= */
.music-player {
    height: 90px;
    background-color: var(--bg-player);
    border-top: 1px solid #282828;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

/* Info Lagu Kiri */
.song-info {
    display: flex;
    align-items: center;
    width: 30%;
}

.cover-placeholder {
    width: 56px;
    height: 56px;
    background-color: #282828;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--text-secondary);
    font-size: 24px;
}

.song-info .details h4 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-info .details p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Area Tombol Kontrol Tengah */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
}

.buttons {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
}

.buttons button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.buttons button:hover {
    color: var(--text-primary);
}

.play-btn-main {
    font-size: 32px !important;
    color: var(--text-primary) !important;
}

.play-btn-main:hover {
    transform: scale(1.1);
}

/* Status Aktif untuk Shuffle & Repeat */
.buttons button.active-control {
    color: var(--accent-color);
}

.buttons button.active-control:hover {
    color: #1ed760;
}

/* Progress Bar (Slider Waktu) */
.progress-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #535353;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
}

/* Kontrol Volume Kanan */
.volume-controls {
    display: flex;
    align-items: center;
    width: 30%;
    justify-content: flex-end;
    gap: 10px;
    color: var(--text-secondary);
}

.volume-controls input {
    width: 100px;
}

/* =========================================
   HAMBURGER MENU (MOBILE ONLY)
   ========================================= */
.menu-toggle {
    display: none; /* Disembunyikan di desktop */
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    margin-right: 15px;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* =========================================
   RESPONSIVE DESIGN (TAMPILAN MOBILE HP)
   ========================================= */
@media (max-width: 768px) {
    /* Munculkan Tombol Hamburger */
.topbar {
        flex-direction: row-reverse;
        justify-content: space-between;
    }

    .menu-toggle {
        display: flex;
        margin-right: 0; /* Menghilangkan jarak margin lama */
        position: relative; /* Menjamin z-index bekerja sempurna */
        z-index: 1001;
    }

    /* Ubah Sidebar menjadi melayang dari kiri (Slide-in) */
    .sidebar {
        position: fixed;
        top: 0;
        left: -250px; /* Sembunyikan di luar layar sebelah kiri */
        width: 250px;
        height: calc(100vh - 90px);
        background-color: #000000;
        transition: 0.4s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }

    /* Class tambahan saat hamburger diklik (munculkan sidebar) */
    .sidebar.active {
        left: 0;
    }

    /* Animasi garis Hamburger berubah menjadi tanda silang 'X' */
    .menu-toggle.is-active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.is-active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.is-active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Penyesuaian Bottom Player untuk HP */
    .music-player {
        padding: 0 10px;
    }
    
    .song-info {
        width: 35%; /* Beri ruang lebih untuk tombol */
    }
    
    .volume-controls {
        display: none; /* Sembunyikan volume agar tidak sempit */
    }
    
    .player-controls {
        width: 65%;
    }

    /* Memperbesar Tombol agar mudah ditekan jari */
    .buttons {
        gap: 15px; 
    }

    .buttons button {
        font-size: 22px; /* Tombol Prev, Next, Shuffle, Repeat membesar */
    }

    .play-btn-main {
        font-size: 46px !important; /* Tombol Play sangat besar di tengah */
    }
}