
/* Blazor error UI: full-viewport backdrop with a centered card. Blazor's runtime toggles
   #blazor-error-ui to display:block when an unhandled circuit exception fires and wires
   `.dismiss` to hide it; `.reload` reloads the page via href=".". Modal-style so it reads
   as an interrupting error rather than the tiny default bottom bar. */

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#blazor-error-ui .lc-error-ui__card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(480px, calc(100% - 2rem));
    background: color-mix(in oklab, var(--lc-surface-solid) 92%, transparent);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(var(--lc-fx-tint), 0.08);
    border-top: 3px solid var(--lc-danger);
    border-radius: var(--lc-radius-lg);
    color: var(--lc-text);
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    text-align: center;
}

[data-bs-theme="light"] #blazor-error-ui .lc-error-ui__card {
    background: var(--lc-surface-solid);
    box-shadow: 0 24px 64px rgba(33, 37, 41, 0.24);
}

#blazor-error-ui .lc-error-ui__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--lc-text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border-radius: var(--lc-radius-sm);
    transition: color var(--lc-duration-fast) var(--lc-ease), background var(--lc-duration-fast) var(--lc-ease);
}

#blazor-error-ui .lc-error-ui__close:hover {
    color: var(--lc-text);
    background: rgba(var(--lc-fx-tint), 0.08);
}

#blazor-error-ui .lc-error-ui__icon {
    font-size: 3rem;
    color: var(--lc-danger);
    line-height: 1;
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

#blazor-error-ui .lc-error-ui__title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
}

#blazor-error-ui .lc-error-ui__body {
    color: var(--lc-text-muted);
    margin: 0 0 1.25rem 0;
}

#blazor-error-ui .lc-error-ui__actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 767.98px) {
    #blazor-error-ui {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    #blazor-error-ui .lc-error-ui__card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--lc-surface-solid);
    }
}


   Reconnect modal (Blazor circuit lost). State classes named components-reconnect-* are
   toggled by Blazor's built-in reconnection runtime and MUST stay verbatim. Migrated from
   Layout/ReconnectModal.razor.css to a global scope so descendant selectors don't need
   to fight CSS isolation's [b-hash] rewriting.
   ========================================================= */

.lc-reconnect-modal .components-reconnect-first-attempt-visible,
.lc-reconnect-modal .components-reconnect-repeated-attempt-visible,
.lc-reconnect-modal .components-reconnect-failed-visible,
.lc-reconnect-modal .components-pause-visible,
.lc-reconnect-modal .components-resume-failed-visible {
    display: none;
}
.lc-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
.lc-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
.lc-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible,
.lc-reconnect-modal.components-reconnect-paused .components-pause-visible,
.lc-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible {
    display: block;
}
.lc-reconnect-modal.components-reconnect-show button.components-reconnect-first-attempt-visible,
.lc-reconnect-modal.components-reconnect-retrying button.components-reconnect-repeated-attempt-visible,
.lc-reconnect-modal.components-reconnect-failed button.components-reconnect-failed-visible,
.lc-reconnect-modal.components-reconnect-paused button.components-pause-visible,
.lc-reconnect-modal.components-reconnect-resume-failed button.components-resume-failed-visible {
    display: inline-flex;
}

.lc-reconnect-modal {
    max-width: 26rem;
    width: calc(100% - 2rem);
    padding: 0;
    background: var(--lc-surface-elevated, #fff);
    color: var(--lc-text);
    border: 1px solid var(--lc-glass-border);
    border-radius: var(--lc-radius-lg);
    box-shadow: var(--lc-shadow-lg);
    inset: 0;
    margin: auto;
}
.lc-reconnect-modal::backdrop {
    background: rgba(5, 8, 15, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.lc-reconnect-modal__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
    padding: 1.75rem 1.5rem;
    text-align: center;
}
.lc-reconnect-modal__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in oklab, var(--lc-danger) 15%, transparent);
    color: var(--lc-danger);
    font-size: 1.5rem;
    flex: 0 0 auto;
}
.lc-reconnect-modal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--lc-text);
}
.lc-reconnect-modal__msg {
    margin: 0;
    color: var(--lc-text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}
.lc-reconnect-modal__counter {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--lc-text);
    min-width: 1ch;
    display: inline-block;
}

