/* Basemap switcher (bottom-left of the map) — component in scripts/basemap_switcher.py */
#basemap-switcher {
    position: absolute;
    left: 15px;
    bottom: 30px;
    z-index: 10;
    font-family: Mulish, sans-serif;
}

/* Preview thumbnail shared by the toggle and the cards */
.bm-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    background: #44546A;
}
.bm-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#basemap-toggle {
    position: relative;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
#basemap-toggle:hover,
#basemap-toggle:focus-visible {
    transform: scale(1.04);
    border-color: #FBB800;
    outline: none;
}
.bm-toggle-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 2px 3px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    text-align: center;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    pointer-events: none;
}

.bm-panel {
    display: none;
    position: absolute;
    left: 0;
    bottom: 74px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(30, 30, 30, 0.88);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.bm-panel.open {
    display: block;
    animation: bm-slide-in 0.15s ease-out;
}
@keyframes bm-slide-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.bm-options {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    gap: 8px;
}
.bm-option {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}
.bm-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.bm-card {
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.bm-card .bm-thumb {
    width: 56px;
    height: 56px;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.bm-option:hover .bm-thumb {
    border-color: rgba(251, 184, 0, 0.6);
    transform: translateY(-1px);
}
.bm-option:has(.bm-input:checked) .bm-thumb {
    border-color: #FBB800;
}
.bm-name {
    font-size: 10px;
    color: #ecf0f1;
    white-space: nowrap;
}
.bm-option:has(.bm-input:checked) .bm-name {
    color: #FBB800;
    font-weight: 700;
}
