/*
 * app-overrides.css — app-local CSS overrides for the standalone Interactive Tour.
 *
 * Loaded LAST in the cascade (see Components/App.razor) so it can correct
 * Radzen component defaults that the shared --ap-* token sheet does not
 * already remap. Uses exclusively --ap-* design tokens — no hardcoded colours.
 */

/* ── T-1: secondary / "Light" button contrast in dark mode ──────────────────
 *
 * The tour's secondary actions (TourNudge "Nicht jetzt", TourPopover
 * "Überspringen" + close) render with ButtonStyle.Light, which Radzen's
 * material-base.css styles as:
 *     .rz-button.rz-light { background-color: var(--rz-base-200);  // #eeeeee
 *                           color: var(--rz-text-color); }         // mapped to
 *                                                                  // --ap-text (#E0E0E0)
 * In dark mode that is light-grey text (#E0E0E0) on a light-grey fill
 * (#eeeeee) — a ~1.16:1 contrast ratio, failing WCAG AA. --rz-base-200 is a
 * fixed Radzen palette value the platform token sheet never remaps, so the
 * fill stays light while the text follows the dark-theme text colour.
 *
 * Remap the Light button onto the design-system surface tokens so foreground
 * and background always pair correctly:
 *   dark : #E0E0E0 on #2d2d2d  ≈ 10.9:1
 *   light: #212121 on #ffffff  ≈ 16:1
 * Both clear the AA 4.5:1 target. Fixing the shared .rz-light class (rather
 * than each button) covers every secondary/skip/dismiss button at once. */
.rz-button.rz-light {
    background-color: var(--ap-surface-elevated);
    color: var(--ap-text-primary);
    border: 1px solid var(--ap-border-default);
}

.rz-button.rz-light:hover {
    background-color: var(--ap-surface);
    color: var(--ap-text-primary);
}

:root {
    color-scheme: light;
    --tour-bg: var(--ap-bg-page);
    --tour-surface: var(--ap-bg-surface);
    --tour-surface-muted: var(--ap-bg-elevated);
    --tour-border: var(--ap-border-default);
    --tour-border-strong: var(--ap-border-strong, var(--ap-border-default));
    --tour-text: var(--ap-text-primary);
    --tour-muted: var(--ap-text-secondary);
    --tour-accent: var(--ap-action-primary-bg);
    --tour-accent-strong: var(--ap-action-primary-hover);
    --tour-teal: var(--ap-info);
    --tour-success: var(--ap-success);
    --tour-warning: var(--ap-warning);
    --tour-radius: var(--ap-radius-md);
    --tour-shadow: var(--ap-shadow-md);
    --tour-touch-target: var(--ap-touch-target-min);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--tour-bg);
    color: var(--tour-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

.tour-shell {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 247, 250, 0.98) 170px),
        var(--tour-bg);
}

.tour-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid var(--tour-border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.tour-brand,
.tour-topbar-actions,
.tour-topnav,
.tour-header-actions {
    display: inline-flex;
    align-items: center;
}

.tour-brand {
    gap: 12px;
    min-width: 0;
    text-decoration: none;
}

.tour-brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 6px;
    background: var(--tour-accent);
    color: #ffffff;
    font-weight: 800;
}

.tour-brand-copy {
    min-width: 0;
}

.tour-brand-title,
.tour-brand-subtitle {
    display: block;
    white-space: nowrap;
}

.tour-brand-title {
    font-size: 1rem;
    font-weight: 750;
}

.tour-brand-subtitle {
    color: var(--tour-muted);
    font-size: 0.78rem;
}

.tour-topnav {
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--tour-border);
    border-radius: 999px;
    background: var(--tour-surface-muted);
}

.tour-topnav a {
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--tour-muted);
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.tour-topnav a[aria-current="page"] {
    background: var(--tour-surface);
    color: var(--tour-text);
    box-shadow: 0 1px 4px rgba(23, 33, 43, 0.08);
}

