/*MAP CONTROLS (floating buttons over the map)*/
/* Same grid cell as the map; stacked above it but placed before the
   list slider in the DOM, so the fully expanded list still covers it. */
.map-controls {
    grid-area: mapAndList;
    align-self: start;
    justify-self: end;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--standard-gap);
    margin: var(--very-big-padding) var(--big-padding) 0 0;
    pointer-events: none;
}

.map-controls>* {
    pointer-events: auto;
}

/* Desktop: die schwebende Ergebnisliste (gasStationList.css) belegt den
   rechten Kartenrand, die Bedienelemente wandern daher auf die linke Seite. */
@media (min-width: 700px) and (orientation: landscape) {
    .map-controls {
        justify-self: start;
        align-items: flex-start;
        margin: var(--very-big-padding) 0 0 var(--big-padding);
    }

    .filter-dial-items {
        align-items: flex-start;
    }
}

.map-fab {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 18px;
    color: var(--primary-color);
    background-color: var(--surface-color);
    border: 1px solid var(--standard-grey);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgb(16 16 16 / 0.22);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.map-fab[hidden] {
    display: none;
}

.map-fab:hover {
    background-color: var(--light-grey);
}

.map-fab:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Current location */
#current-location-button>.fa-spinner {
    display: none;
}

#current-location-button.loading {
    pointer-events: none;
    background-color: var(--standard-grey);
    color: var(--dark-grey);
}

#current-location-button.loading>.fa-location-crosshairs {
    display: none;
}

#current-location-button.loading>.fa-spinner {
    display: block;
}

#current-location-button.location-found {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: var(--white);
}

#current-location-button.location-found:hover {
    background-color: var(--primary-color-75);
}

/* Filter speed-dial */
.map-fab-dial {
    color: var(--white);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.map-fab-dial:hover {
    background-color: var(--primary-color-75);
}

.map-fab-dial>.fa-xmark,
.map-fab-dial.open>.fa-sliders {
    display: none;
}

.map-fab-dial.open>.fa-xmark {
    display: block;
}

/* Menu toggle (opens the settings panel). Anders als der Filter-Dial morpht
   das Zahnrad nicht zu einem X - es bleibt sichtbar und dreht sich leicht,
   waehrend Hintergrund/Farbe wie beim aktiven Filter-Dial umschlagen. */
#menu-toggle-button.open {
    color: var(--white);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#menu-toggle-button.open:hover {
    background-color: var(--primary-color-75);
}

#menu-toggle-button>.fa-gear {
    transition: transform 0.25s ease;
}

#menu-toggle-button.open>.fa-gear {
    transform: rotate(75deg);
}

.filter-dial-items {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--small-gap);
    animation: filter-dial-in 0.18s ease-out;
}

.filter-dial-items[hidden] {
    display: none;
}

.filter-dial-item {
    display: flex;
    align-items: center;
    gap: var(--small-gap);
}

/* Mobil ergibt der Bestpreis-Zeitraum im Dial keinen Sinn (beeinflusst nicht,
   welche Stationen angezeigt werden) - dort bleibt er in der Listenansicht
   (list-filter-options in gasStationList.css). Auf Desktop wird er weiter
   unten wieder eingeblendet, da dort keine Listen-Filterzeile existiert. */
.filter-dial-item--desktop-only {
    display: none;
}

@media (min-width: 700px) and (orientation: landscape) {
    /* Nur auf Desktop im Dial, da die Listen-Filterzeile hier entfaellt
       (siehe gasStationList.css) und der Bestpreis-Zeitraum sonst nirgends
       mehr erreichbar waere. Muss nach der unconditional Regel oben stehen,
       da beide dieselbe Spezifitaet haben und sonst je nach Quellreihenfolge
       die falsche gewinnt. */
    .filter-dial-item--desktop-only {
        display: flex;
    }
}

.filter-dial-item .filter-option {
    height: 32px;
    font-family: inherit;
    font-size: 13px;
    color: var(--primary-color);
    background-color: var(--surface-color);
    box-shadow: 0 3px 8px rgb(16 16 16 / 0.18);
    cursor: pointer;
}

.filter-dial-item .filter-option:hover {
    background-color: var(--light-grey);
}

.filter-dial-item .filter-option:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.filter-dial-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 14px;
    color: var(--primary-color);
    background-color: var(--surface-color);
    border: 1px solid var(--standard-grey);
    border-radius: 50%;
    box-shadow: 0 3px 8px rgb(16 16 16 / 0.18);
}

@keyframes filter-dial-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
