/* ==========================================================================
   GCS Maps - MapLibre GL JS Styles
   ========================================================================== */

/* Container */
.gcs-map {
    width: 100%;
    min-height: 280px;
    background: #0a0a0a;
    position: relative;
}

/* Desaturate tiles to monochrome dark; keep markers/popups vivid */
.gcs-map .maplibregl-canvas-container canvas {
    filter: saturate(0) brightness(0.35);
}

.gcs-map .maplibregl-marker,
.gcs-map .maplibregl-popup,
.gcs-map .maplibregl-ctrl {
    filter: none;
}

/* Type-specific default heights */
.gcs-map[data-map-type="us-overview"] {
    height: 360px;
}

.gcs-map[data-map-type="coverage"] {
    height: 480px;
}

.gcs-map[data-map-type="state-detail"] {
    aspect-ratio: 4 / 5;
    height: auto;
}

.gcs-map[data-map-type="delivery-radius"] {
    height: 480px;
}

/* ---- Custom Markers ---- */
.gcs-marker {
    width: 12px;
    height: 12px;
    background: #C41820;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(196, 24, 32, 0.5);
    transition: transform 0.15s ease;
}

.gcs-marker:hover {
    transform: scale(1.3);
    z-index: 10;
}

.gcs-marker--sm {
    width: 8px;
    height: 8px;
}

.gcs-marker--lg {
    width: 16px;
    height: 16px;
}

.gcs-marker--gray {
    background: #888;
    border-color: #aaa;
    box-shadow: 0 0 4px rgba(136, 136, 136, 0.3);
    cursor: default;
}

/* HQ marker with pulsing ring */
.gcs-marker--hq {
    width: 16px;
    height: 16px;
    background: #C41820;
    border: 2px solid #fff;
    box-shadow: 0 0 8px rgba(196, 24, 32, 0.6);
    position: relative;
}

.gcs-marker--hq::before,
.gcs-marker--hq::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1.5px solid #C41820;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.gcs-marker--hq::before {
    width: 28px;
    height: 28px;
    opacity: 0.5;
}

.gcs-marker--hq::after {
    width: 40px;
    height: 40px;
    opacity: 0.25;
    animation: gcs-pulse 2s ease-out infinite;
}

@keyframes gcs-pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.25; }
    70% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

/* HQ label */
.gcs-marker-label {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: 'Barlow', sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* City center pin (delivery radius) */
.gcs-marker--center {
    width: 14px;
    height: 14px;
    background: #C41820;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(196, 24, 32, 0.6);
}

/* ---- Popups ---- */
.maplibregl-popup-content {
    background: #111 !important;
    color: #fff !important;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid #333;
}

.maplibregl-popup-tip {
    border-top-color: #111 !important;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    border-top-color: #111 !important;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip {
    border-bottom-color: #111 !important;
}

.gcs-popup-name {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.gcs-popup-meta {
    font-size: 11px;
    color: #aaa;
    font-weight: 500;
    margin-top: 2px;
}

/* ---- Attribution (required by MapLibre) ---- */
.maplibregl-ctrl-attrib {
    font-size: 10px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    color: #888 !important;
}

.maplibregl-ctrl-attrib a {
    color: #aaa !important;
}

/* ---- Navigation Control ---- */
.maplibregl-ctrl-group {
    background: #1a1a1a !important;
    border: 1px solid #333 !important;
    border-radius: 0 !important;
}

.maplibregl-ctrl-group button {
    background-color: #1a1a1a !important;
    border-color: #333 !important;
}

.maplibregl-ctrl-group button + button {
    border-top-color: #333 !important;
}

.maplibregl-ctrl-group button:hover {
    background-color: #2a2a2a !important;
}

/* Invert the default icons to white */
.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
    filter: invert(1);
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
    .gcs-map[data-map-type="coverage"] {
        height: 400px;
    }
}

@media (max-width: 720px) {
    .gcs-map[data-map-type="us-overview"] {
        height: 280px;
    }

    .gcs-map[data-map-type="coverage"] {
        height: 320px;
    }

    .gcs-map[data-map-type="delivery-radius"] {
        height: 360px;
    }
}

@media (max-width: 560px) {
    .gcs-map[data-map-type="us-overview"] {
        height: 240px;
    }

    .gcs-map[data-map-type="coverage"] {
        height: 280px;
    }

    .gcs-map[data-map-type="delivery-radius"] {
        height: 300px;
    }
}
