/*
 * Shared Amazon Location/MapLibre map component styles (Phase 3E, Workstream 2).
 *
 * Previously injected at runtime by quickcare-aws-location-map.js's
 * injectStyles() via document.createElement('style') + textContent -- a
 * JS-authored <style> element with fully static, non-interpolated CSS (no
 * per-page/per-instance values), making it a straightforward move to a real,
 * owned stylesheet loaded via the shared `location-map` feature entrypoint
 * (see AssetRegistry::FEATURE_ENTRYPOINTS). This removes the only remaining
 * app-authored dynamically-injected <style> element on any of the 13 pages
 * that load this script, closing a style-src-elem CSP gap that couldn't be
 * fixed by a nonce/hash without either duplicating this CSS per-page or
 * baking a build-time hash into the JS file.
 */

.service-region__map-container {
    position: relative;
    min-height: 350px;
    height: 60vh;
    max-height: 600px;
    overflow: hidden;
    width: 100%;
    background-color: #e5e7eb;
    border-radius: inherit;
}

.service-region__map {
    height: 100%;
    width: 100%;
}

.service-region__map-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    transition: opacity 0.3s ease-out;
    opacity: 1;
    pointer-events: auto;
}

.service-region__spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(157, 78, 221, 0.2);
    border-top-color: #9d4edd;
    border-radius: 50%;
    animation: qc-map-spin 1s linear infinite;
}

@keyframes qc-map-spin {
    to { transform: rotate(360deg); }
}

.service-region__loader-text {
    margin-top: 1rem;
    font-weight: 500;
    color: #4b5563;
}

.qc-map-fallback {
    height: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 2rem;
    text-align: center;
    background-color: #eef0f3;
    color: #4b5563;
}

.qc-map-fallback__icon {
    font-size: 2.5rem;
    color: #9d4edd;
}

.qc-map-fallback__text {
    margin: 0;
    max-width: 34ch;
    font-weight: 500;
}

.county-map-label {
    background-color: rgba(106, 61, 232, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    text-align: center;
}

.county-map-label:hover {
    background-color: rgba(88, 49, 194, 1);
    transform: scale(1.05);
}

/* MapLibre GL's own popup chrome -- overridden to match this app's visual style. */
.maplibregl-popup-content {
    padding: 10px 12px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.maplibregl-popup-close-button {
    width: 24px;
    height: 24px;
    font-size: 16px;
    color: #4b5563;
}

.quickcare-infowindow {
    font-size: 14px;
    line-height: 1.5;
    max-width: 260px;
    color: #374151;
}

.quickcare-infowindow__title {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #6a3de8;
}

.quickcare-infowindow__item {
    margin-bottom: 4px;
    font-size: 0.95em;
}

.quickcare-infowindow__item:last-child {
    margin-bottom: 0;
}

.quickcare-infowindow__label {
    font-weight: 600;
    color: #4b5563;
    margin-right: 4px;
}

.quickcare-infowindow__value--active {
    color: #16a34a;
    font-weight: 500;
}

/* Tippy.js popover theme override, used by the county-info tooltips on this map. */
.tippy-box[data-theme~="light"] {
    background-color: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.tippy-box[data-theme~="light"][data-placement^="top"] > .tippy-arrow::before {
    border-top-color: #fff;
}

.tippy-box[data-theme~="light"] > .tippy-content {
    padding: 6px 10px;
}