/* =========================================================
   Modal (Bootstrap 5 modal + Aurora glass overrides)

   Surface recipe matches `.lc-card` - same tint / blur / saturate - so a modal
   reads as the same glass material as a card, just lifted higher (bigger drop
   shadow) and sitting over the dimmed `.modal-backdrop` instead of the aurora.
   ========================================================= */

.lc-modal .modal-content {
    background: rgba(var(--lc-fx-tint), 0.04);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: none;
    border-radius: var(--lc-radius-lg);
    color: var(--lc-text);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(var(--lc-fx-tint), 0.15),
        inset 0 0 0 1px rgba(var(--lc-fx-tint), 0.06);
}

[data-bs-theme="light"] .lc-modal .modal-content {
    background: var(--lc-surface-solid);
    box-shadow: 0 24px 64px rgba(33, 37, 41, 0.24);
}

@supports not (backdrop-filter: blur(1px)) {
    .lc-modal .modal-content { background: var(--lc-surface-solid); }
}

@media (prefers-reduced-transparency: reduce) {
    .lc-modal .modal-content {
        background: var(--lc-surface-solid);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

.lc-modal .modal-header {
    border-bottom: 1px solid rgba(var(--lc-fx-tint), 0.06);
    padding: 1.25rem 1.5rem;
}

.lc-modal .modal-body { padding: 1.5rem; }

.lc-modal .modal-footer {
    border-top: 1px solid rgba(var(--lc-fx-tint), 0.06);
    padding: 1rem 1.5rem;
    gap: 0.5rem;
}

.lc-modal .btn-close {
    filter: invert(1) grayscale(1) opacity(0.6);
    transition: opacity var(--lc-duration-fast) var(--lc-ease);
}
.lc-modal .btn-close:hover { filter: invert(1) grayscale(1) opacity(0.9); }

[data-bs-theme="light"] .lc-modal .btn-close {
    filter: grayscale(1) opacity(0.55);
}
[data-bs-theme="light"] .lc-modal .btn-close:hover {
    filter: grayscale(1) opacity(0.85);
}

/* Global backdrop - blurred + dimmed, matches Aurora Glass mood. */
.modal-backdrop {
    background: rgba(5, 8, 15, 0.6);
    backdrop-filter: blur(8px);
}
.modal-backdrop.show { opacity: 1; }

/* =========================================================
   In-app push toast (see wwwroot/js/lc-push.js)
   Rendered by JS directly (no Blazor) when the service worker relays a Web Push
   into the currently open tab. Positioned top-right on desktop, top-center on mobile.
   ========================================================= */
.lc-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: min(360px, calc(100vw - 2rem));
}

@media (max-width: 575.98px) {
    .lc-toast-host {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        max-width: none;
        align-items: stretch;
    }
}

.lc-toast {
    pointer-events: auto;
    background: var(--lc-surface-elevated);
    color: var(--lc-text);
    border: 1px solid var(--lc-glass-border-strong);
    border-radius: var(--lc-radius-lg);
    box-shadow: var(--lc-shadow-lg);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--lc-duration-med) var(--lc-ease),
                transform var(--lc-duration-med) var(--lc-ease);
}

.lc-toast--in {
    opacity: 1;
    transform: translateY(0);
}

.lc-toast--leaving {
    opacity: 0;
    transform: translateY(-8px);
}

.lc-toast__body {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
}

.lc-toast__icon {
    font-size: 1.25rem;
    color: var(--lc-accent);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.lc-toast__text {
    flex-grow: 1;
    min-width: 0;
}

.lc-toast__title {
    font-weight: 600;
    color: var(--lc-text);
    line-height: 1.3;
    margin-bottom: 0.125rem;
}

.lc-toast__msg {
    color: var(--lc-text-muted);
    font-size: 0.9rem;
    line-height: 1.35;
    word-wrap: break-word;
}

.lc-toast__close {
    background: transparent;
    border: 0;
    color: var(--lc-text-subtle);
    padding: 0.125rem;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--lc-radius-sm);
    transition: background-color var(--lc-duration-fast) var(--lc-ease),
                color var(--lc-duration-fast) var(--lc-ease);
}

.lc-toast__close:hover {
    background: rgba(var(--lc-fx-tint), 0.08);
    color: var(--lc-text);
}
