:root {
    --primary-red: #990000; 
    --hover-red: #7a0000;
    --light-red: rgba(153, 0, 0, 0.1);
    --primary-black: #2d2d2d;
}

body, html { 
    margin: 0; 
    padding: 0; 
    height: 100%; 
    width: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: #f4f7f6; 
    border-top: none !important; /* Mencegah munculnya garis merah di atas */
}

#map { 
    width: 100%; 
    height: 100vh;
    height: 100dvh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; 
}

/* ========== SEARCH PANEL ========== */
.search-panel {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
    z-index: 1000; background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 8px 12px; border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    display: flex; gap: 10px; align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.search-box {
    position: relative; 
    display: flex; align-items: center; background: #f1f3f4;
    padding: 8px 12px; border-radius: 8px; width: 180px;
    transition: all 0.3s ease; border: 1px solid transparent;
}

.search-box:focus-within { background: #fff; border-color: var(--primary-red); box-shadow: 0 0 0 3px var(--light-red); }

.search-box i.fa-map-marker-alt, .search-box i.fa-store { 
    color: var(--primary-red); 
    font-size: 14px; 
    margin-right: 8px; 
    width: 16px;
    text-align: center;
}

.search-box input { 
    border: none; background: transparent; outline: none; font-size: 13px; 
    width: 100%; color: #333; font-weight: 500;
    padding-right: 20px;
    box-sizing: border-box;
}

.clear-btn {
    position: absolute; right: 10px; color: #999; font-size: 14px;
    cursor: pointer; padding: 4px; display: none; transition: 0.2s ease; z-index: 10;
}
.clear-btn:hover { color: var(--primary-red); }

.divider { width: 1px; height: 25px; background-color: #ddd; }

/* ========== DROPDOWN ========== */
.custom-dropdown {
    position: absolute; top: calc(100% + 8px); left: 0; width: 100%; 
    box-sizing: border-box; background: #ffffff; border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); max-height: 250px;
    overflow-y: auto; display: none; flex-direction: column;
    z-index: 2000; border: 1px solid #eee;
}

.custom-dropdown::-webkit-scrollbar { width: 6px; }
.custom-dropdown::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.custom-dropdown::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.custom-dropdown::-webkit-scrollbar-thumb:hover { background: #999; }

.dropdown-item {
    padding: 10px 14px; font-size: 13px; color: #333; cursor: pointer;
    border-bottom: 1px solid #f8f9fa; display: flex; align-items: center; transition: 0.2s;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background-color: #f4f7f6; color: var(--primary-red); }
.dropdown-item i { margin-right: 10px; font-size: 12px; color: #777; width: 14px; text-align: center; }
.dropdown-item:hover i { color: var(--primary-red); }
.dropdown-text { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }

/* ========== POPUP MAP ========== */
.popup-custom { text-align: center; font-family: 'Segoe UI', sans-serif; width: 100%; padding: 0px; }

.popup-img-container {
    width: 100%; height: 330px; margin-bottom: 6px; 
    display: flex; justify-content: center; align-items: center; background-color: transparent; 
}

.popup-img { 
    max-width: 100%; max-height: 100%; object-fit: contain;  
    cursor: zoom-in; transition: transform 0.3s ease; 
    border-radius: 6px; box-shadow: 0 3px 10px rgba(0,0,0,0.15); 
}
.popup-img:hover { transform: scale(1.05); } 

.popup-table { width: 96%; margin: 0 auto; border-collapse: collapse; }
.attribute-key { font-size: 9px; font-weight: 700; color: #000000; padding: 3px 0; width: 48%; text-align: left; vertical-align: top; white-space: nowrap; }
.attribute-separator { width: 4%; font-size: 9px; color: #000000; vertical-align: top; padding: 3px 0; text-align: center; }
.attribute-value { font-size: 9px; color: #000000; font-weight: 500; padding: 3px 0; text-align: left; vertical-align: top; width: 48%; }

/* ========== MARKER & CLUSTER (HEATMAP) ========== */
.marker-ico { background: transparent; border: none; }
.marker-bulet {
    width: 34px; height: 34px; background-color: #ffffff; border: 2px solid #990000;
    border-radius: 50%; color: #990000; display: flex; justify-content: center;
    align-items: center; font-size: 14px; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.2s ease; cursor: pointer;
}
.marker-bulet:hover { background-color: #990000; color: #ffffff; transform: scale(1.15); }

.custom-cluster {
    background-color: rgba(153, 0, 0, 0.85); border-radius: 50%; color: white;
    font-family: 'Segoe UI', sans-serif; font-weight: 700; display: flex;
    justify-content: center; align-items: center; box-shadow: 0 0 12px rgba(153, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.9); transition: transform 0.2s ease;
}
.custom-cluster:hover { transform: scale(1.1); background-color: rgba(153, 0, 0, 1); }
.custom-cluster span { font-size: 14px; }

/* ========== LEGENDA ========== */
.info.legend {
    padding: 10px 15px; font-family: 'Segoe UI', sans-serif;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1); border-radius: 10px;
    color: #333; border: 1px solid rgba(255, 255, 255, 0.8);
}
.legend h4 { margin: 0 0 8px; color: #222; font-size: 13px; font-weight: bold; border-bottom: 1px solid #eee; padding-bottom: 6px; }
.legend-item { display: flex; align-items: center; margin-bottom: 6px; font-size: 11px; font-weight: 500; }
.legend-icon-properti {
    width: 16px; height: 16px; background-color: #ffffff; border: 2px solid var(--primary-red); 
    border-radius: 50%; color: var(--primary-red); display: flex; justify-content: center; align-items: center;
    font-size: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); margin-right: 10px; flex-shrink: 0;
}

/* ========== MODAL & LIGHTBOX ========== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    transition: opacity 0.3s ease; padding: 15px; box-sizing: border-box;
}

/* --- DESAIN MODAL BARU (MODERN & SOFT) --- */
.modal-content {
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
    padding: 40px; /* Diperbesar agar lebih lega (sebelumnya 30px) */
    border-radius: 24px; 
    width: 650px; /* UBAH DI SINI: Diperlebar untuk tampilan laptop (sebelumnya 420px) */
    max-width: 92%; 
    box-sizing: border-box; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.15), 0 0 0 1px rgba(153,0,0,0.05);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center; 
}
@keyframes popIn { 0% { transform: scale(0.9) translateY(10px); opacity: 0; } 100% { transform: scale(1) translateY(0); opacity: 1; } }

.modal-header-visual {
    width: 60px; height: 60px; background: linear-gradient(135deg, var(--light-red), #fff4f4);
    color: var(--primary-red); border-radius: 50%; display: flex; justify-content: center;
    align-items: center; font-size: 28px; margin: 0 auto 15px auto;
    box-shadow: 0 4px 15px rgba(153, 0, 0, 0.15);
}

.modal-title { margin: 0 0 20px 0; line-height: 1.4; }
.title-small { font-size: 14px; color: var(--primary-black); font-weight: 700; letter-spacing: 2px; }
.highlight-title { font-size: 18px; font-weight: 900; color: var(--primary-black); }

.sumber-data-box {
    background: #ffffff; border: none; border-radius: 16px;
    padding: 15px; box-shadow: 0 6px 16px rgba(0,0,0,0.06); margin-bottom: 25px; position: relative;
}
.data-box-text { display: flex; flex-direction: column; align-items: center; }
.data-label { font-size: 11px; color: #000000; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.angka-highlight { font-size: 36px; font-weight: 900; color: var(--primary-red); margin: 5px 0; text-shadow: 2px 2px 4px rgba(153,0,0,0.1); }
.data-note { font-size: 10px; color: #000000; line-height: 1.4; background: #f8f9fa; padding: 4px 10px; border-radius: 20px; display: inline-block; }
.data-note i { color: var(--primary-red); }

.panduan-header {
    font-size: 11px; font-weight: 700; color: #000000; text-transform: uppercase; 
    letter-spacing: 1px; margin-bottom: 12px; position: relative; display: inline-block;
}
.panduan-header::after {
    content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
    width: 30px; height: 2px; background: var(--light-red); border-radius: 2px;
}

.panduan-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.panduan-item {
    display: flex; flex-direction: row; align-items: center; 
    background: #ffffff; padding: 12px 15px; border-radius: 14px; 
    border: none; box-shadow: 0 6px 16px rgba(0,0,0,0.06); 
    transition: all 0.3s ease; text-align: left;
}

.icon-wrapper {
    background: var(--light-red); color: var(--primary-red); width: 38px; height: 38px; 
    border-radius: 10px; display: flex; justify-content: center; align-items: center; flex-shrink: 0; margin-right: 15px;
}
.icon-wrapper i { font-size: 16px; }

.panduan-text { font-size: 11.5px; color: #000000; line-height: 1.4; }
.panduan-text strong { display: block; color: #000000; font-size: 13px; margin-bottom: 3px; }

.btn-start {
    background: var(--primary-red); color: white; border: none; 
    padding: 14px 20px; font-size: 14px; font-weight: 700;
    border-radius: 12px; cursor: pointer; transition: all 0.3s ease; width: 100%;
    box-shadow: 0 4px 15px rgba(153, 0, 0, 0.25); display: flex; justify-content: center; align-items: center;
}
.btn-start:hover { background: var(--hover-red); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(153, 0, 0, 0.35); }

/* Tombol Help di Kiri Bawah */
.leaflet-bottom.leaflet-left { margin-bottom: 70px; margin-left: 10px; }
.btn-help {
    position: absolute; bottom: 25px; left: 15px; z-index: 1000; background: white; border: none; color: var(--primary-red);
    padding: 10px 20px; border-radius: 30px; font-size: 14px; font-weight: 700; display: flex; gap: 8px; justify-content: center; align-items: center;
    cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.15); transition: 0.3s;
}
.btn-help i { font-size: 18px; }
.btn-help:hover { transform: translateY(-3px); background: var(--primary-red); color: white; box-shadow: 0 6px 15px rgba(153,0,0,0.3); }

/* Lightbox Gambar */
.image-lightbox-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); z-index: 3000; 
    display: none; justify-content: center; align-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    opacity: 0; transition: opacity 0.3s ease;
}
.image-lightbox-content {
    max-width: 90%; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    object-fit: contain; cursor: zoom-out; transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.image-lightbox-overlay.show-lightbox { opacity: 1; display: flex; }
.image-lightbox-overlay.show-lightbox .image-lightbox-content { transform: scale(1); }
.image-lightbox-close {
    position: absolute; top: 20px; right: 30px; color: white; font-size: 40px; font-weight: 300; 
    cursor: pointer; transition: 0.2s; text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.image-lightbox-close:hover { color: #ff6b6b; transform: scale(1.1); }


/* ========== RESPONSIVE ========== */
@media screen and (max-width: 768px) {
    /* Modal Penyesuaian HP */
    .modal-content { padding: 20px 15px; border-radius: 20px; width: 95%; max-height: 90vh; overflow-y: auto; }
    .modal-header-visual { width: 50px; height: 50px; font-size: 24px; margin-bottom: 10px; }
    .title-small { font-size: 11px; }
    .highlight-title { font-size: 15px; }
    .angka-highlight { font-size: 28px; }
    .panduan-item { padding: 10px; border-radius: 12px; }
    .icon-wrapper { width: 32px; height: 32px; border-radius: 8px; margin-right: 10px; }
    .icon-wrapper i { font-size: 14px; }
    .panduan-text { font-size: 10.5px; }
    .panduan-text strong { font-size: 12px; }
    .btn-start { padding: 12px 15px; font-size: 13px; }

    /* Search Bar dkk Penyesuaian HP */
    .search-panel { top: 10px; width: 90%; max-width: 320px; flex-direction: column; padding: 6px 8px; gap: 5px; border-radius: 10px; }
    .search-box { width: 100%; box-sizing: border-box; padding: 4px 10px; border-radius: 6px; }
    .search-box input { font-size: 16px; padding-right: 20px; margin: 0; }
    .search-box i.fa-map-marker-alt, .search-box i.fa-store { font-size: 14px; width: 16px; text-align: center; }
    .clear-btn { font-size: 14px; right: 10px; }
    .divider { width: 100%; height: 1px; }
    .custom-dropdown { max-height: 180px; }
    
    .info.legend { padding: 8px 10px; border-radius: 8px; margin-bottom: 25px; margin-right: 10px; }
    .legend h4 { font-size: 12px; margin-bottom: 5px; padding-bottom: 4px; }
    .legend-item { font-size: 10px; margin-bottom: 4px; }
    .legend-icon-properti { width: 12px; height: 12px; font-size: 6px; }
    .btn-help { bottom: 25px; left: 10px; padding: 8px 12px; font-size: 12px; }
    
    .popup-custom { width: 100%; min-width: 240px; }
    .popup-img-container { height: 180px; }
    .attribute-key, .attribute-value { font-size: 11px; }
    .leaflet-bottom.leaflet-left { margin-bottom: 70px; margin-left: 10px; }
}
