body { margin: 0; padding: 0px; padding-top: 0px; font-family: sans-serif; background-color: #120587; }

h2 { text-align: left; color: #333; margin-bottom: 15px; }

#map {
    margin-top: 60px;
    height: calc(100vh - 90px); /* Tinggi layar dikurangi tinggi header */
    width: 100%;
    z-index: 1; /* Pastikan peta di bawah header */
}

@media (max-width: 47.99em) {
    #map {
        margin-top: 60px; /* Sedikit lebih kecil untuk HP */
        height: calc(100vh - 165px);
    }
}

/* --- RESET TOTAL UNTUK HEADER --- */
/* Container Utama Header */
.main-header {
    background-color: #120587 !important;
    height: 60px !important;
    width: 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
}

.header-inner {
    width: 100% !important;
    max-width: 1300px !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0px 15px 0px 15px;
}

/* Sisi Kiri (Logo) */
.header-left {
    display: flex !important;
    align-items: center !important;
}
.logo-img {
    height: 45px !important;
    margin-right: 12px !important;
}
.sig-title {
    color: #FFEB3B !important;
    font-weight: bold !important;
    font-size: 20px !important;
    font-family: sans-serif !important;
}
.desa-title {
    color: white !important;
    font-size: 14px !important;
    font-weight: bold !important;
    padding-left: 1px;
}

/* Sisi Kanan (Menu) */
.header-right { position: relative !important; }
#chk-menu { display: none !important; }

