/* layout */
html, body {
    height: 100%;
    margin: 0;
}

/* header */
#header {
    height: 60px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: flex-start;   /* pindah ke kiri */
    padding-left: 30px;            /* kasih jarak dari kiri */
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 22px;
    color: #2c7be5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Map */
#map {
    height: calc(100% - 60px);
}

/* =============================== */
/* FIX POSISI CONTROL (WAJIB INI) */
/* =============================== */
.leaflet-bottom.leaflet-right {
    bottom: 10px;   /* 🔥 geser semua control naik */
}

/* Home Button */
#home-btn {
    position: absolute;
    bottom: 170px;
    right: 10px;

    width: 45px;              /* ukuran kotak */
    height: 45px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: white;
    border-radius: 6px;
    cursor: pointer;

    font-size: 20px;          /* perbesar icon */
    
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 1000;
}

#home-btn:hover {
    background: #d0cece;
}


/* ----------------- */
/* Navigation Button */
/* ----------------- */
#nav-buttons {
    position: absolute;
    top: 70px;                 /* bawah header */
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    gap: 45px;

    padding: 8px 16px;
    border-radius: 40px;

    /* background: rgba(255,255,255,0.9);   */
    /* backdrop-filter: blur(6px);           */

    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* BUTTON BASE */
.nav-btn {
    padding: 8px 20px;
    border-radius: 25px;
    border: 1px solid #d0d0d0;

    background-color: #f8f7f7;
    color: #333;

    font-weight: 600;
    font-size: 13px;

    cursor: pointer;

    transition: background-color 0.2s ease;  /* 🔥 hanya warna */
    outline: none;                           /* 🔥 hilangkan focus border */
}

/* HOVER */

.nav-btn:hover {
    background-color: #dcdcdc;
}

/* ACTIVE STATE */
.nav-btn.active {
    background-color: #0b2c3d;
    color: white;
    border: none;
}

/* REMOVE CLICK EFFECT */
.nav-btn:active {
    transform: none;   /* 🔥 hilangkan efek membesar */
}

/* ----------------- */
/* SIDEBAR */
/* ----------------- */
#sidebar {
    position: absolute;

    top: 55%;                 /* center vertikal */
    left: 15px;

    transform: translateY(-50%);  /* true center */

    width: 320px;
    max-height: 80vh;        /* ikut tinggi layar */

    background: white;
    padding: 15px;
    border-radius: 20px;

    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;

    display: none;

    overflow: hidden;        /* container tetap rapi */
}

/* ----------------------- */
/* Level 1 Analyisis Label */
/* ----------------------- */
.rank-label {
    background: white;
    border-radius: 50%;
    border: 2px solid #08306b;
    color: #08306b;

    width: 24px;
    height: 24px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 12px;
    font-weight: bold;

    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}


/* ------------------------------- */
/* Level 1 Analyisis Sidebar Table */
/* ------------------------------- */
#sidebar table {
    border-collapse: collapse;
}

#sidebar th, #sidebar td {
    padding: 6px;
    border: 1px solid #ddd;
}

#sidebar tr:nth-child(even) {
    background-color: #f2f2f2;
}

#sidebar tr:hover {
    background-color: #dbeafe;
    cursor: pointer;
}


/* container scroll horizontal + vertical */
.table-container {
    height: 410px;
    overflow-y: auto;
    overflow-x: auto;   /* horizontal scroll */
    margin-top: 10px;
}

/* table styling */
.data-table {
    border-collapse: collapse;
    font-size: 11px;
    min-width: 7    px;   /* supaya bisa geser ke samping */
}

/* header */
.data-table th {
    background: #0b2c3d;
    color: white;
    padding: 6px;
    text-align: center;

    position: sticky;
    top: 0;
    z-index: 2;
}

/* cell */
.data-table td {
    padding: 5px;
    border: 1px solid #ccc;
    text-align: center;
}

/* 🔥 khusus kolom Kelurahan */
.sticky-col {
    text-align: left !important;
    padding-left: 8px;
}

/* optional hover */
.data-table tr:hover {
    background: #e3f2fd;
}


/* ===================== */
/* FREEZE KOLOM KELURAHAN */
/* ===================== */

.sticky-col {
    position: sticky;
    left: 0;
    background: white;        /* wajib supaya tidak tembus */
    z-index: 3;
}

/* header lebih atas */
.data-table th.sticky-col {
    z-index: 4;
}

/* optional biar ada efek garis */
.sticky-col {
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

/* ===================== */
/* RESET BUTTON TO DEFAULT MAP*/
/* ===================== */
#reset-btn {
    position: absolute;
    top: 80px;
    right: 10px;

    width: 34px;
    height: 34px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: white;
    border-radius: 6px;
    cursor: pointer;

    font-size: 16px;

    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 1000;
}

/* ===================== */
/* FOOTER COPYRIGHT */
/* ===================== */
#footer {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);

    font-size: 12px;
    color: rgba(0,0,0,0.6);

    background: rgba(255,255,255,0.7);
    padding: 4px 10px;
    border-radius: 10px;

    backdrop-filter: blur(3px);
    z-index: 1000;
}

/* ===================== */
/* MOBILE PHONE - SIDEBAR */
/* ===================== */

@media (max-width: 768px) {

    #sidebar {
        position: absolute;

        bottom: 36.5px;     /* 🔥 jarak dari bawah */
        left: 10px;

        top: auto;        /* 🔥 MATIKAN top */
        transform: none;  /* 🔥 MATIKAN center */

        width: 260px;
        height: 158px;

        padding: 10px;
        border-radius: 15px;
        
    }

}

@media (max-width: 768px) {

    #sidebar table {
        font-size: 8px;   /* 🔥 kecilin font */
    }

    #sidebar h3 {
        font-size: 9px;
    }

    #sidebar p {
        font-size: 12px;
    }

}

/* ===================== */
/* MOBILE PHONE - NAV BUTTON */
/* ===================== */

@media (max-width: 768px) {

    #nav-buttons {
        position: absolute;
        top: 70px;
        left: 100px;
        right: 105px;              /* 🔥 biar full width */

        display: flex;
        justify-content: space-between; /* 🔥 kiri-tengah-kanan */
        align-items: center;

        gap: 2px;                 /* kecilkan jarak */
        padding: 0;
    }

}

