/*
Theme Name: Feelsync v2 (Updated)
Theme URI: https://feelsync.shop
Description: Streaming-style theme (grid home, player with progress, frontend dark theme only).
Author: Feelsync Dev
Version: 3.3 (ULTIMATE FINAL FIX)
Text Domain: feelsync-updated
License: GPLv2 or later
*/

/* === VARIABEL WARNA SPOTIFY === */
:root{
    --bg: #121212;         /* Latar Belakang Utama */
    --panel: #181818;      /* Latar Belakang Kartu/Player */
    --muted: #b3b3b3;      /* Teks Muted */
    --accent: #1db954;     /* Hijau Spotify */
    --white: #ffffff;      /* Teks Putih */
    --progress-track: #535353; /* Garis progress yang belum terisi */
    --control-bg: #282828; /* Latar belakang tombol */
}

/* === RESET DASAR & TATA LETAK APLIKASI === */
html,body{height:100%; margin:0; font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; background:var(--bg); color:var(--white);}
a{color:inherit; text-decoration:none;}
.app-wrap{display:flex; min-height:100vh; flex-direction:column;}
.content-wrap{display:flex; width:100%; flex:1; box-sizing:border-box;}

/* === SIDEBAR (NAVIGASI) === */
.sidebar{
    width:220px;
    padding:20px;
    background:#050505;
    box-sizing:border-box;
}
.sidebar h1{color:var(--accent); margin:0 0 14px; font-size:20px;}
.sidebar nav a{display:block; padding:8px 0; color:var(--muted); font-size:14px; transition:color 0.2s;}
.sidebar nav a:hover{color:var(--white);}

/* === KONTEN UTAMA === */
.main-content{flex:1; padding:24px; box-sizing:border-box; overflow:auto;}


/* === KARTU LAGU (GRID) === */
.feelsync-song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.feelsync-song-card {
    background: var(--panel);
    border-radius: 8px;
    padding: 15px; 
    text-align: left; 
    color: var(--white);
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.feelsync-song-card:hover {
    background: #282828; 
}

.feelsync-song-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 4px; 
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.feelsync-song-title {
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.feelsync-song-artist {
    font-size: 13px;
    color: var(--muted);
}

/* 🛑 KOREKSI: TOMBOL PLAY DI GRID (WARNA DAN IKON FINAL FIX) 🛑 */
.feelsync-song-card .play-button {
    position: absolute;
    bottom: 20px; 
    right: 20px;
    background: var(--accent) !important; /* Hijau */
    box-shadow: 0 4px 8px rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 45px; 
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    color: #000; /* Warna ikon hitam */
    font-size: 18px; 
    opacity: 0 !important; /* Membuat tombol hilang secara default */
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.feelsync-song-card:hover .play-button {
    opacity: 1 !important; /* Membuat tombol muncul saat hover */
    transform: translateY(0);
}

.feelsync-song-card .play-button i {
    color: #000 !important; /* Memastikan ikon di dalamnya hitam */
    font-weight: 900 !important; /* Ikon Solid */
    transform: translateX(1px); /* Geser ikon play sedikit ke kanan */
}


/* === PLAYER BAR (FIXED BOTTOM) === */
#feelsync-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: var(--panel);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
    font-size: 14px;
    z-index: 9999;
}

/* Left: Cover + Info */
.player-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}
.player-left .cover {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}
.player-left .song-title { font-weight: bold; }
.player-left .song-artist { font-size: 12px; color: var(--muted); }


/* Center: Controls + Progress */
.player-center {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px; 
}

/* KONTROL UTAMA (PREV/PLAY/NEXT) */
.player-center .controls {
    display: flex;
    align-items: center;
    gap: 20px; 
}

.player-center .controls button {
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 5px; 
    line-height: 1; 
    color: var(--muted); 
    font-size: 16px;
}
.player-center .controls button:hover {
    color: var(--white);
    transform: scale(1.1); 
}

.player-center .controls .btn-play {
    color: var(--white) !important; 
    background-color: transparent !important; 
    font-size: 20px !important; 
    width: 32px; 
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0 5px; 
    box-shadow: none !important;
}

.player-center .controls button i {
    font-weight: 900 !important; 
}


/* PROGRESS BAR ROW */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}
.progress-container span {
    font-size: 12px;
    color: var(--muted);
}


/* === PROGRESS BAR & VOLUME BAR STYLING (KOREKSI MUTLAK FINAL) === */

/* Reset default appearance */
#progress-bar, #volume-bar {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 4px !important; 
    background: transparent !important;
    cursor: pointer !important;
    flex: 1 !important;
    width: 100%;
}

/* Track (Jalur Bar yang Belum Terisi) */
#progress-bar::-webkit-slider-runnable-track,
#volume-bar::-webkit-slider-runnable-track {
    height: 4px !important;
    background: var(--progress-track) !important; /* Abu-abu gelap */
    border-radius: 2px !important;
}

/* Thumb (Bulatan) */
#progress-bar::-webkit-slider-thumb,
#volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: var(--accent) !important; /* Hijau */
    margin-top: -4px !important;
    opacity: 1 !important; /* BULATAN SELALU TERLIHAT */
    transition: background 0.2s, opacity 0.2s;
}

/* Thumb (Bulatan) untuk Volume, selalu terlihat */
#volume-bar::-webkit-slider-thumb {
    background: var(--accent) !important;
    opacity: 1 !important;
}

/* Trik untuk Chrome: mengisi track dengan warna hijau (dikontrol oleh JS) */
#progress-bar, #volume-bar {
    background-color: var(--progress-track) !important;
    background-image: linear-gradient(to right, 
                                     var(--accent) 0%, 
                                     var(--accent) 100%
                                    ) !important;
    background-repeat: no-repeat !important; 
    background-size: 0% 100%; 
}


/* Right: Volume + Skip */
.player-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    gap: 15px;
    padding-right: 15px;
    min-width: 180px; /* Memberi ruang yang cukup untuk volume bar */
}
#volume-bar { width: 100px; } /* Lebar target volume bar */

/* Skip Button */
#skip-button {
    background: var(--accent);
    border: none;
    color: var(--white);
    font-size: 14px;
    font-weight: bold;
    padding: 6px 15px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.2s ease;
}
#skip-button:hover {
    background: #158843; 
}

/* Responsive */
@media(max-width:900px){
    .sidebar{ display:none; }
    .player-left{ min-width:140px; }
    .player-right{ display:none; } 
    .song-grid{ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    #feelsync-player-bar { height: 70px; padding: 10px; }
}