/* Desktop Menu Styling */
@media (min-width: 769px) {
    .btn-menu { display: none !important; }
    .nav-list ul {
        display: flex !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .nav-list ul li a {
        color: white !important;
        text-decoration: none !important;
        padding: 10px 15px !important;
        font-weight: bold !important;
        font-size: 12px !important;
        text-transform: uppercase !important;
    }
    .nav-list ul li a:hover { color: #FFEB3B !important; }
}


/* Mobile Menu Styling */
@media (max-width: 768px) {
    .btn-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        cursor: pointer !important;
        padding: 10px !important;
    }

    .bar {
        width: 25px !important;
        height: 3px !important;
        background: white !important;
        transition: all 0.3s ease-in-out !important; /* Animasi transisi halus */
        display: block !important;
    }

    /* --- ANIMASI SILANG (X) --- */
    
    /* Garis Pertama (Atas) berputar 45 derajat ke bawah */
    #chk-menu:checked ~ .btn-menu .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg) !important;
    }

    /* Garis Kedua (Tengah) menghilang/transparan */
    #chk-menu:checked ~ .btn-menu .bar:nth-child(2) {
        opacity: 0 !important;
        transform: translateX(-20px) !important; /* Efek geser keluar */
    }

    /* Garis Ketiga (Bawah) berputar 45 derajat ke atas */
    #chk-menu:checked ~ .btn-menu .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg) !important;
    }

    .nav-list {
        display: none !important;
        position: absolute !important;
        top: 60px !important;
        right: -10px !important;
        background: #120587 !important;
        width: 200px !important;
        box-shadow: 0 5px 10px rgba(0,0,0,0.5) !important;
    }
    
    #chk-menu:checked ~ .nav-list { display: block !important; }
    
    .nav-list ul { list-style: none !important; padding: 0 !important; }
    .nav-list ul li a {
        font-size: 12px;
        display: block !important;
        padding: 15px !important;
        color: white !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        text-decoration: none !important;
    }
}






        /* --- 1. HILANGKAN IKON BENDERA SAJA (TEKS TETAP ADA) --- */
        .leaflet-control-attribution svg {
            display: none !important;
        }

        /* --- 2. STYLE UNTUK DROPDOWN LAYER CONTROL --- */
        .group-header {
            cursor: pointer;
            display: block;
            background: #2c3e50;
            padding: 6px 10px 6px 5px;
            margin: 5px 0;
            font-weight: bold;
            font-size: 11px;
            color: white;
            border-radius: 4px;
            text-align: left;
        }
        .group-header:hover { background: #34495e; }
        
        /* Mengatur agar area item overlay bisa di-scroll jika terlalu panjang */
.leaflet-control-layers-overlays {
    MAX-height: 450px; /* Atur tinggi maksimal sesuai keinginan */
    overflow-y: auto;  /* Munculkan scrollbar hanya jika diperlukan */
    overflow-x: hiddden;
    scrollbar-width: none;
  
  /* Untuk Internet Explorer dan Edge lama */
  -ms-overflow-style: none;
  
  /* Untuk Chrome, Safari, dan versi baru Edge */
  &::-webkit-scrollbar {
    display: none;
}
    padding-right: 5px;
}

/* Mempercantik tampilan scrollbar (opsional) */
.leaflet-control-layers-overlays::-webkit-scrollbar {
    width: 0px;
}
.leaflet-control-layers-overlays::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
 
 /* Mengatur lebar panel agar mengikuti panjang teks (fit-content) */
.leaflet-control-layers {
    min-width: 30px !important; /* Memperkecil lebar minimal */
    width: auto !important;
}

/* Mengurangi jarak (padding) di dalam list agar tidak terlalu lebar ke kanan */
.leaflet-control-layers-list {
    padding-right: 2px !important;
}

/* Mengatur agar form (checkbox dan label) tidak memiliki margin berlebih */
.leaflet-control-layers-selector {
    margin-right: 0px !important;
}

/* Mengurangi padding pada container utama */
.leaflet-control-layers-expanded {
    padding: 6px 3px 6px 6px !important;
}       
        /* Kontainer scroll untuk grup tertentu */
.scroll-box {
    max-height: 450px; /* Tinggi maksimal sebelum scroll muncul */
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #eee;
    margin: 2px 0 2px 10px;
    padding: 2px;
    background: #fafafa;
}

/* Mempercantik scrollbar */
.scroll-box::-webkit-scrollbar { width: 0px; }
.scroll-box::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

        
        /* Sembunyikan checkbox bawaan pada baris judul */
        .leaflet-control-layers-overlays label:has(.group-header) input {
            display: none !important;
        }

        /* Style untuk teks item di bawah grup */
        .layer-item-label {
            align-items: left !important;
            font-family: Arial, sans-serif; /* Atau 'Arial', sans-serif */
            padding-left: 2px;
            font-weight: normal;
            font-size: 11px;
        }

        /* Class untuk sembunyikan baris secara total */
        .hidden-row {
            display: none !important;
        }

/* Kontainer Utama Basemaps */
.leaflet-control-layers-base {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    padding: 5px 5px 0px 5px;
    border-bottom: 0px solid #eee;
    margin-bottom: 0px;
}

/* Sembunyikan Radio Button bawaan */
.leaflet-control-layers-base input {
    display: none;
}

/* Label sebagai wadah tunggal gambar */
.leaflet-control-layers-base label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    font-size: 11px;
    font-weight: bold;
    color: #555;
}

/* Gambar Thumbnail - Dipasang pada LABEL, bukan span */
.leaflet-control-layers-base label::before {
    content: "";
    display: block;
    width: 45px;
    height: 30px;
    border-radius: 6px;
    margin-bottom: 5px;
    border: 2px solid #ccc;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
}

/* Gambar Spesifik per Label */

.leaflet-control-layers-base label:nth-child(1)::before {
    background-image: url('https://tile.openstreetmap.org/15/16777/10851.png');
    }

.leaflet-control-layers-base label:nth-child(2)::before {
    background-image: url('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/15/10851/16777');
}

.leaflet-control-layers-base label:nth-child(3)::before {
    background-image: url('https://a.tile.openstreetmap.org/14/8586/5475.png');
}

.leaflet-control-layers-base label:nth-child(4)::before {
    background-image: url('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/14/8586/5475.png');
}

.peta-pudar {
    filter: grayscale(100%) brightness(120%) opacity(0.5) !important;
}

