/* YouBike orange theme */
:root {
    --c-primary:    #f97316;
    --c-primary-dk: #ea580c;
    --c-primary-lt: #fff7ed;
}

/* ── 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 toggle ─────────────────────────────────────────────── */
.city-toggle {
    display: flex;
    border: 1.5px solid var(--c-border);
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
    margin-bottom: 4px;
}

.city-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.city-btn input[type=radio] { display: none; }

.city-btn span {
    padding: 7px 14px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-muted);
    background: var(--c-bg);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.city-btn input[type=radio]:checked + span {
    background: var(--c-primary);
    color: #fff;
}

/* ── Availability counts in table ────────────────────────────── */
.avail-count {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: var(--fs-sm);
}

.avail-high { color: #16a34a; }
.avail-mid  { color: #d97706; }
.avail-low  { color: #dc2626; }
.avail-none { color: var(--c-muted); }

/* ── Service type badge ──────────────────────────────────────── */
.service-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    white-space: nowrap;
}

.service-badge-1 { background: #fce7f3; color: #9d174d; }
.service-badge-2 { background: #fef3c7; color: #92400e; }

/* ── Station header (station.html) ───────────────────────────── */
#station-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;
}

.station-name {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--c-text);
}

.station-address {
    font-size: var(--fs-sm);
    color: var(--c-muted);
    margin-bottom: 8px;
}

.station-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; }

.station-closed-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    font-size: var(--fs-xs);
    font-weight: 600;
}

/* ── Availability panel (station.html) ───────────────────────── */
#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-high { background: #16a34a; }
.avail-bar-mid  { background: #d97706; }
.avail-bar-low  { background: #dc2626; }
.avail-bar-none { background: #94a3b8; }

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

/* ── 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);
}

/* ── Recent search chips ─────────────────────────────────────── */
#recent-searches {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: 20px;
    background: var(--c-surface);
    font-size: var(--fs-sm);
    color: var(--c-text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.recent-chip:hover {
    border-color: var(--c-primary);
    background: var(--c-primary-lt);
}

.chip-del {
    background: none;
    border: none;
    padding: 0 2px;
    margin: 0;
    color: var(--c-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.15s;
}
.chip-del:hover { color: #ef4444; }

/* ── Map page (full-screen layout when .map-page on body) ─────── */
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 ──────────────────────────────────────────────── */
.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 controls ─────────────────────────────────────── */
#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:active { background: rgba(255,255,255,0.18); }
.map-hdr-btn:hover  { border-color: #fff; }

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

/* ── Map page status overlay ─────────────────────────────────── */
#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; }

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