/*
 * Server-host-only shell styles (error + reconnect UI).
 *
 * Navigation drawer / Contact Us chrome previously lived here and only the
 * Server host loaded it — WASM never saw those rules, so header/sidebar
 * height and the pinned footer drifted. Those rules now live in the shared
 * wwwroot/css/Navmenu.css (loaded by both _Host.cshtml and index.html).
 */

#blazor-error-ui {
    display: none;
    background: #c51244;
    color: #fff;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    z-index: 1000;
    width: 100%;
    font-family: Inter, Roboto, Arial, sans-serif;
}

    #blazor-error-ui .dismiss {
        position: absolute;
        right: .75rem;
        top: .5rem;
        cursor: pointer;
        background: transparent;
        border: 0;
        color: #fff;
        font-size: 1.25rem;
    }

    #blazor-error-ui .reload {
        color: #fff;
        text-decoration: underline;
    }

/*
 * MudBlazor.min.css ships
 *   #components-reconnect-modal { z-index:9999 !important;
 *                                 background-color: var(--mud-palette-background) !important }
 * Once MudThemeProvider defines the palette that turns the overlay into an OPAQUE
 * sheet in the theme's page colour (#F0FDF4 light / near-black dark) with white
 * text on it — the user sees a "completely blank page" for the whole reconnect.
 * The selector below is more specific AND !important so the translucent backdrop
 * always wins, whatever the stylesheet order; the page stays visible underneath.
 */
body > #components-reconnect-modal {
    position: fixed;
    inset: 0;
    z-index: 10000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(7, 11, 26, .45) !important;
    background-color: rgba(7, 11, 26, .45) !important;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    color: #fff;
    font-family: Inter, Roboto, Arial, sans-serif;
    text-align: center;
    padding: 1rem;
}

    /* Legible on ANY backdrop (light or dark theme): the copy sits on its own card. */
    body > #components-reconnect-modal .reconnect-card {
        background: rgba(15, 23, 42, .94);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, .12);
        border-radius: .875rem;
        box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
        padding: 1.5rem 2rem;
        max-width: 26rem;
        line-height: 1.45;
    }

        body > #components-reconnect-modal .reconnect-card h4 {
            margin: 0 0 .5rem;
            font-size: 1.125rem;
            font-weight: 600;
            color: #fff;
        }

        body > #components-reconnect-modal .reconnect-card p {
            margin: 0;
            font-size: .9375rem;
            color: rgba(255, 255, 255, .85);
        }

        body > #components-reconnect-modal .reconnect-card a {
            color: #fff;
            text-decoration: underline;
        }

        body > #components-reconnect-modal .reconnect-hint:empty {
            display: none;
        }

        /* Manual reload is offered only after a long outage (.reconnect-long, set by
           blazor-server-shell.js) and never while a resume or an automatic refresh is
           already in progress. */
        body > #components-reconnect-modal .reconnect-reload {
            display: none;
            margin-top: .875rem;
            font-size: .8125rem;
            color: rgba(255, 255, 255, .7);
        }

        body > #components-reconnect-modal.reconnect-long .reconnect-reload {
            display: block;
        }

        /* ...nor while the browser itself is offline: reloading then just swaps this
           page for the browser's error screen and discards the preserved state. */
        body > #components-reconnect-modal.components-reconnect-resuming .reconnect-reload,
        body > #components-reconnect-modal.components-reconnect-rejected .reconnect-reload,
        body > #components-reconnect-modal.reconnect-offline .reconnect-reload {
            display: none;
        }

        /* Browser reports offline: the sweep bar would suggest activity that is not
           happening; show a static amber bar instead. */
        body > #components-reconnect-modal.reconnect-offline .reconnect-progress::after {
            animation: none;
            left: 0;
            width: 100%;
            background: #f59e0b;
            opacity: .7;
        }

    /* Small animated bar so a long reconnect never looks frozen. */
    body > #components-reconnect-modal .reconnect-progress {
        height: 3px;
        margin: 1rem auto 0;
        width: 100%;
        border-radius: 2px;
        background: rgba(255, 255, 255, .15);
        overflow: hidden;
        position: relative;
    }

        body > #components-reconnect-modal .reconnect-progress::after {
            content: '';
            position: absolute;
            inset: 0 auto 0 -40%;
            width: 40%;
            border-radius: 2px;
            background: #34d399;
            animation: egk-reconnect-sweep 1.4s ease-in-out infinite;
        }

    @keyframes egk-reconnect-sweep {
        to { left: 100%; }
    }

    @media (prefers-reduced-motion: reduce) {
        body > #components-reconnect-modal .reconnect-progress::after { animation: none; left: 0; width: 100%; opacity: .6; }
    }

    /* Every non-hidden state the .NET 10 client can apply must be visible: the
       'paused' / 'resume-failed' states were added in .NET 10 and, if left
       display:none, produce an unresponsive page with no visual cue. */
    body > #components-reconnect-modal.components-reconnect-show,
    body > #components-reconnect-modal.components-reconnect-retrying,
    body > #components-reconnect-modal.components-reconnect-failed,
    body > #components-reconnect-modal.components-reconnect-rejected,
    body > #components-reconnect-modal.components-reconnect-paused,
    body > #components-reconnect-modal.components-reconnect-resume-failed,
    body > #components-reconnect-modal.components-reconnect-resuming {
        display: flex;
    }

    body > #components-reconnect-modal.components-reconnect-hide {
        display: none;
    }