.tour-topbar-actions {
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.tour-status,
.tour-chip {
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 750;
}

.tour-status--live {
    background: #e4f4eb;
    color: var(--tour-success);
}

.tour-platform-link,
.tour-primary-action {
    min-height: var(--tour-touch-target);
    border-radius: 6px;
    font-weight: 750;
    text-decoration: none;
}

.tour-platform-link {
    padding: 10px 14px;
    border: 1px solid var(--tour-border);
    background: var(--tour-surface);
    color: var(--tour-accent-strong);
}

.tour-main {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px 24px 40px;
}

.tour-page {
    display: grid;
    gap: 20px;
}

.tour-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.tour-eyebrow,
.tour-lede,
.tour-kpi-card span,
.tour-kpi-card small,
.tour-panel-header p,
.tour-helper-list li,
.tour-step-list p,
.tour-reference-list span {
    color: var(--tour-muted);
}

.tour-eyebrow {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(1.7rem, 2.3vw, 2.35rem);
    line-height: 1.15;
}

h2 {
    margin-bottom: 2px;
    font-size: 1.05rem;
}

h3 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.tour-lede {
    max-width: 760px;
    margin-bottom: 0;
}

.tour-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.tour-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--tour-accent-strong);
    background: var(--tour-accent);
    color: #ffffff;
    cursor: pointer;
}

.tour-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.tour-kpi-card,
.tour-panel,
.tour-reference-panel {
    border: 1px solid var(--tour-border);
    border-radius: var(--tour-radius);
    background: var(--tour-surface);
    box-shadow: var(--tour-shadow);
}

.tour-kpi-card {
    display: grid;
    gap: 2px;
    padding: 14px 16px;
}

.tour-kpi-card strong {
    font-size: 1.7rem;
    line-height: 1;
}

.tour-workspace-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: stretch;
}

.tour-panel {
    display: grid;
    align-content: start;
    gap: 18px;
    min-width: 0;
    padding: 18px;
}

.tour-panel-header,
.tour-reference-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.tour-chip {
    background: #e8f4f2;
    color: var(--tour-teal);
    white-space: nowrap;
}

.tour-chip--blue {
    background: #e8f0fb;
    color: var(--tour-accent-strong);
}

.tour-panel .ap-tour-nudge {
    max-width: none;
    border: 1px solid var(--tour-border);
    box-shadow: none;
}

.tour-helper-list {
    padding: 14px;
    border: 1px solid var(--tour-border);
    border-radius: 8px;
    background: var(--tour-surface-muted);
}

.tour-helper-list ul,
.tour-step-list {
    margin: 0;
    padding: 0;
}

.tour-helper-list ul {
    display: grid;
    gap: 8px;
    padding-left: 18px;
}

.tour-step-list {
    display: grid;
    gap: 12px;
    list-style: none;
}

.tour-step-list li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--tour-border);
    border-radius: 8px;
    background: var(--tour-surface-muted);
}

.tour-step-index {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 6px;
    background: #e8f4f2;
    color: var(--tour-teal);
    font-weight: 800;
}

.tour-step-list strong,
.tour-reference-list strong {
    display: block;
    color: var(--tour-text);
}

.tour-step-list p {
    margin-bottom: 0;
}

.tour-reference-panel {
    padding: 18px;
}

.tour-reference-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 820px;
}

.tour-reference-list span,
.tour-reference-list strong {
    padding: 7px 9px;
    border: 1px solid var(--tour-border);
    border-radius: 999px;
    background: var(--tour-surface-muted);
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .tour-topbar {
        grid-template-columns: 1fr auto;
        min-height: auto;
        padding: 12px 16px;
    }

    .tour-topnav {
        grid-column: 1 / -1;
        justify-self: stretch;
        overflow-x: auto;
    }

    .tour-topbar-actions {
        align-self: start;
    }

    .tour-workspace-grid,
    .tour-kpi-grid {
        grid-template-columns: 1fr;
    }

    .tour-main {
        padding: 22px 16px 32px;
    }

    .tour-page-header,
    .tour-reference-panel {
        display: grid;
    }

    .tour-header-actions,
    .tour-reference-list {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .tour-brand-subtitle,
    .tour-status {
        display: none;
    }

    .tour-topbar {
        gap: 10px;
    }

    .tour-brand-title {
        white-space: normal;
    }

    .tour-platform-link,
    .tour-primary-action {
        width: 100%;
    }

    .tour-topbar-actions {
        width: 100%;
    }

    .tour-panel,
    .tour-reference-panel {
        padding: 14px;
    }

    .ap-tour-spotlight {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        box-shadow: none !important;
    }
}
