/* =========================================================================
   css/brgy.css
   Binalbagan LDRRMO — Localized 16-Barangay Heat Map UI/UX Stylesheet
   Scoped strictly to the heatmap module (safe alongside Bootstrap 5)
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. MAP VIEWPORT & CONTAINER
   ------------------------------------------------------------------------- */
#binalbagan-brgy-heatmap {
    width: 100%;
    height: 680px;
    border-radius: 0;
    z-index: 1;
    background-color: #dbeafe;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.08);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (max-width: 991px) {
    #binalbagan-brgy-heatmap {
        height: 560px;
    }
}

@media (max-width: 575px) {
    #binalbagan-brgy-heatmap {
        height: 460px;
    }
}

/* -------------------------------------------------------------------------
   2. PERMANENT BARANGAY LABELS ON POLYGONS (HIGH-CONTRAST / SATELLITE-SAFE)
   ------------------------------------------------------------------------- */
.brgy-map-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
}

.brgy-map-label-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transform: translate(-50%, -50%);
}

.brgy-map-label-name {
    font-size: 11px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.25px;
    text-shadow:
        -1.5px -1.5px 0 rgba(255, 255, 255, 0.96),
         1.5px -1.5px 0 rgba(255, 255, 255, 0.96),
        -1.5px  1.5px 0 rgba(255, 255, 255, 0.96),
         1.5px  1.5px 0 rgba(255, 255, 255, 0.96),
         0  0  6px rgba(255, 255, 255, 0.95);
}

.brgy-map-label-hi {
    font-size: 9.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    padding: 1.5px 6px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    margin-top: 2px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(2px);
}

/* -------------------------------------------------------------------------
   3. POLISHED LEAFLET CONTROLS, TOOLTIPS & POPUPS
   ------------------------------------------------------------------------- */
#binalbagan-brgy-heatmap .leaflet-bar {
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12) !important;
}

#binalbagan-brgy-heatmap .leaflet-bar a,
#binalbagan-brgy-heatmap .leaflet-bar button {
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    color: #0f172a !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#binalbagan-brgy-heatmap .leaflet-bar a:hover,
#binalbagan-brgy-heatmap .leaflet-bar button:hover {
    background-color: #f1f5f9 !important;
    color: #D53E0F !important;
}

#binalbagan-brgy-heatmap .leaflet-control-layers {
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(6px);
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

#binalbagan-brgy-heatmap .leaflet-tooltip {
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

#binalbagan-brgy-heatmap .leaflet-tooltip-top::before {
    border-top-color: rgba(15, 23, 42, 0.92);
}

.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 30px -6px rgba(15, 23, 42, 0.22) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-variant-numeric: tabular-nums;
}

.leaflet-popup-close-button {
    color: #64748b !important;
    padding: 6px 8px 0 0 !important;
}

.leaflet-popup-close-button:hover {
    color: #0f172a !important;
}

/* -------------------------------------------------------------------------
   4. SYMMETRICAL 4x4 BARANGAY INSPECTOR GRID (16 BARANGAYS = 4 EVEN ROWS)
   ------------------------------------------------------------------------- */
.brgy-heat-list-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 1199px) {
    .brgy-heat-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 16px;
    }
}

@media (max-width: 575px) {
    .brgy-heat-list-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px;
    }
}

/* -------------------------------------------------------------------------
   5. TACTILE BARANGAY INSPECTOR CARDS (ACCESSIBLE & SCANNABLE)
   ------------------------------------------------------------------------- */
.brgy-heat-chip {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #94a3b8;
    border-radius: 12px;
    padding: 13px 15px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: transform 0.16s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.16s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.16s ease,
                background-color 0.16s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-variant-numeric: tabular-nums;
}

.brgy-heat-chip:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.12);
}

.brgy-heat-chip:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.brgy-heat-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 5, 162, 0.25);
}

.brgy-heat-chip.is-selected {
    background-color: #fffbeb;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22), 0 6px 16px -4px rgba(15, 23, 42, 0.10);
}

.brgy-chip-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.brgy-chip-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: #0f172a;
    letter-spacing: -0.15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brgy-chip-hi-badge {
    flex-shrink: 0;
    white-space: nowrap;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    letter-spacing: 0.1px;
}

.brgy-chip-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 4px 8px;
    font-size: 0.72rem;
    color: #64748b;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    line-height: 1.3;
}

.brgy-chip-tier {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* -------------------------------------------------------------------------
   6. REFERENCE DISCLAIMER BANNER
   ------------------------------------------------------------------------- */
.brgy-heat-disclaimer-box {
    background-color: #fff7ed;
    border-top: 1px solid #fed7aa;
    border-bottom: 1px solid #fed7aa;
    border-left: 4px solid #ea580c;
    color: #9a3412;
    font-size: 0.79rem;
    padding: 11px 18px;
    line-height: 1.55;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}