/* ── Map ────────────────────────────────────────────────────────────────── */
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.leaflet-interactive:focus {
    outline: none;
}

/* ── Toolbar ────────────────────────────────────────────────────────────────── */
#toolbar {
    position: absolute;
    top: 10px;
    right: 10px;

    width: 200px;                    /* collapsed width */
    height: 10px; 

    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    padding: 12px 8px;
    z-index: 1000;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Helvetica Neue', Arial, sans-serif;

    overflow: hidden;

    transition: height 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.toolbar-header {
    margin-bottom: 8px;
    cursor: pointer;
}

#toolbar:hover {
    width: 200px;
    height: auto
}

.toolbar-section-title {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #333;
    margin-bottom: 7px;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toolbar-divider {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.12);
    margin: 10px 0;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    color: #222;
    line-height: 1.4;
    padding: 1px 0;
}

.radio-label input,
.checkbox-label input {
    flex-shrink: 0;
    cursor: pointer;
}

/* Hide content when collapsed */
#toolbar .toolbar-section,
#toolbar .toolbar-divider {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Show content when expanded */
#toolbar:hover .toolbar-section,
#toolbar:hover .toolbar-divider {
    opacity: 1;
    pointer-events: auto;
}

/* ── Toolbar Scroll Fix ── */
#toolbar:hover {
    max-height: 90vh;      /* prevent toolbar from overflowing screen */
    overflow-y: auto;       /* allow scrolling if content too tall */
}

/* ── Search Input Styling ── */
#toolbar input[type="text"] {
    width: 100%;
    max-width: 186px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

#toolbar input[type="text"]:focus {
    border-color: #888;
}

/* ── Optional smooth scrollbar ── */
#toolbar::-webkit-scrollbar {
    width: 6px;
}

#toolbar::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

#toolbar::-webkit-scrollbar-track {
    background: transparent;
}

/* ── Legend ─────────────────────────────────────────────────────────────────── */
.map-legend {
    position: relative;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 12px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12.5px;
    line-height: 1.4;
    min-width: 165px;
}

.legend-title {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #333;
    margin-bottom: 9px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(0,0,0,0.12);
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-label {
    color: #333;
    font-size: 12px;
}