/**
 * Coverage Map Component Styles (COVERAGE-002)
 * Shared Map | Satellite provider control + Leaflet/Google fallback styling.
 * Base map wrapper / legend / locate styles live in pages/coverage.css.
 */

/* ── Map | Satellite provider selector (top-right, clear of Leaflet zoom) ── */
.map-control-bar {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1000;
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.btn-map-provider {
    border: 0;
    background: transparent;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.btn-map-provider:hover {
    background: #f1f5f9;
}

.btn-map-provider.active {
    background: #2563eb;
    color: #ffffff;
}

/* ── Google failure fallback message ── */
.google-fallback {
    display: none;
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    max-width: calc(100% - 32px);
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
}

/* ── Leaflet integration ── */
.leaflet-container {
    width: 100%;
    border-radius: 16px;
    font-family: inherit;
}

/* Popup uses the same design tokens as the Google infoWindow */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
}

.leaflet-popup-content {
    margin: 12px 14px;
}

.leaflet-popup-content .map-popup {
    min-width: 150px;
}

.leaflet-popup-content .popup-header {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.leaflet-popup-content .popup-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.leaflet-popup-content .popup-location {
    margin-bottom: 8px;
    color: #475569;
}

.leaflet-popup-content .popup-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

/* ── Small screens ── */
@media (max-width: 575.98px) {
    .map-control-bar {
        flex-direction: row;
        top: 10px;
        right: 10px;
    }

    .btn-map-provider {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    #coverageMap,
    .leaflet-container {
        height: 420px !important;
    }
}