/* Blue parking theme */
:root {
    --c-primary:    #2563eb;
    --c-primary-dk: #1d4ed8;
    --c-primary-lt: #eff6ff;
}

/* ── Page header ─────────────────────────────────────────────── */
#page-header {
    background: var(--c-primary);
    color: #fff;
    padding: 10px 14px;
    margin: -12px -12px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#back-btn {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 1.3rem;
    line-height: 1;
    flex: 0 0 auto;
    padding: 2px 4px;
    transition: color 0.15s;
}
#back-btn:hover { color: #fff; }

#page-title {
    font-size: var(--fs-base);
    font-weight: 700;
    flex: 1;
}

/* ── City select + type toggle ───────────────────────────────── */
#city-select {
    padding: 8px 10px;
    border: 1.5px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-bg);
    color: var(--c-text);
    font-size: var(--fs-sm);
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}
#city-select:focus { border-color: var(--c-primary); }

/* ── Availability numbers in table ───────────────────────────── */
.spaces-num {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: var(--fs-sm);
}
.spaces-ok   { color: #16a34a; }
.spaces-soon { color: #d97706; }
.spaces-full { color: #dc2626; }
.spaces-off  { color: var(--c-muted); }

/* ── Status badge ────────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    white-space: nowrap;
}
.status-ok   { background: #dcfce7; color: #15803d; }
.status-soon { background: #fef3c7; color: #92400e; }
.status-full { background: #fee2e2; color: #991b1b; }
.status-off  { background: #f1f5f9; color: #64748b; }


/* ── Lot detail header ───────────────────────────────────────── */
#lot-header {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}
.lot-name {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin-bottom: 4px;
}
.lot-address {
    font-size: var(--fs-sm);
    color: var(--c-muted);
    margin-bottom: 8px;
}
.lot-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.map-link {
    font-size: var(--fs-xs);
    color: var(--c-primary-dk);
    text-decoration: none;
}
.map-link:hover { text-decoration: underline; }

/* ── Availability panel ──────────────────────────────────────── */
#availability-panel {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.avail-row { margin-bottom: 16px; }
.avail-row:last-child { margin-bottom: 0; }

.avail-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}
.avail-label-text {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-muted);
}
.avail-num {
    font-size: var(--fs-lg);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.avail-bar-wrap {
    height: 10px;
    background: var(--c-border);
    border-radius: 5px;
    overflow: hidden;
}
.avail-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease, background 0.4s ease;
}
.avail-bar-ok   { background: #16a34a; }
.avail-bar-soon { background: #d97706; }
.avail-bar-full { background: #dc2626; }
.avail-bar-off  { background: #94a3b8; }

.avail-capacity-note {
    font-size: var(--fs-xs);
    color: var(--c-muted);
    text-align: right;
    margin-top: 10px;
}

/* ── Special spaces grid ─────────────────────────────────────── */
.special-spaces {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.special-card {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.special-label {
    font-size: var(--fs-2xs);
    color: var(--c-muted);
}
.special-val {
    font-size: var(--fs-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ── Fare / info panel ───────────────────────────────────────── */
.info-panel {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}
.info-panel-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-muted);
    margin-bottom: 6px;
}
.info-panel-body {
    font-size: var(--fs-sm);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ── Updated timestamp ───────────────────────────────────────── */
.eta-updated {
    font-size: var(--fs-xs);
    color: var(--c-muted);
    text-align: right;
    margin-bottom: 6px;
}

/* ── Footer ──────────────────────────────────────────────────── */
#footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    padding: 8px 14px;
    display: flex;
    justify-content: flex-end;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
#footer-actions { display: flex; gap: 8px; }
body:has(#footer) { padding-bottom: 68px; }

.footerbtn {
    width: 40px; height: 40px;
    border-radius: 50%;
    padding: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-bg);
    color: var(--c-text);
    border: 1.5px solid var(--c-border);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.footerbtn:hover {
    background: var(--c-primary-lt);
    border-color: var(--c-primary);
    color: var(--c-primary-dk);
}

/* ── Map page ────────────────────────────────────────────────── */
body.map-page {
    margin: 0; padding: 0;
    height: 100dvh; overflow: hidden;
    display: flex; flex-direction: column;
}
body.map-page #page-header { margin: 0; flex: 0 0 auto; }
#map-wrap { flex: 1; position: relative; min-height: 0; }
#map { width: 100%; height: 100%; }

.map-legend {
    background: rgba(255,255,255,0.93);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    line-height: 1.9;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.map-legend .lg-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.map-legend .lg-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; flex: 0 0 auto;
}

#map-header-btns {
    display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
}
.map-hdr-btn {
    padding: 4px 9px;
    border: 1.5px solid rgba(255,255,255,0.55);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: var(--fs-base);
    line-height: 1;
}
.map-hdr-btn:hover  { border-color: #fff; }
.map-hdr-btn:active { background: rgba(255,255,255,0.18); }

#countdown { font-size: var(--fs-xs); color: rgba(255,255,255,0.75); }

#map-status {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255,255,255,0.92);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: var(--fs-sm);
    color: var(--c-muted);
    pointer-events: none;
    display: none;
}
#map-status:not(:empty) { display: block; }

/* ── Parking popup ───────────────────────────────────────────── */
.park-popup { font-size: 0.8rem; line-height: 1.7; min-width: 150px; }
.park-popup strong { display: block; margin-bottom: 2px; }
.park-popup a { color: #1d4ed8; font-weight: 600; text-decoration: none; }
.park-popup a:hover { text-decoration: underline; }
