@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Dark Theme (Default) */
    --bg-color: #1a1d21;
    --text-color: #e0e0e0;
    --panel-bg: rgba(30, 30, 30, 0.9);
    --panel-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(30, 30, 35, 0.85);
    --popup-bg: #1e2229;
    --popup-card-bg: #262b33;
    --accent-color: #3498db;
}

/* Light theme — applied by js/theme.js setting <html data-theme="light">.
   An inline script in index.html sets the attribute before any paint, so
   there is no flash of the wrong theme on load. */
:root[data-theme='light'] {
    --bg-color: #f3f4f6;
    --text-color: #1a1d21;
    --panel-bg: rgba(255, 255, 255, 0.92);
    --panel-border: rgba(0, 0, 0, 0.12);
    --input-bg: rgba(255, 255, 255, 0.9);
    --popup-bg: #ffffff;
    --popup-card-bg: #f3f4f6;
    --accent-color: #2470b3;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition:
        background-color 0.4s ease,
        color 0.4s ease;
}

/* The <main> wrapper (added for a11y landmark in PR #95) sits between
   <body> (height: 100%) and #map (height: 100%). Without an explicit
   height it falls back to `auto`, which collapses to its content height
   and starves #map of the full viewport — the map ends up as a thin
   strip at the top of the page. Force it to fill the viewport so the
   percentage chain stays unbroken. */
main {
    width: 100%;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
}

/* Visually hidden, but still announced by screen readers (e.g. the page h1). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* A single, clearly visible keyboard-focus indicator for every control.
   :focus-visible keeps it for keyboard users without showing a ring on
   plain mouse clicks. */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* The Carto basemap (dark_all or light_all, swapped at runtime by
   js/theme.js) already matches the active theme. In dark mode we still
   bump brightness slightly because the native dark_all is very dark on
   mobile screens; light mode keeps the tiles untouched. */
.maplibregl-canvas {
    filter: brightness(1.15);
}
:root[data-theme='light'] .maplibregl-canvas {
    filter: none;
}

/* Search Box */
.search-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    /* Above map */
    width: 350px;
    max-width: calc(100vw - 85px);
    /* Ensure 65px gap for the 40px icon button + 20px right margin */
}

#search-input {
    width: 100%;
    padding: 12px 15px;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Snow-removal alert banner */
.snow-alert {
    position: absolute;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
    padding: 10px 16px;
    background: rgba(30, 40, 52, 0.95);
    border: 1px solid #5dade2;
    border-left: 4px solid #5dade2;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.snow-alert.hidden {
    display: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s;
    color: #a0a0a0;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Top Controls */
.top-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.icon-btn:hover {
    transform: scale(1.05);
    background: var(--input-bg);
}

#sidebar-toggle {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: 1000;
}

/* Alerts bell — mirrors the sidebar toggle, bottom-right corner. */
#alerts-bell {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 1000;
}

/* Red dot badge on the bell when a reminder is armed. */
.alerts-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e74c3c;
    border: 2px solid var(--panel-bg);
}
.alerts-badge[hidden] {
    display: none;
}

/* Dropdown panel anchored above the bell. */
.alerts-panel {
    position: absolute;
    bottom: 80px;
    right: 20px;
    z-index: 1001;
    width: 260px;
    max-width: 80%;
    background: var(--panel-bg);
    color: var(--text-color);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 14px;
    backdrop-filter: blur(15px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.alerts-panel[hidden] {
    display: none;
}
.alerts-empty {
    margin: 0;
    font-size: 13px;
    color: #888;
    text-align: center;
}
.alerts-item-street {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
}
.alerts-item-line {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 4px;
}
.alerts-item-notify {
    color: #888;
}
.alerts-item .btn-small {
    margin-top: 10px;
    background: #e74c3c;
}

/* Sidebar Control Panel */
.sidebar {
    position: absolute;
    bottom: 80px;
    left: 20px;
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 12px;
    z-index: 1000;
    color: var(--text-color);
    width: 280px;
    max-width: 80%;
    /* Keep the panel inside the viewport so mobile users can always reach the
       time-adjustment buttons at the top. `dvh` follows the dynamic viewport
       (the address bar collapsing) — `vh` is the fallback for older browsers.
       The 130 px gap below leaves room for the toggle button (60 px) plus a
       comfortable margin from the screen edge. */
    max-height: calc(100vh - 130px);
    max-height: calc(100dvh - 130px);
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(15px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar.collapsed {
    transform: translateX(-150%) scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.filter-section h2 {
    margin: 0 0 5px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
}

.section-desc {
    margin: 0 0 10px 0;
    font-size: 11px;
    color: #888;
}

.time-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-adjusters {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.adjust-btn {
    flex: 1;
    padding: 6px 0;
    font-size: 11px;
}

#time-filter {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
    background: var(--input-bg);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.btn-small {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background 0.2s;
    /* Long labels (FR "Enregistrer la position actuelle" etc.) must wrap
       inside the panel instead of overflowing it. */
    white-space: normal;
    line-height: 1.3;
    word-break: break-word;
}

.btn-small:hover {
    filter: brightness(1.1);
}

.filter-status-text {
    margin-top: 5px;
    font-size: 11px;
    color: #2ecc71;
    font-weight: 600;
}

/* Favoris */
#btn-save-favorite.saving {
    opacity: 0.6;
    cursor: progress;
}

#favorites-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.favorite-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.favorite-go {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    padding: 8px 10px;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition:
        background 0.2s,
        color 0.2s;
}

.favorite-go::before {
    content: '📍 ';
}

.favorite-go:hover {
    background: rgba(52, 152, 219, 0.15);
    color: var(--accent-color);
}

.favorite-del {
    flex: 0 0 32px;
    background: transparent;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s;
}

.favorite-del:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.toggle-row {
    display: flex;
    align-items: center;
    margin: 10px 0;
    cursor: pointer;
}

.toggle-label {
    font-size: 13px;
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.dot {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.purple {
    background-color: #9b59b6;
}

.dot.blue {
    background-color: #3498db;
}

.dot.red {
    background-color: #e74c3c;
}

.dot.green {
    background-color: #2ecc71;
}

.dot.orange {
    background-color: #e67e22;
}

/* Premium Popup Styles */
.maplibregl-popup {
    z-index: 3000 !important;
}

.maplibregl-popup-content {
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: var(--popup-bg);
    border: 1px solid var(--panel-border);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    width: 320px;
    max-width: 90vw;
    /* Hard limit for narrow mobile screens */
}

.maplibregl-popup-close-button {
    color: var(--text-color);
    right: 5px;
    top: 5px;
    font-size: 18px;
}

.maplibregl-popup-close-button:hover {
    background: transparent;
    opacity: 0.7;
}

.maplibregl-popup-tip {
    border-top-color: var(--popup-bg);
}

/* Popup Structure */
.popup-container {
    display: flex;
    flex-direction: row;
}

.popup-accent {
    width: 6px;
    background: #e74c3c;
    /* Default Red */
    flex-shrink: 0;
}

.popup-accent.permitted {
    background: #2ecc71;
}

.popup-accent.permit-req {
    background: #e67e22;
}

.popup-main {
    padding: 20px 20px 20px 15px;
    flex-grow: 1;
    color: var(--text-color);
}

.popup-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.popup-header {
    font-size: 16px;
    font-weight: 700;
    flex-grow: 1;
}

.popup-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.popup-status.permitted {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.3);
}

.popup-status.permit-req {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.1);
    border-color: rgba(230, 126, 34, 0.3);
}

.popup-section-title {
    font-size: 10px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    margin-top: 10px;
}

.popup-card {
    background: var(--popup-card-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    position: relative;
}

.popup-description {
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.popup-active {
    font-size: 11px;
    color: #e67e22;
    /* Orange for activity */
    margin-top: 4px;
}

.popup-image-container {
    text-align: center;
    margin: 10px 0;
    min-height: 50px;
    display: flex;
    justify-content: center;
}

.popup-sign-image {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid var(--panel-border);
    background: var(--popup-bg);
}

.code-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 9px;
    color: #888;
    padding: 4px;
}

/* Forecast bar inside the sign popup — each segment widths the share of
   the window (24 h for daily rules, 168 h for weekly) that share the
   same (allowed / permit-required / forbidden) status. */
.popup-forecast-bar {
    display: flex;
    height: 10px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    margin: 4px 0 6px;
}

.popup-forecast-seg {
    height: 100%;
}

.popup-forecast-seg.permitted {
    background: #2ecc71;
}

.popup-forecast-seg.permit-req {
    background: #e67e22;
}

.popup-forecast-seg.forbidden {
    background: #e74c3c;
}

/* min-width on non-allowed segments — on a 7-day bar a 1-hour ban is
   ~0.6 % of the width, which collapses to a sub-pixel sliver and is
   effectively invisible. Pinning a 3 px floor keeps the segment
   legible; the permitted (green) neighbours flex-shrink to absorb the
   tiny overflow, and the bar's overflow:hidden trims anything past
   100 %. */
.popup-forecast-seg.forbidden,
.popup-forecast-seg.permit-req {
    min-width: 3px;
}

/* "maintenant" / "+7j" anchors above the 7-day forecast bar. Moving
   them up off the bar's footer gave the day-letter ticks below a row
   of their own — no more left-edge collision with "maintenant", and
   more breathing room between bar and labels. */
.popup-forecast-anchors {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    margin-bottom: 2px;
}

/* Day-of-week tick row under the 7-day bar. Position:relative so the
   absolute-positioned ticks anchor against it; height + margin-top
   give visual breathing room between the coloured bar and the
   letters (the previous layout felt cramped). */
.popup-forecast-legend {
    position: relative;
    height: 14px;
    margin-top: 6px;
    margin-bottom: 10px;
}

/* Legacy 24 h inline legend ("maintenant" on the left, "+24h" on the
   right, single row under the bar). Daily-rule popups still use this
   layout — keeping the original flex distribution preserves the
   pre-change visual. */
.popup-forecast-legend--inline {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    height: auto;
    margin-top: 0;
}

/* Day-of-week ticks: centred on their `left:X%` position by default.
   buildDayLegend tags edge ticks with --flush-left / --flush-right
   modifier classes (instead of inline transform styles), so CSP
   `style-src` no longer needs 'unsafe-inline'. */
.popup-forecast-tick {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    color: #aaa;
}
.popup-forecast-tick--flush-left {
    transform: none;
}
.popup-forecast-tick--flush-right {
    transform: translateX(-100%);
}

/* Paid-parking popup accent variants. Used both for the accent stripe
   on the left of the popup and for the ID badge colour. Replaces the
   inline `style="background-color: ${accent}"` that was forcing CSP
   `style-src` to keep 'unsafe-inline'. */
.popup-accent--paid-off {
    background: #3498db;
}
.popup-accent--paid-on {
    background: #9b59b6;
}
/* When the accent class is applied to the ID badge text, override
   `background` and apply the same hue as `color` so the number itself
   takes the variant colour. */
.popup-paid-id {
    font-size: 16px;
    font-weight: bold;
    background: transparent !important;
}
.popup-paid-id.popup-accent--paid-off {
    color: #3498db;
}
.popup-paid-id.popup-accent--paid-on {
    color: #9b59b6;
}

/* Layout helpers for the paid-popup card content — previously inline. */
.popup-paid-id-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
.popup-description--bordered {
    border-top: 1px solid var(--panel-border);
    padding-top: 5px;
}
/* The arrow / FLECHE_PAN detail-row gets a top margin to detach it
   from the description card above. */
.popup-detail-row--first {
    margin-top: 8px;
}

.btn-streetview {
    display: block;
    text-align: center;
    background: #4285f4;
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 15px;
    transition: background 0.2s;
}

.btn-streetview:hover {
    background: #3367d6;
    color: white;
}

/* "Directions" — universal link to Google/Apple Maps. Sits below the
   Street View button in the sign popup; same shape, Maps-green color. */
.btn-directions {
    display: block;
    text-align: center;
    background: #34a853;
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    transition: background 0.2s;
}

.btn-directions:hover {
    background: #2c8e46;
    color: white;
}

/* "Where is my car?" — orange disc with a 🚗 emoji centred. Pinned at the
   GPS location the user marked from the sidebar. */
.car-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e67e22;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.car-marker::before {
    content: '🚗';
}

/* "A new version is available — Reload" — discreet pill at the bottom,
   theme-aware via the existing CSS variables. Surfaced by
   js/updateToast.js when the service worker has a newer version waiting. */
.update-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    background: var(--panel-bg);
    color: var(--text-color);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    font-size: 13px;
    max-width: calc(100vw - 40px);
}

.update-toast[hidden] {
    display: none;
}

.update-toast .btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Engagement nudges: PWA-install prompt after the user has actually used the
   app (3 popups opened) and "share GaréSûr" after a parking alert fires.
   Same theme-aware pill as .update-toast but with two stacked lines + two
   buttons. Surfaced by js/installPrompt.js and js/shareNudge.js. */
.nudge-toast {
    position: fixed;
    bottom: 80px; /* sits above the alerts bell, below the update toast */
    left: 50%;
    transform: translateX(-50%);
    z-index: 3900;
    background: var(--panel-bg);
    color: var(--text-color);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    font-size: 13px;
    max-width: calc(100vw - 32px);
    width: 320px;
}

.nudge-toast__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.35;
}

.nudge-toast__text strong {
    font-size: 14px;
}

.nudge-toast__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.nudge-toast .btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.nudge-toast .btn-primary {
    background: var(--accent, #2ecc71);
    color: #1a1d21;
    border: none;
    font-weight: 600;
}

.nudge-toast .btn-primary:hover {
    filter: brightness(1.1);
}

/* "Me prévenir" parking-timer button inside sign popups */
.btn-timer {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    background: #e67e22;
    color: #1a1d21;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-timer:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-timer:disabled {
    cursor: default;
    opacity: 0.85;
}

.sweeping-badge {
    font-size: 14px;
    background: rgba(255, 165, 0, 0.2);
    border: 1px solid rgba(255, 165, 0, 0.5);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    align-items: center;
    justify-content: center;
    cursor: help;
    flex-shrink: 0;
}

/* Map Search UI Elements */
#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    display: none;
    z-index: 101;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Rendered as <button> so each result is keyboard-focusable (Tab + Enter);
   the rule resets the native button look back to a flat list row. */
.search-result-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--input-bg);
    color: var(--accent-color);
}

/* Bouncing Red Map Pin */
.search-marker-container {
    width: 28px;
    height: 28px;
    position: relative;
    z-index: 1000;
}

.search-marker {
    width: 100%;
    height: 100%;
    background-color: #e74c3c;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    animation: bounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.search-marker::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes bounce {
    0% {
        transform: translateY(-30px) rotate(-45deg);
        opacity: 0;
    }

    100% {
        transform: translateY(0) rotate(-45deg);
        opacity: 1;
    }
}

/* Modal Overlay & Content */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.modal-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 0;
    color: var(--accent-color);
    text-align: center;
}

.modal-content p {
    font-size: 14px;
    line-height: 1.5;
}

/* Buy Me A Coffee Button */
.bmc-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: #ffdd00;
    color: #000000;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    border-radius: 6px;
    padding: 10px 15px;
    text-decoration: none;
    transition:
        transform 0.2s,
        filter 0.2s;
    box-sizing: border-box;
}