/* Efek saat dipilih (Checked) */
/* Kita gunakan selector :has atau sibling selector yang lebih stabil */
.leaflet-control-layers-base label:has(input:checked)::before {
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.6);
    transform: scale(1.05);
}

.leaflet-control-layers-base label:has(input:checked) {
    color: #3498db;
}

        /* --- 3. STYLE UNTUK LEGENDA --- */
        .info.legend {
            padding: 10px;
            font: 11px/12px Arial, Helvetica, sans-serif;
            background: white;
            background: rgba(255,255,255,0.9);
            box-shadow: 0 0 15px rgba(0,0,0,0.2);
            border-radius: 5px;
            color: #555;
            line-height: 18px;
            text-align: left;
            z-index: 1000;
            margin-bottom: 30px;
            display: none;
        }
        .legend h4 { margin: 0 0 5px; color: #333; }
        .legend i {
            width: 18px;
            height: 18px;
            float: left;
            margin-right: 8px;
            opacity: 0.7;
            border: 1px solid green;
        }
        
.sub-label {
    pointer-events: none;
    cursor: default;
}


/* Menargetkan kontainer kontrol di pojok kiri atas */
.leaflet-top.leaflet-left {
    display: flex;       /* Aktifkan mode sejajar */
    flex-direction: row; /* Berjejer dari kiri ke kanan */
    align-items: flex-start; 
    gap: 10px;          /* Jarak antara kotak basemap dan kotak wilayah */
    padding: 10px;      /* Jarak dari pinggir peta */
}

/* Menghilangkan margin bawaan agar tidak berantakan saat mode flex */
.leaflet-top.leaflet-left .leaflet-control {
    margin: 0 !important;
}

/* Opsional: Jika ingin memberi judul di atas masing-masing kotak agar rapi */
.leaflet-control-layers-expanded::before {
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* Menghilangkan jarak bawaan Leaflet pada kontrol bawah kiri */
.leaflet-bottom.leaflet-left .leaflet-control {
    margin-bottom: 0 !important;
    margin-left: 0px !important;
}

/* Style untuk Tombol Lokasi */
.leaflet-control-locate {
    background: transparent;
    background-image: radial-gradient(#c2ed6d 60%, green 20%, rgba(0,0,0,0.2) 20%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50px;
    border: 0px solid rgba(0,0,0,0.2);
    margin-bottom: 5px;
    margin-left: 10px !important;
}

.leaflet-control-locate:hover {
    background-color: #f4f4f4;
}

.leaflet-control-locate img {
    width: 20px;
    height: 20px;
}

#elevation-info {
    position: absolute;
    bottom: 20px;
    left: 30px;
    padding: 1.5px 10px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ccc;
    z-index: 900;
    font-size: 0.6rem;
    border: 2px solid #ccc;
    border-top: none;
    text-shadow: 1px 1px #fff;
    line-height: 1.1;
    color: #333;
        transform: rotate(0deg);
        transform-origin: left bottom;
    
    
    /* Di laptop, biarkan sejajar horizontal */
    display: inline-block;
    pointer-events: none; /* Agar tidak menghalangi klik pada peta */
    
    /* --- TAMPILAN KHUSUS HP (Layar di bawah 768px) --- */
    @media only screen and (max-width: 768px) {
    .leaflet-bottom.leaflet-left {
        display: flex !important;
        flex-direction: column-reverse !important; /* Tumpuk ke atas di HP */
        align-items: flex-start !important;;
    }

    #elevation-info {
        /* Efek Rotasi hanya di HP */
        transform: rotate(0deg);
        transform-origin: left bottom;
        margin-bottom: 0px !important; /* Beri ruang agar tidak menabrak tombol */
        margin-left: 5px;
        order: 3; /* Pastikan berada paling atas dalam tumpukan */
    }
    
    .leaflet-bottom.leaflet-left .leaflet-control, 
    #elevation-info {
        position: relative !important;
        margin: 0 !important;
        clear: both;
    }
    
    .leaflet-control-locate {
        order: 2;
    }
    
    .leaflet-control-scale {
        order: 1;
    }
}
}

