/* ==============================================
   LIVE PARKING AVAILABILITY MAP
   Midland International Air & Space Port
   ============================================== */

.parking-map-wrapper {
    margin: 1.5rem 0;
}

#parkingMap {
    height: 620px;
    width: 100%;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    background-color: var(--light-gray);
}

/* Keyboard focus indicator for polygons. Black contrasts with every fill;
   the existing white polygon stroke creates a two-tone edge over imagery. */
#parkingMap path.parking-lot-shape:focus {
    outline: 3px solid #000;
    outline-offset: 2px;
}

#parkingMap path.parking-lot-shape:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

#parkingMap path.parking-lot-shape {
    cursor: pointer;
}

/* Lot label riding on top of each polygon */
.parking-map-label {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--mid-gray);
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    color: var(--dark-gray);
    font-size: 0.75rem;
    line-height: 1.25;
    padding: 3px 6px;
    text-align: center;
    white-space: nowrap;
}

.parking-map-label::before {
    display: none; /* suppress Leaflet's tooltip arrow */
}

.parking-map-label .label-lot {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Pointer dwell indicator. It stays beside the pointer's starting position
   and participates in the maintained hover region. */
.parking-hover-progress {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: grid;
    height: 42px;
    justify-items: center;
    cursor: pointer;
    pointer-events: auto;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 42px;
    z-index: 675;
}

.parking-hover-progress[hidden] {
    display: none;
}

.parking-hover-progress svg {
    height: 38px;
    width: 38px;
}

.parking-hover-progress-track,
.parking-hover-progress-ring {
    fill: none;
    stroke-width: 4;
}

.parking-hover-progress-track {
    stroke: #d4d8dc;
}

.parking-hover-progress-ring {
    stroke: var(--primary-color);
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.parking-hover-progress.is-active .parking-hover-progress-ring {
    animation: parking-hover-progress var(--parking-hover-duration) linear forwards;
}

@keyframes parking-hover-progress {
    to {
        stroke-dashoffset: 0;
    }
}

/* Click / keyboard detail panel */
.parking-map-popup .leaflet-popup-content-wrapper {
    border-radius: 6px;
    box-shadow: var(--shadow-md);
}

.parking-map-popup .leaflet-popup-content {
    margin: 0.6rem 0.75rem;
}

.parking-map-popup .leaflet-popup-close-button:focus,
.parking-map-popup .leaflet-popup-close-button:focus-visible {
    border-radius: 2px;
    outline: 3px solid #000;
    outline-offset: 2px;
}

.parking-detail .detail-title {
    align-items: center;
    color: var(--primary-color);
    display: flex;
    font-size: 0.95rem;
    font-weight: 700;
    gap: 0.5rem;
    margin: 0 0 0.4rem;
}

.parking-detail .detail-badge {
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 8px;
    white-space: nowrap;
}

.parking-detail .detail-badge-open {
    background-color: #e6f4ea;
    color: #1a7f37;
}

.parking-detail .detail-badge-full {
    background-color: #fdeaec;
    color: #b02a37;
}

.parking-detail dl {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    row-gap: 0.15rem;
    margin: 0;
}

.parking-detail dt {
    color: var(--mid-gray);
    font-size: 0.78rem;
    font-weight: 500;
}

.parking-detail dd {
    color: var(--dark-gray);
    font-size: 0.78rem;
    font-weight: 600;
    margin: 0;
}

.parking-detail .detail-note {
    border-top: 1px solid var(--border-gray);
    color: var(--mid-gray);
    font-size: 0.72rem;
    margin: 0.45rem 0 0;
    padding-top: 0.35rem;
}

/* Legend + status bar beneath the map */
.parking-map-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.parking-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.parking-map-legend li {
    align-items: center;
    color: var(--dark-gray);
    display: flex;
    font-size: 0.85rem;
    gap: 0.4rem;
}

.parking-map-legend .legend-swatch {
    border: 1px solid var(--dark-gray);
    border-radius: 3px;
    display: inline-block;
    height: 14px;
    width: 14px;
}

.legend-swatch.legend-low { background-color: #28a745; }
.legend-swatch.legend-med { background-color: #ffc107; }
.legend-swatch.legend-high { background-color: #dc3545; }
.legend-swatch.legend-unknown { background-color: #6c757d; }

.parking-map-updated {
    color: var(--mid-gray);
    font-size: 0.85rem;
    margin: 0;
}

.parking-map-notice {
    background-color: var(--light-gray);
    border-left: 4px solid var(--mid-gray);
    border-radius: 4px;
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
}

.parking-map-basemap-notice {
    border-left-color: var(--primary-color);
}

@media (prefers-reduced-motion: reduce) {
    .parking-hover-progress.is-active .parking-hover-progress-ring {
        animation: none;
        stroke-dashoffset: 0;
    }
}

@media (max-width: 767.98px) {
    #parkingMap {
        height: 420px;
    }

    .parking-map-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
