/*-------------------------------------------------------------------------------------------------
 * GPS locatie: één scherm, gemaakt voor de telefoon. Kleuren als variabelen zodat het donkere
 * thema van het toestel gevolgd wordt.
 *-----------------------------------------------------------------------------------------------*/
:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --text: #1a1f29;
    --muted: #5d6675;
    --line: #dde2ea;
    --accent: #1b6ec2;
    --accent-text: #ffffff;
    --danger: #c0392b;
    --message-bg: #fff6df;
    --message-text: #6b4a0d;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #11151c;
        --surface: #1b212b;
        --text: #e8ecf2;
        --muted: #9aa4b2;
        --line: #2c3442;
        --accent: #4c9be8;
        --accent-text: #0b1220;
        --danger: #e5675a;
        --message-bg: #3a2f17;
        --message-text: #f3dca7;
        color-scheme: dark;
    }
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px 16px;
    background: var(--accent);
    color: var(--accent-text);
}

    .bar h1 {
        margin: 0;
        font-size: 1.15rem;
        font-weight: 600;
    }

.status {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

    .status.searching::before, .status.active::before {
        content: "";
        display: inline-block;
        width: 8px;
        height: 8px;
        margin-right: 6px;
        border-radius: 50%;
        background: #ffd166;
        vertical-align: 1px;
    }

    .status.active::before {
        background: #7ee2a8;
    }

.content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom)) 16px;
}

.message {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--message-bg);
    color: var(--message-text);
    font-size: 0.9rem;
}

.toggle {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
}

    .toggle.stop {
        background: var(--danger);
    }

    .toggle:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

.card {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.coords {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

    .coords > div {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

.label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.value {
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.dms {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin: 14px 0 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
}

    .details dt {
        color: var(--muted);
    }

    .details dd {
        margin: 0;
        font-variant-numeric: tabular-nums;
    }

.maplink {
    display: inline-block;
    margin-top: 12px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.map {
    height: 50vh;
    min-height: 280px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
}

/* --- standaard Blazor: foutbalk en laadcirkel ------------------------------------------------- */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: var(--line);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--accent);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Laden");
    }