.bmc-btn:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* Inline sidebar nav linking out to the static content pages
   (guide.html / about.html / contact.html / privacy.html). Flex with
   wrap so the four links break onto a second line on narrow panels
   instead of overflowing horizontally. */
.footer-nav {
    margin: 0 0 10px 0;
    font-size: 11px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 6px;
}

.footer-nav a {
    color: #aaa;
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--accent-color);
}

/* Deep-dive articles block under the main footer-nav. Same compact pill
   style; the h3 header gives it a clear separation from the standard
   pages above it. */
.footer-articles {
    margin: 0 0 10px 0;
}

.footer-articles h3 {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 6px 0;
    text-align: center;
}

.footer-articles-nav {
    font-size: 11px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 6px;
}

.footer-articles-nav a {
    color: #aaa;
    text-decoration: none;
}

.footer-articles-nav a:hover {
    color: var(--accent-color);
}

/* ─── Sidebar utility classes ──────────────────────────────────────────
   The sidebar buttons + status zones used to carry a lot of inline
   `style="…"` attributes. Removing those was a prerequisite for
   dropping 'unsafe-inline' from the CSP style-src. Each class below
   is named for the visual / contextual role it plays. */

/* The reserved-space pattern for status text rows ("favorites-status",
   "car-status") so the layout doesn't jump when the message appears /
   disappears. */
