/* ========================================= */
/* 1. ASAS (BASE STYLES)                     */
/* ========================================= */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Penuhi tinggi skrin */
    overflow: hidden; /* Body tak perlu scroll, kita scroll wrapper */
}

/* Scrollbar Custom */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ========================================= */
/* 2. HEADER (TOP BAR)                       */
/* ========================================= */
.top-bar {
    background: #1f1f1f;
    padding: 10px 15px; /* Kurangkan padding sisi */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    height: auto; /* Jangan fix height, biar dia membesar kalau perlu */
    min-height: 60px;
    flex-wrap: wrap; /* Benarkan wrap kalau skrin terlalu kecil */
    gap: 10px;
}

.station-info {
    display: flex;
    align-items: center;
    flex: 1; /* Ambil ruang sebanyak mungkin */
    min-width: 0; /* PENTING: Benarkan text truncate */
    margin-right: 10px;
}

.station-info h1 {
    margin: 0;
    font-size: 20px; /* Kecilkan sikit font */
    color: #00d4ff;
    letter-spacing: 1px;
    
    /* Logic Potong Teks (Ellipsis ...) */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.badge {
    background: #333;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 8px;
    white-space: nowrap; /* Jangan bagi badge turun baris sendiri */
    flex-shrink: 0; /* Jangan bagi badge mengecil */
}

/* Jam di Header */
.top-bar .clock {
    font-size: 16px; /* Saiz mesra mobile */
}

/* Button Live Header */
.top-bar .btn-live-mode {
    padding: 5px 10px;
    font-size: 11px;
}

/* ========================================= */
/* 3. LAYOUT UTAMA (CONSOLE WRAPPER)         */
/* ========================================= */
.console-wrapper {
    flex: 1; /* Ambil semua ruang kosong yang ada */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 20px;
    background: radial-gradient(circle at center, #1a1a1a, #000);
    overflow-y: auto; /* Benarkan scroll jika deck tak muat skrin */
    min-height: 400px; /* Tinggi minimum supaya tak penyek */
}

/* ========================================= */
/* 4. DECK (KIRI & KANAN)                    */
/* ========================================= */
.deck {
    background: #2a2a2a;
    width: 280px;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #444;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    position: relative;
    flex-shrink: 0; /* Deck jangan mengecil */
}

.deck-label { font-weight: bold; color: #777; margin-bottom: 15px; letter-spacing: 3px; font-size: 12px; }

/* Piring Hitam */
.vinyl-disc {
    width: 180px; height: 180px;
    background: radial-gradient(circle, #222 10%, #111 20%, #000 60%);
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 4px solid #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
    position: relative;
    display: flex; justify-content: center; align-items: center;
}

/* Label Kuning */
.vinyl-disc::after {
    content: ''; position: absolute;
    width: 60px; height: 60px;
    background: radial-gradient(circle, #ffcc00, #ff9900);
    border-radius: 50%; border: 3px solid #fff;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
    z-index: 1;
}

/* Cover Art */
.cover-art {
    width: 80px; height: 80px;
    border-radius: 50%; border: 3px solid #fff;
    background-size: cover; background-position: center;
    z-index: 10; position: absolute;
}

/* Animasi */
@keyframes spin { 100% { transform: rotate(360deg); } }
.spinning { animation: spin 2s linear infinite; }

.status-light {
    width: 12px; height: 12px;
    background: #550000; border-radius: 50%;
    margin: 15px auto 0; box-shadow: 0 0 5px #000;
    transition: background 0.3s;
}
.status-light.active { background: #00ff00; box-shadow: 0 0 15px #0f0; }

.track-info h3 { margin: 10px 0 5px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-info p { margin: 0; color: #888; font-size: 14px; }

/* ========================================= */
/* 5. CENTER CONSOLE (TENGAH)                */
/* ========================================= */
.center-console {
    width: auto; max-width: 800px;
    display: flex; flex-direction: column;
    align-items: center; gap: 15px;
}

#visualizer {
    width: 100%; height: 120px;
    background: #000; border: 1px solid #333;
    border-radius: 8px; box-shadow: inset 0 0 20px rgba(0,0,0,0.9);
}

.control-bar {
    display: flex; justify-content: center; align-items: center; gap: 10px;
    background: #222; border-radius: 15px; border: 1px solid #444;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); box-sizing: border-box;
    padding: 15px 50px; /* Padding sederhana */
    width: 100%;
}

.btn-ctrl {
    border: none; padding: 10px 18px; border-radius: 30px;
    font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 8px;
    font-size: 13px; transition: all 0.2s; color: white;
}
.btn-ctrl:hover { transform: translateY(-2px); filter: brightness(1.2); }
.btn-ctrl:active { transform: translateY(0); }

.btn-start { background: #00d4ff; color: #000; }
.btn-stop  { background: #ff0000; color: #fff; }
.btn-skip  { background: #333; border: 1px solid #555; }
.btn-mic   { background: #e91e63; }
.btn-mixer { background: #9c27b0; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); } }
.pulse-red { background: #ff0000 !important; animation: pulse 1.5s infinite; border: 2px solid #fff !important; }
.divider { width: 1px; height: 30px; background: #444; margin: 0 5px; }

/* ========================================= */
/* 6. PLAYLIST MANAGER (BAWAH)               */
/* ========================================= */
.manager-container {
    display: flex; gap: 20px; 
    height: 250px; /* Tinggi Tetap */
    padding: 0 20px 20px;
    flex-shrink: 0; /* PENTING: Jangan benarkan playlist ini "penyek" atau lari */
    background: #121212; /* Sama warna body */
    z-index: 20;
}

.box-library, .box-queue {
    flex: 1; background: #1a1a1a;
    border: 1px solid #333; border-radius: 8px;
    display: flex; flex-direction: column; overflow: hidden;
}

.box-header {
    background: #2a2a2a; padding: 10px 15px; font-weight: bold; font-size: 13px;
    border-bottom: 1px solid #444; color: #00d4ff;
    display: flex; justify-content: space-between; align-items: center;
}

.scroll-area { flex: 1; overflow-y: auto; padding: 0; }

.song-row {
    display: flex; justify-content: space-between; padding: 10px 15px;
    border-bottom: 1px solid #252525; cursor: pointer; font-size: 13px; color: #ccc;
    transition: background 0.1s;
}
.song-row:hover { background: #333; color: white; }

.btn-add { background: none; border: none; color: #0f0; cursor: pointer; font-size: 14px; }
.btn-remove { background: none; border: none; color: #f00; cursor: pointer; font-size: 14px; }

/* ========================================= */
/* 7. LIVE MONITOR & POPUP (OVERLAY)         */
/* ========================================= */
/* (Kod Overlay dikekalkan ringkas untuk jimat ruang) */
.live-overlay, .mixer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999; display: flex; flex-direction: column; color: white;
}
.live-overlay { background: radial-gradient(circle at center, #1a1a1a, #000); }
.mixer-overlay { background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px); justify-content: center; align-items: center;}

.live-header { padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.5); }
.live-logo { font-size: 30px; font-weight: bold; color: #00d4ff; }
.live-badge { background: #e91e63; font-size: 12px; padding: 3px 8px; margin-left: 10px; }
.live-clock { font-family: monospace; font-size: 30px; color: #0f0; }
.btn-close-live, .close-btn { background: transparent; border: 1px solid #555; color: #aaa; padding: 5px 15px; cursor: pointer; border-radius: 5px; }

.live-content { flex: 1; display: flex; align-items: center; justify-content: center; gap: 60px; z-index: 10; }
.live-cover { width: 380px; height: 380px; background: #222; border-radius: 20px; border: 5px solid rgba(255,255,255,0.1); position: relative; background-size: cover; background-position: center; }
.live-status-indicator {
    position: absolute;
    /* UBAH INI: Dulu -20px (luar), sekarang 10px (masuk dalam sikit) */
    bottom: 10px; 
    left: 50%;
    transform: translateX(-50%);
    
    /* Style */
    background: rgba(255, 0, 0, 0.9); /* Merah semi-transparent sikit */
    padding: 5px 20px;
    font-weight: bold;
    font-size: 14px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); /* Shadow lebih jelas */
    color: white;
    white-space: nowrap;
    z-index: 20;
    
    /* Tambahan: Border putih nipis supaya nampak pop */
    border: 2px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(4px); /* Effect kaca */
}

.live-info { text-align: left; max-width: 600px; }
#live-title { font-size: 60px; margin: 0; line-height: 1; }
#live-artist { font-size: 30px; color: #00d4ff; margin: 15px 0 30px; }
#live-next { font-size: 20px; color: #666; border-top: 1px solid #333; padding-top: 15px; }
#live-visualizer { position: absolute; bottom: 0; left: 0; width: 100%; height: 50%; opacity: 0.6; pointer-events: none; z-index: 1; }

.btn-live-mode { background: #e91e63; color: white; border: none; padding: 8px 15px; border-radius: 5px; font-weight: bold; cursor: pointer; font-size: 12px; }

/* Mixer Styles */
.mixer-box { background: #1f1f1f; width: 600px; padding: 30px; border-radius: 15px; border: 1px solid #333; }
.mixer-header { display: flex; justify-content: space-between; border-bottom: 2px solid #9c27b0; padding-bottom: 15px; margin-bottom: 25px; }
.fader-group { margin-bottom: 20px; }
.fader-group label { display: flex; justify-content: space-between; margin-bottom: 8px; color: #aaa; }
input[type="range"] { width: 100%; cursor: pointer; accent-color: #9c27b0; }
.vol-grid { display: flex; justify-content: space-around; text-align: center; margin-top: 20px; }
.vertical-range { writing-mode: vertical-lr; direction: rtl; width: 30px; height: 160px; margin: 0 auto; appearance: auto; }

/* ========================================= */
/* 8. RESPONSIF (FON & TABLET)               */
/* ========================================= */
@media screen and (max-width: 1200px) {
    body {
        height: auto; 
        overflow-y: auto; 
    }

    /* Console Wrapper */
    .console-wrapper {
        flex-direction: row; 
        flex-wrap: wrap; 
        justify-content: space-between;
        gap: 10px; padding: 10px;
        min-height: auto; 
        flex: none; 
    }

    /* Deck bersebelahan */
    .deck { width: 48%; max-width: none; order: 1; padding: 10px 5px; box-sizing: border-box; }
    #deck-2 { order: 1; }
    
    /* Center console jatuh bawah */
    .center-console { width: 100%; max-width: 100%; order: 2; margin-top: 5px; }
    
    /* Kecilkan elemen UI */
    .vinyl-disc { width: 100px; height: 100px; margin-bottom: 10px; border-width: 3px; }
    .vinyl-disc::after { width: 30px; height: 30px; }
    .cover-art { width: 45px; height: 45px; }
    .control-bar { padding: 10px; gap: 8px; }
    
    /* --- PENGURUSAN PLAYLIST (MOBILE) --- */
    .manager-container {
        flex-direction: column; /* Susun menegak */
        height: auto;
        padding-bottom: 50px; /* Ruang scroll bawah */
    }

    /* 1. QUEUE (GILIRAN) - NAIK ATAS */
    .box-queue { 
        order: 1; /* Nombor 1 bermaksud ia duduk paling atas */
        height: 200px; /* Tinggi tetap supaya tak panjang sangat */
        margin-bottom: 15px;
    }

    /* 2. LIBRARY (SENARAI LAGU) - TURUN BAWAH */
    .box-library { 
        order: 2; /* Nombor 2 duduk bawah */
        height: 350px; /* Tinggi tetap, selebihnya scroll */
        margin-bottom: 20px;
    }
	/* --- UPDATE: LIVE MONITOR (MOBILE FIX) --- */
    .live-content {
        flex-direction: column; /* Susun menegak (Gambar atas, teks bawah) */
        gap: 20px;
        padding: 20px;
        text-align: center;
    }

    .live-cover {
        
		margin-bottom: 15px;
    }
    
    .live-status-indicator {
        bottom: 10px; /* Kekal di dalam gambar */
        font-size: 11px; /* Kecilkan font fon */
        padding: 4px 12px; /* Kecilkan padding */
        border-width: 1px;
    }

    .live-info {
        text-align: center; /* Centerkan teks */
        width: 100%;
    }

    #live-title { font-size: 30px; } /* Kecilkan tajuk */
    #live-artist { font-size: 18px; margin: 10px 0; }
    #live-next { font-size: 14px; }
    
    .live-logo { font-size: 20px; }
    .live-clock { font-size: 15px; }
}

/* --- BUTTON MENU TRIGGER (HEADER) --- */
.btn-menu-trigger {
    background: #333; color: white; border: 1px solid #555;
    padding: 8px 15px; border-radius: 5px; cursor: pointer;
    font-size: 12px; font-weight: bold; margin-right: 15px;
    display: flex; align-items: center; gap: 8px;
}
.btn-menu-trigger:hover { background: #555; border-color: #fff; }

/* --- MENU POPUP STYLES --- */
.menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(10px);
    z-index: 20000; /* Paling atas sekali */
    display: flex; justify-content: center; align-items: center;
}

.menu-box {
    background: #1a1a1a; width: 100%; max-width: 700px;
    border-radius: 15px; border: 1px solid #333; padding: 30px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.menu-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid #444; padding-bottom: 20px; margin-bottom: 30px;
}
.menu-header h2 { margin: 0; color: white; letter-spacing: 2px; font-size: 18px; }

/* GRID LAYOUT */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Auto susun */
    gap: 20px;
}

/* KAD MENU */
.menu-card {
    background: #252525; padding: 20px; border-radius: 10px;
    text-align: center; text-decoration: none; color: white;
    border: 1px solid #333; transition: transform 0.2s, background 0.2s;
    cursor: pointer;
}
.menu-card:hover {
    background: #333; transform: translateY(-5px); border-color: #00d4ff;
}

/* IKON BULAT */
.icon-circle {
    width: 60px; height: 60px; border-radius: 50%;
    margin: 0 auto 15px; display: flex; justify-content: center; align-items: center;
    font-size: 24px; color: white; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.menu-card h3 { margin: 0 0 5px; font-size: 16px; color: #fff; }
.menu-card p { margin: 0; font-size: 12px; color: #888; }

.menu-footer {
    margin-top: 30px; text-align: center; color: #444; font-size: 11px;
    border-top: 1px solid #222; padding-top: 20px;
}

/* RESPONSIF MENU DI FON */
@media screen and (max-width: 600px) {
    .menu-grid { grid-template-columns: 1fr 1fr; gap: 10px; } /* 2 lajur di fon */
    .menu-card { padding: 15px; }
    .icon-circle { width: 40px; height: 40px; font-size: 18px; margin-bottom: 10px; }
    .menu-card h3 { font-size: 13px; }
    .menu-card p { display: none; } /* Sorok deskripsi di fon supaya kemas */
}

/* --- SOUNDBOARD STYLES --- */
.sfx-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 butang sebaris */
    gap: 10px;
    margin-bottom: 10px;
}

.btn-sfx {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 15px 5px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    font-size: 12px;
    text-transform: uppercase;
}

.btn-sfx:hover {
    background: #444;
    border-color: #00d4ff;
    color: #00d4ff;
}

.btn-sfx:active {
    background: #00d4ff;
    color: black;
    transform: scale(0.95); /* Efek tekan */
}

/* Responsif untuk SFX di telefon */
@media screen and (max-width: 600px) {
    .sfx-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 butang sebaris di fon */
    }
}

/* Update style ini dalam assets/css/style.css */

/* Kotak Utama Mixer */
.mixer-box {
    background: #1f1f1f;
    
    /* FIX MOBILE: Guna peratus & Max Width */
    width: 90%; 
    max-width: 600px; /* Di PC max 600px */
    max-height: 90vh; /* Jangan lebih 90% tinggi skrin */
    
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #333;
    box-shadow: 0 0 50px #000;
    color: white;
    
    /* FIX MOBILE: Benarkan scroll jika skrin pendek */
    overflow-y: auto; 
    position: relative; /* Supaya anak elemen tersusun */
}

/* Header Mixer */
.mixer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #9c27b0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    
    /* Sticky Header (Supaya butang X kekal di atas bila scroll) */
    position: sticky;
    top: 0;
    background: #1f1f1f; /* Tutup content belakang bila scroll */
    z-index: 10;
}

.mixer-header h2 { 
    margin: 0; 
    color: #e1bee7; 
    font-size: 18px; /* Kecilkan sikit font */
}

/* Butang Tutup (X) */
.close-btn { 
    background: #333; /* Tambah background supaya jelas */
    border: 1px solid #555; 
    color: #fff; 
    font-size: 18px; 
    width: 35px; height: 35px;
    border-radius: 50%;
    cursor: pointer; 
    display: flex; justify-content: center; align-items: center;
}
.close-btn:hover { background: #555; border-color: white; }

/* Grid Volume */
.vol-grid { 
    display: flex; 
    justify-content: space-between; /* Jarakkan */
    text-align: center; 
    margin-top: 20px;
    flex-wrap: wrap; /* Turun baris jika sempit */
    gap: 10px;
}

.vol-item {
    flex: 1; /* Bahagi ruang sama rata */
    min-width: 60px; /* Lebar minimum */
}

/* Slider Menegak */
.vertical-range { 
    writing-mode: vertical-lr; 
    direction: rtl; 
    width: 30px; 
    height: 140px; /* Pendekkan sikit */
    margin: 0 auto; 
    appearance: auto; 
    background: transparent;
}

