@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --primary-color: #1DB954;
    --dark-color: #121212;
    --light-dark-color: #282828;
    --text-light: #FFFFFF;
    --text-gray: #b3b3b3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    background-image: url('ayang_acu.jpg'); 
    background-size: cover; /* Membuat gambar menutupi seluruh area */
    background-position: center; /* Memusatkan gambar */
    background-repeat: no-repeat; /* Mencegah gambar berulang */
    background-attachment: fixed; /* Membuat background tidak ikut scroll */
    backdrop-filter: blur(3px); /* Efek blur pada background */
    -webkit-backdrop-filter: blur(3px); /* Dukungan untuk browser Safari */
}

.player-container {
    display: flex;
    width: 100%;
    max-width: 900px;
    height: 500px;
    /* Ubah background container agar sedikit transparan */
    background: rgba(18, 18, 18, 0.75); /* Warna semi-transparan */
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1); /* Tambahan border halus */
}

/* Bagian Kiri: Playlist */
.playlist-section {
    width: 35%;
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    overflow-y: auto;
}
.playlist-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2em;
}
.playlist-section h2 .fa-music {
    margin-right: 10px;
}

#playlist {
    list-style: none;
}
#playlist li {
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 0.9em;
}
#playlist li:hover {
    background-color: var(--light-dark-color);
}
#playlist li.active {
    background-color: var(--primary-color);
    color: var(--text-light);
    font-weight: 600;
}

/* Bagian Kanan: Pemutar Utama */
.main-player-section {
    width: 65%;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.artwork-wrapper {
    width: 220px;
    height: 220px;
    margin-bottom: 25px;
}
.artwork-img {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.track-info {
    text-align: center;
    margin-bottom: 20px;
}
#current-song {
    font-size: 1.5em;
    font-weight: 600;
}
#current-artist {
    color: var(--text-gray);
    font-size: 1em;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    margin-bottom: 15px;
}
.progress-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #444;
    border-radius: 5px;
    cursor: pointer;
    outline: none;
}
.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}
.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-gray);
    margin-top: 5px;
}

/* Tombol Kontrol */
.controls-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}
.control-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.2em;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}
.control-btn:hover {
    color: var(--text-light);
    transform: scale(1.1);
}
.play-btn {
    font-size: 2.5em;
    color: var(--text-light);
    background-color: var(--primary-color);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.play-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Kontrol Volume */
.volume-container {
    display: flex;
    align-items: center;
    width: 50%;
    max-width: 200px;
    color: var(--text-gray);
}
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    flex-grow: 1;
    height: 5px;
    background: #444;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 10px;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--text-light);
    border-radius: 50%;
    cursor: pointer;
}

#visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.15;
}

.main-player-section {
    position: relative; /* Diperlukan agar visualizer bisa diposisikan di belakang */
}

.artwork-wrapper, .track-info, .progress-container, .controls-wrapper, .volume-container {
    position: relative; /* Memastikan elemen lain tetap di atas visualizer */
    z-index: 2;
}

/* Kotak Pencarian */
.playlist-header {
    margin-bottom: 15px;
}
.search-container {
    position: relative;
    margin-top: 15px;
}
.search-container .fa-search {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
}
#search-box {
    width: 100%;
    padding: 10px 15px 10px 40px;
    background-color: var(--light-dark-color);
    border: none;
    border-radius: 20px;
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
}
#search-box::placeholder {
    color: var(--text-gray);
}

.control-btn-side {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.1em;
    cursor: pointer;
    transition: color 0.3s ease;
}
.control-btn-side:hover {
    color: var(--text-light);
}
.control-btn-side.active {
    color: var(--primary-color); /* Warna saat tombol aktif */
}