/* Mengecilkan ukuran teks dan ketebalan garis skala */
.leaflet-control-scale-line {
    font-size: 9px !important;
    border: 1px solid #333 !important;
    border-top: none !important;
    line-height: 1 !important;
    padding: 2px 5px !important;
    background: rgba(255, 255, 255, 0.5) !important;
}

.compass {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000; /* Supaya berada di atas peta */
    pointer-events: none; /* Supaya tidak menghalangi klik pada peta */
}

.compass img {
    width: 60px; /* Atur ukuran gambar sesuai keinginan */
    height: auto;
    opacity: 0.8; /* Sedikit transparan agar terlihat profesional */
}

.custom-compass {
    position: absolute;
    bottom: 20px;
    right: 5px;
    z-index: 1000;
    background: rgba(30, 18, 196, 0.5);
    padding: 5px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

/* Bentuk Mata Angin Orange */
.compass-shape {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    clip-path: polygon(50% 0%, 67% 41%, 100% 54%, 100% 54%, 64% 67%, 50% 100%, 31% 65%, 0% 54%, 0% 54%, 33% 39%);
    margin: 0px 0;
}

.direction-label {
    font-size: 12px;
    color: #fff;
}

.north-label { color: yellow;}

.custom-div-icon {
    background: none !important;
    border: none !important;
}

.custom-div-icon i {
    /* Memberikan outline putih tipis agar ikon tetap terbaca di peta yang gelap/satelit */
    text-shadow: 
        -1px -1px 0 #fff,  
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff,
         0px  2px 4px rgba(0,0,0,0.5);
    transition: all 0.3s; /* Efek halus saat hover */
}

.custom-div-icon i:hover {
    transform: scale(1.2); /* Ikon membesar sedikit saat diarahkan kursor */
}

.leaflet-popup-content {
    margin: 13px 13px 13px 13px;
}
/.img-overlay {
    display: none;
    position: fixed;
    /* Gunakan z-index 9999 agar berada di atas Leaflet Control */
    z-index: 9999 !important; 
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.img-overlay img {
    max-width: 90%;
    max-height: 90%;
    border: 3px solid white;
    border-radius: 8px;
}

/* Styling Tabel Popup */
.popup-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Arial', sans-serif;
    font-size: 11px;
    margin-top: 5px;
}

.popup-table th {
    background-color: rgba(18, 5, 135, 0.5); /* Warna biru desa sesuai header */
    color: white;
    text-align: center;
    padding: 6px;
    border: 1px solid rgba(18, 5, 135, 0.5);
}

.popup-table td {
    padding: 6px 6px 6px 6px;
    border: 1px solid #ddd;
    color: #333;
    text-align: left;
}

/* Warna selang-seling agar mudah dibaca */
.popup-table tr:nth-child(even) {
    background-color: #f9f9f9 !important;
}

/* Responsif: Pastikan popup Leaflet tidak terlalu sempit */
.leaflet-popup-content {
    width: auto !important;
}

/* Style Kotak Pencarian */
/* CONTAINER PENCARIAN REVISI */
/* CONTAINER UTAMA */
/* CONTAINER UTAMA */
.search-box {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    height: 30px; /* Samakan dengan width awal */
    width: 30px;  /* Harus sama dengan height agar bulat sempurna */
    display: flex;
    align-items: center; /* Centering Vertikal */
    justify-content: flex-end; /* Ikon tetap di kanan saat melebar */
    padding: 0px;
    background: white;
    border-radius: 40px;
    border: 2px solid rgba(0,0,0,0.2);;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

/* KETIKA AKTIF */
.search-box.active {
    width: 200px;
}

/* TOMBOL SEARCH (BULATAN DALAM) */
.search-btn {
    width: 30px; /* Sedikit lebih kecil dari container agar ada jarak (padding) */
    height: 30px;
    background: white;
    color: #120587;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center; /* Centering ikon horizontal */
    align-items: center;     /* Centering ikon vertikal */
    cursor: pointer;
    flex-shrink: 0; 
}

/* INPUT TEXT */
.search-input {
    width: 0; /* Awalnya 0 agar tidak dorong ikon */
    border: none;
    background: none;
    outline: none;
    padding: 0;
    color: #333;
    font-size: 14px;
    transition: all 0.4s;
    opacity: 0;
}

.search-box.active .search-input {
    width: 100%;
    opacity: 1;
    padding: 0 10px 0 15px; /* Memberi ruang di kiri teks */
}

* Geser panel Geoman sedikit ke bawah agar tidak menabrak tombol lain */
/* 1. Pastikan Searchbox tetap di posisinya */
.search-box {
    position: absolute;
    top: 80px; /* Jarak dari navigasi atas */
    right: 20px;
    z-index: 1100; /* Lebih tinggi agar tidak tertutup */
}

/* Container Utama Loader */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white; /* Layar belakang putih bersih */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Pastikan di atas segalanya */
    transition: opacity 0.5s ease;
}

/* Animasi Spinner */
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #120587; /* Warna biru tema desa */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* Teks Loading */
#loader-wrapper p {
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    color: #120587;
    font-weight: bold;
    letter-spacing: 1px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Class untuk menghilangkan loader */
.fade-out {
    opacity: 0;
    pointer-events: none;
}

.vm {
    display: none;
}

/* Saat layar berukuran kecil (HP) */
@media (max-width: 768px) {
    /* Sembunyikan elemen Desktop */
    .vd {
        display: none;
    }
    
    /* Tampilkan elemen HP */
    .vm {
        display: block; 
        /* Gunakan flex atau inline-block jika elemennya butuh layout khusus */
    }
}

.footer-gis {
    display: flex;
    flex-direction: row;
    /* justify-content: space-between memastikan kiri mentok kiri, kanan mentok kanan */
    justify-content: space-between; 
    align-items: center;
    background-color: #120587;
    color: #fff;
    padding: 10px 20px; /* Tambah padding samping agar tidak nempel layar */
    width: 100%;
    font-size: 11px;
    z-index: 1000;
    box-sizing: border-box; /* Agar padding tidak merusak lebar 100% */
}

/* Di Desktop: bagi lebar sama rata agar posisi center benar-benar di tengah */
.footer-left, .footer-center, .footer-right {
    flex: 1; 
}

.footer-left { text-align: left; }
.footer-center { text-align: center; }
.footer-right { text-align: right; }

/* Style Khusus untuk HP */
@media (max-width: 768px) {
    .footer-gis {
        flex-direction: column;
        gap: 8px;
        height: auto;
        padding: 15px 5px;
        text-align: center; /* Pastikan semua teks center di HP */
    }
    
    /* Gunakan KOMA untuk memisahkan selektor */
    .footer-left, .footer-center, .footer-right {
        width: 100%;
        text-align: center; /* Paksa semua rata tengah saat di HP */
    }
}

/* Mengecilkan teks di dalam dropdown/select SweetAlert */
/* Mengunci ukuran judul agar tidak raksasa */
div:where(.swal2-container) h2:where(.swal2-title) {
    font-size: 1rem !important; /* Ukuran font judul */
    padding: 15px 10px 0px 10px !important;
    color: red !important;
}

/* Mengatur ukuran teks di dalam dropdown select */
div:where(.swal2-container) .swal2-select {
    font-size: 14px !important;
    max-width: 90% !important;
    margin: 0px auto !important;
}

/* Mengatur ukuran teks instruksi (html/text) */
div:where(.swal2-container) .swal2-html-container {
    font-size: 13px !important;
    margin: 5px 0 !important;
}

/* Mengatur ukuran tombol */
div:where(.swal2-container) .swal2-actions button {
    font-size: 12px !important;
    padding: 8px 16px !important;
}
}