.filter-status-text--reserved {
    min-height: 14px;
}

/* Full-width button variant — applied to every sidebar action so the
   buttons stack cleanly down the panel. */
.btn-small--block {
    width: 100%;
}
/* Stacked-button spacing — used on the contiguous run of sidebar
   buttons (install, share, disclaimer, theme, lang). */
.btn-small--stacked {
    margin-bottom: 10px;
}
/* Small clear / dismiss button under the primary one (car-clear). */
.btn-small--tiny-followup {
    font-size: 11px;
    margin-top: 5px;
}
/* Cancel / dismiss button colour (#555 grey). */
.btn-small--neutral {
    background: #555;
}
/* Even-darker grey for the theme / language toggles where the action
   is "switch mode" rather than primary CTA. */
.btn-small--mode {
    background: #444;
}
/* Orange action — the "mark my car" button. */
.btn-small--orange {
    background: #e67e22;
}
/* Install-the-PWA blue. */
.btn-small--install {
    background: #2470b3;
}
/* Share CTA — bright green with dark text, used for "Partager GaréSûr". */
.btn-small--share {
    background: #2ecc71;
    color: #1a1d21;
    font-weight: bold;
}
/* SVG icons embedded inside a button — vertical alignment + spacing. */
.btn-icon-inline {
    vertical-align: middle;
    margin-right: 5px;
}

