/* ------------------------------------------------------------------
   Brand + layout tokens. Ignite UI palette tokens come from ig-palette.css
   (generated with the igniteui-theming MCP); everything here builds on them.
   ------------------------------------------------------------------ */
:root {
    --brand-navy: #27265F;
    --brand-orange: var(--ig-secondary-500);
    --brand-blue: var(--ig-primary-500);

    --surface-0: var(--ig-surface-sunken);
    --surface-1: var(--ig-surface-base);
    --surface-2: var(--ig-surface-raised);
    --surface-3: var(--ig-surface-overlay);
    --line: rgb(255 255 255 / 0.1);
    --text: var(--ig-gray-900);
    --text-muted: var(--ig-gray-600);

    --font-body: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

    --ig-font-family: var(--font-body);

    --bar-h: 56px;
    --foot-h: 60px;
    color-scheme: dark;
}

/* Radio labels in the deck's light text color */
igc-radio {
    --ig-radio-label-color: var(--ig-gray-900);
}

/*
  Regions that demo themes (Getting started step 3, the Theming slide) opt out of the deck's own tweaks,
  so the built-in themes show their real defaults. `initial` makes var(--token, fallback) use the theme's fallback.
*/
.theme-showcase igc-radio {
    --ig-radio-label-color: initial;
}

* {
    box-sizing: border-box;
}

/* Components size in rem, so scaling the root font scales the whole deck for big screens / streams */
html {
    font-size: clamp(16px, 0.95vw, 22px);
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--brand-navy);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

a {
    color: var(--ig-primary-300);
}

code,
kbd,
pre {
    font-family: var(--font-mono);
}

kbd {
    display: inline-block;
    padding: 0 6px;
    margin: 0 1px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 0.8em;
}

/* ------------------------------------------------------------------
   Shared slide building blocks
   ------------------------------------------------------------------ */
.slide-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.6fr);
    grid-template-rows: minmax(0, 1fr);
    gap: clamp(20px, 3vw, 48px);
    height: 100%;
    align-items: center;
}

.slide-grid.wide-demo {
    grid-template-columns: minmax(260px, 0.6fr) minmax(0, 2fr);
}

.slide-stack {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vh, 24px);
    min-height: 0;
}

.slide-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.slide-head .slide-h {
    font-size: clamp(1.6rem, 2.4vw, 2.5rem);
    margin-top: 6px;
}

.slide-copy {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.slide-demo {
    min-width: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
}

.kicker {
    color: var(--brand-orange);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.slide-h {
    margin: 0;
    font-size: clamp(2rem, 3.4vw, 3.4rem);
    line-height: 1.05;
    font-weight: 700;
}

.slide-h .accent {
    color: var(--brand-orange);
}

.slide-h .blue {
    color: var(--ig-primary-300);
}

.lead {
    margin: 0;
    font-size: clamp(1rem, 1.25vw, 1.3rem);
    color: var(--text-muted);
    line-height: 1.45;
}

.points {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
}

.points li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.points li::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin-top: 0.55em;
    border-radius: 2px;
    background: var(--brand-orange);
    transform: rotate(45deg);
}

.panel {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    min-width: 0;
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.25);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.code {
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgb(0 0 0 / 0.35);
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: clamp(0.78rem, 0.9vw, 0.92rem);
    line-height: 1.6;
    color: #e6e6f5;
    white-space: pre;
    overflow: auto;
}

.code .k { color: #79c0ff; }
.code .s { color: #ffa572; }
.code .c { color: #8b8fb8; font-style: italic; }
.code .t { color: #7ee2b8; }

.component-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.component-tags span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgb(0 153 255 / 0.45);
    color: var(--ig-primary-200);
    background: rgb(0 153 255 / 0.08);
}

.muted {
    color: var(--text-muted);
}

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.chips {
    gap: 6px;
}

.spacer {
    flex: 1;
}

/* A labelled control group in the slides' control panels */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.icon-host {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ------------------------------------------------------------------
   Boot screen (before WASM starts)
   ------------------------------------------------------------------ */
.boot {
    height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 24px;
}

.boot img {
    width: 96px;
    animation: boot-float 1.6s ease-in-out infinite alternate;
}

.boot-bar {
    width: 220px;
    height: 4px;
    border-radius: 2px;
    background: rgb(255 255 255 / 0.12);
    overflow: hidden;
}

.boot-bar span {
    display: block;
    height: 100%;
    width: var(--blazor-load-percentage, 10%);
    background: linear-gradient(90deg, #0099FF, #F05A2B);
    transition: width 0.2s;
}

@keyframes boot-float {
    to { transform: translateY(-10px); }
}

/* ------------------------------------------------------------------
   Blazor error UI
   ------------------------------------------------------------------ */
#blazor-error-ui {
    background: var(--ig-error-500);
    color: white;
    bottom: 0;
    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;
}

@media (max-width: 900px) {
    html, body { overflow: auto; }
    .slide-grid, .slide-grid.wide-demo { grid-template-columns: 1fr; height: auto; }
}
