/* =========================================
   SIGIS – FACILITY MAP (LEAFLET) – UPDATED
   ========================================= */

.list_footer .muted_text,
.leaflet-bottom.leaflet-right{
    display: none;
}

.facility_item {
  position: relative;
  cursor: pointer;
}

.facility_edit {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.facility_edit:hover {
  text-decoration: none;
}


.facility_view {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.facility_view:hover {
  text-decoration: none;
}





.page_main {
    background: var(--white-smoke);
    padding: 30px 15px 40px;
}

.page_container {
    max-width: 1400px;
    margin: 0 auto;
}


.page_title {
    margin: 0 0 6px 0;
    font-size: 26px;
    color: var(--color-2-dark);
}

.page_subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--grey);
}

/* Card */
.card_block {
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--light-grey);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 14px;
}

/* Main layout: top bar + content */
.facility_map_layout {
    display: grid;
    grid-template-rows: auto auto; /* top bar + content */
    gap: 12px;
}

/* Top bar */
.top_bar {
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding: 12px;
    background: var(--color-3-light);
    border: 1px solid var(--light-grey);
    border-radius: 10px;
}

.top_bar_left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}


.top_bar_right {
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    justify-content: flex-end;
    /* width: 100%; */
}

/* Controls */
.control_group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.search_group {
    min-width: 340px;
}

#facility_search_input {
    /* width: 100%; */
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--light-grey);
    font-size: 13px;
    background: var(--white);
}

#facility_search_input:focus {
    outline: none;
    border-color: var(--color-2);
    box-shadow: 0 0 0 2px rgba(0,79,163,0.12);
}

.control_row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}


.btn_secondary {
    background: var(--white);
    border: 1px solid var(--light-grey);
    color: var(--dark-slate-grey);
}


/* Checkbox */
.checkbox_option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-slate-grey);
}

.checkbox_compact {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--light-grey);
    background: var(--white);
    font-size: 12px;
    font-weight: 800;
}

/* ======================================================
   Content grid
   - map_panel height is driven by CSS var --map_panel_height
   - list_panel matches map height and list scrolls
   ====================================================== */
.content_grid {
    --map_panel_height: 600px; /* DESKTOP HEIGHT CONTROL HERE */
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 12px;
    align-items: start;
}

/* List panel matches the map height */
.list_panel {
    height: var(--map_panel_height);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--light-grey);
    border-radius: 10px;
    overflow: hidden;
    background: var(--white);
}

.facility_list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Footer pinned inside list panel */
.list_footer {
    padding: 10px 12px;
    border-top: 1px solid var(--light-grey);
    background: #fafafa;
}


/* Facility item */
.facility_item {
    border: 1px solid var(--light-grey);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    background: var(--white);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.facility_item:hover {
    background: var(--white-smoke);
}

.facility_item.is_active {
    border-color: var(--color-2);
    box-shadow: 0 0 0 2px rgba(0,79,163,0.10);
}

.facility_name {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--dark-slate-grey);
}

.facility_meta,
.facility_coords {
    font-size: 12px;
    color: var(--grey);
    line-height: 1.35;
}
.facility_meta{
    max-width: 80%;
}
.facility_coords
{
    display: none;
}

/* Map panel follows CSS height */
.map_panel {
    height: var(--map_panel_height);
    border: 1px solid var(--light-grey);
    border-radius: 10px;
    overflow: hidden;
    background: var(--white);
}

/* Leaflet must fill parent height */
.map_canvas {
    height: 100%;
    width: 100%;
}

/* ---------------- Mobile / Tablet ---------------- */
@media (max-width: 1000px) {
    .content_grid {
        --map_panel_height: 420px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .search_group {
        min-width: 0;
        width: 100%;
    }

    .top_bar {
        align-items: stretch;
    }

    .top_bar_right {
        justify-content: flex-start;
    }

    /* Keep list usable, but not infinite */
    .list_panel {
        height: 420px;
    }
}

@media (max-width: 600px) {
    .content_grid {
        --map_panel_height: 360px;
    }

    .list_panel {
        height: 360px;
    }

    .page_main {
        padding: 20px 10px 30px;
    }

    .card_block {
        padding: 12px;
    }
}