/* The footer block at the bottom of the sidebar (attribution + last-sync
   line). Previously a multi-line inline style on the .filter-section. */
.filter-section--footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--panel-border);
    font-size: 11px;
    color: #888;
}
/* Tight paragraph spacing inside the footer block. */
.filter-section--footer p {
    margin: 0 0 5px 0;
}
/* The "Dernière synchronisation locale" line — coloured green by
   default, switched to red by app.js when the ETL log status is
   `failed_*` (the JS sets el.style.color directly, which CSP
   allows). */
.data-update-status {
    margin: 0;
    margin-bottom: 15px;
    color: #2ecc71;
}

/* Bulleted list inside the legal disclaimer modal + the onboarding
   modal — left-aligned, slightly muted, with a little inter-item
   gap. */
.modal-list {
    text-align: left;
    font-size: 13px;
    color: #ccc;
}
.modal-list--disclaimer li {
    margin-bottom: 5px;
}
.modal-list--onboarding li {
    margin-bottom: 8px;
}

/* The bold red disclaimer footer ("Vérifiez toujours la signalisation
   physique avant de quitter votre véhicule."). */
.legal-warning {
    color: #e74c3c;
    font-weight: bold;
    margin-top: 15px;
}

/* The "C'est parti" / "J'ai compris" close-modal buttons — same look as
   the rest of the .btn-small but with a slight font bump for emphasis. */
.btn-small--modal-close {
    width: 100%;
    margin-top: 10px;
    font-size: 14px;
}
