/* Prague Transit Live – palette and fonts shared with petrmikolas.cz (docs/PROJEKT.md, section 7). */
:root {
    color-scheme: dark;

    --bg: #0a0c10;
    --surface: #12151d;
    --surface-glass: rgba(18, 21, 29, 0.88);
    --border: #232936;
    --border-strong: #3a4152;
    --text: #e7e9f0;
    --muted: #9aa1b4;
    --blue: #7aa2f7;
    --amber: #f2b84b;
    --green: #9ece6a;
    --red: #f7768e;

    --delay-on-time: #7dcfff;
    --delay-slight: #f2b84b;
    --delay-late: #f7768e;
    --delay-unknown: #9aa1b4;

    --panel-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);

    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
}

/* Light theme: chosen in the app (data-theme="light"), or by the system when nothing was chosen.
   Delay colours are deeper so dots stay readable on the light map – keep in sync with PALETTES in LiveMap.razor.js. */
:root[data-theme="light"] {
    color-scheme: light;

    --bg: #f2f3f0;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.92);
    --border: #e1e5ec;
    --border-strong: #c3c9d4;
    --text: #1b1f2a;
    --muted: #5d6577;
    --blue: #2f6fe4;
    --amber: #b97a10;
    --green: #3a9a3a;
    --red: #d23f5b;

    --delay-on-time: #0a8fd0;
    --delay-slight: #df9200;
    --delay-late: #e0455f;
    --delay-unknown: #8a93a6;

    --panel-shadow: 0 10px 30px rgba(16, 24, 40, 0.14);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;

        --bg: #f2f3f0;
        --surface: #ffffff;
        --surface-glass: rgba(255, 255, 255, 0.92);
        --border: #e1e5ec;
        --border-strong: #c3c9d4;
        --text: #1b1f2a;
        --muted: #5d6577;
        --blue: #2f6fe4;
        --amber: #b97a10;
        --green: #3a9a3a;
        --red: #d23f5b;

        --delay-on-time: #0a8fd0;
        --delay-slight: #df9200;
        --delay-late: #e0455f;
        --delay-unknown: #8a93a6;

        --panel-shadow: 0 10px 30px rgba(16, 24, 40, 0.14);
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--blue);
}

h1:focus {
    outline: none;
}

/* MapLibre popup (rendered outside Blazor's scoped CSS) */
.ptl-popup .maplibregl-popup-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    font-family: var(--font-sans);
    font-size: 13px;
}

.ptl-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--border); }
.ptl-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--border); }
.ptl-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--border); }
.ptl-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--border); }

.ptl-popup-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.ptl-popup-line {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 16px;
}

.ptl-popup-type,
.ptl-popup-row span:first-child {
    color: var(--muted);
}

.ptl-popup-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    line-height: 1.6;
}

.ptl-popup-row span:last-child {
    text-align: right;
}

.delay-on-time { color: var(--delay-on-time); font-family: var(--font-mono); }
.delay-slight { color: var(--delay-slight); font-family: var(--font-mono); }
.delay-late { color: var(--delay-late); font-family: var(--font-mono); }
.delay-unknown { color: var(--delay-unknown); }

.maplibregl-ctrl-attrib {
    font-family: var(--font-sans);
}

.blazor-error-boundary {
    background: var(--red);
    padding: 1rem;
    color: var(--bg);
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }
