/* ==========================================
   CONTROLS.CSS - CLEAN LIGHT THEME V1.2
   ========================================== */

/* --- 1. KONTROL KIRI ATAS (DROPDOWN BERJEJER VERTIKAL) --- */
.top-left-controls,
.top-right-controls {
    position: absolute; 
    top: 20px; 
    left: 20px; 
    right: auto;
    z-index: 1000;
    display: flex; 
    flex-direction: column; /* Berjejer vertikal ke bawah */
    gap: 8px; 
    align-items: flex-start;
}

.dropdown-wrapper { 
    position: relative; 
    display: block; 
    width: 180px; /* Ukuran seragam untuk tombol berjejer */
}

.dropdown-btn {
    width: 100%;
    text-align: left;
    background: #ffffff; 
    color: #000000; /* Teks tombol hitam murni */
    border: 1px solid #cbd5e1; 
    padding: 8px 14px;
    border-radius: 6px; 
    cursor: pointer; 
    font-family: 'Inter', sans-serif;
    font-size: 12px; 
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-btn:hover { 
    background: #f8fafc; 
    border-color: #0284c7;
    color: #0284c7;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.15);
}

.dropdown-content {
    display: none; 
    position: absolute; 
    left: 0; 
    top: 100%;
    margin-top: 4px;
    background: #ffffff;
    min-width: 220px; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #cbd5e1;
    border-radius: 6px; 
    z-index: 1001; 
    overflow: hidden; 
    max-height: 320px;
    overflow-y: auto;
}

.dropdown-content button, .dropdown-content a {
    color: #000000; /* Teks opsi menu hitam murni */
    padding: 10px 14px; 
    text-align: left; 
    background: #ffffff;
    border: none; 
    width: 100%; 
    cursor: pointer; 
    font-size: 12px; 
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9; 
    display: block;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.dropdown-content button:hover, .dropdown-content a:hover { 
    background: #f0f9ff; 
    color: #0284c7;
}

.dropdown-wrapper.active .dropdown-content { 
    display: block; 
}


/* --- 2. KOTAK KONTROL KIRI BAWAH (PANEL MENYATU) --- */
.left-bottom-panel {
    position: absolute; 
    bottom: 20px; 
    left: 20px; 
    z-index: 1000;
    background: #ffffff; 
    border: 1px solid #cbd5e1;
    padding: 14px 16px; 
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); 
    width: 290px;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
    color: #000000;
}

.left-bottom-panel h4 { 
    margin: 0 0 8px 0; 
    font-family: 'Inter', sans-serif;
    font-size: 11px; 
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #000000; /* Judul seksi warna hitam murni */
}

.panel-divider {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 10px 0;
}

/* Navigasi Waktu & Playback Controls */
.time-controls { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
}

.button-group { 
    display: flex; 
    gap: 4px; 
    justify-content: space-between; 
    flex-wrap: wrap; 
}

.time-btn {
    flex: 1; 
    min-width: 32px;
    background: #f1f5f9; 
    border: 1px solid #cbd5e1; 
    color: #000000; /* Teks tombol waktu hitam murni */
    padding: 6px 0; 
    cursor: pointer; 
    border-radius: 4px; 
    font-size: 11px; 
    font-weight: 600; 
    text-align: center;
    transition: all 0.2s;
}

.time-btn:hover { 
    background: #e2e8f0; 
    border-color: #0284c7;
    color: #0284c7;
}

.time-btn.active { 
    background: #0284c7; 
    color: #ffffff; 
    border-color: #0284c7;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.nav-playback-group { 
    display: flex; 
    gap: 4px; 
    margin-top: 2px; 
}

.action-btn {
    flex: 1; 
    background: #f8fafc; 
    color: #000000; /* Teks tombol aksi hitam murni */
    border: 1px solid #cbd5e1; 
    padding: 6px; 
    cursor: pointer; 
    border-radius: 4px; 
    font-size: 11px; 
    font-weight: 600;
    transition: all 0.2s;
}

.action-btn:hover { 
    background: #e2e8f0; 
}

.action-btn.playing { 
    background: #e11d48; 
    color: #ffffff;
    border-color: #e11d48;
}

/* Slider Transparansi Peta */
.opacity-control label {
    font-size: 11px;
    font-weight: 600;
    color: #000000; /* Label transparansi hitam murni */
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

input[type=range] {
    accent-color: #0284c7;
    cursor: pointer;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
}

/* --- 3. STYLING LEGENDA PERINGATAN (WARNA HITAM MURNI) --- */
.legend-container,
.legend-container *,
.legend-item,
.legend-label,
.legend-title {
    color: #000000 !important; /* Paksa seluruh tulisan di legenda menjadi hitam */
    font-weight: 600;
    font-size: 11px;
}

/* Watermark Pengembang Kiri Bawah */
.dev-watermark {
    margin-top: 10px;
    font-size: 10px;
    color: #000000; /* Watermark warna hitam */
    font-weight: 600;
    border-top: 1px dashed #cbd5e1;
    padding-top: 6px;
}


/* --- 4. POSISI TOMBOL ZOOM LEAFLET (SUDUT KANAN BAWAH) --- */
.leaflet-bottom.leaflet-right {
    bottom: 20px !important;
    right: 20px !important;
}

.leaflet-control-zoom {
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    border-radius: 6px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f1f5f9 !important;
    color: #0284c7 !important;
}


/* --- 5. RESPONSIF SMARTPHONE / LAYAR KECIL --- */
@media screen and (max-width: 767px) {
    .top-left-controls,
    .top-right-controls {
        top: 85px;
        left: 12px;
        width: 160px;
    }

    .dropdown-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .left-bottom-panel {
        bottom: 12px;
        left: 12px;
        width: calc(100vw - 24px);
        padding: 12px;
    }

    .leaflet-bottom.leaflet-right {
        bottom: 12px !important;
        right: 12px !important;
    }
}

/* ==========================================
   TAMBAHAN BARU: FITUR COLLAPSE PANEL MOBILE
   ========================================== */

.panel-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.panel-header-mobile h4 {
    margin: 0 !important;
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
}

.btn-toggle-panel {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.panel-body-content {
    transition: max-height 0.3s ease, opacity 0.25s ease;
    max-height: 800px;
    opacity: 1;
}

/* Kondisi ketika panel terlipat ke bawah (Minimize) */
.left-bottom-panel.collapsed .panel-body-content {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.left-bottom-panel.collapsed .btn-toggle-panel {
    transform: rotate(180deg);
}

/* Penyesuaian khusus tampilan layar HP (< 768px) */
@media screen and (max-width: 767px) {
    .left-bottom-panel {
        bottom: 12px !important;
        left: 12px !important;
        width: calc(100vw - 24px) !important;
        max-height: 45vh;
        padding: 10px 12px !important;
        box-sizing: border-box;
    }

    .panel-body-content {
        max-height: 35vh;
        overflow-y: auto;
    }
}
