/* Geographic charger map */

.map-card {
    overflow: hidden;
}

.map-heading {
    align-items: center;
}

.map-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.map-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;

    min-height: 38px;
    padding: 0.55rem 0.85rem;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.035);
    color: #cbd5e1;

    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.map-filter:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.075);
    color: #ffffff;
}

.map-filter:active {
    transform: translateY(1px);
}

.map-filter.active {
    border-color: rgba(232, 33, 39, 0.72);
    background: rgba(232, 33, 39, 0.16);
    color: #ffffff;
}

.map-filter span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.4rem;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;

    font-size: 0.75rem;
    line-height: 1;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.2rem;

    margin: 0 0 1rem;
    padding: 0.85rem 1rem;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.025);
}

.charger-map {
    position: relative;

    width: 100%;
    height: clamp(480px, 62vh, 760px);

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;

    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(44, 62, 92, 0.28),
            rgba(10, 13, 20, 0.96)
        );
}

.charger-map .network-loading {
    z-index: 1000;
}

.charger-map .leaflet-container {
    width: 100%;
    height: 100%;
}

.leaflet-container {
    background: #0b0f17;
    font-family: Inter, system-ui, sans-serif;
}

.leaflet-control-zoom a {
    min-width: 44px !important;
    min-height: 44px !important;
    line-height: 44px !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    background: rgba(15, 20, 30, 0.94) !important;
    color: #ffffff !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(35, 43, 58, 0.98) !important;
}

.leaflet-control-attribution {
    border-radius: 8px 0 0 0;
    background: rgba(10, 13, 20, 0.78) !important;
    color: #94a3b8 !important;
}

.leaflet-control-attribution a {
    color: #cbd5e1 !important;
}

.charger-map-marker {
    display: block;

    width: 18px;
    height: 18px;

    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;

    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.5);
}

.charger-map-marker.visited {
    background: #42d392;
}

.charger-map-marker.unvisited {
    background: #e82127;
}

.charger-map-marker.future {
    background: #798395;
}

.charger-map-marker.transit {
    background: #3b82f6;
}

.charger-map-marker:hover {
    transform: scale(1.16);
}

.charger-map-popup .leaflet-popup-content-wrapper,
.charger-map-popup .leaflet-popup-tip {
    background: #151b26;
    color: #ffffff;
}

.charger-map-popup .leaflet-popup-content-wrapper {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;

    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.46);
}

.charger-map-popup .leaflet-popup-content {
    min-width: 220px;
    margin: 1rem;
}

.charger-popup-status {
    margin: 0 0 0.35rem;

    color: #94a3b8;

    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.charger-popup-title {
    margin: 0 0 0.4rem;

    color: #ffffff;

    font-size: 1rem;
    line-height: 1.25;
}

.charger-popup-location {
    margin: 0 0 0.8rem;

    color: #cbd5e1;

    font-size: 0.85rem;
}

.charger-popup-details {
    display: grid;
    gap: 0.4rem;

    margin: 0;
}

.charger-popup-details div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.charger-popup-details dt {
    color: #94a3b8;
    font-size: 0.78rem;
}

.charger-popup-details dd {
    margin: 0;

    color: #ffffff;

    font-size: 0.78rem;
    font-weight: 700;
    text-align: right;
}

@media (max-width: 720px) {
    .map-heading {
        align-items: flex-start;
    }

    .map-actions {
        width: 100%;
    }

    .map-actions .network-button {
        width: 100%;
    }

    .charger-map {
        height: 540px;
        border-radius: 14px;
    }
}
