/*
 * Drives Blazor's built-in reconnection UI (Microsoft.AspNetCore.Components.Web.JS's
 * DefaultReconnectionHandler). It detects the #components-reconnect-modal element below by id
 * and toggles these classes on it directly - no markup/CSS of its own is injected, so this file
 * is the only thing controlling visibility/appearance, and everything here can carry our CSP
 * nonce (unlike the framework's self-contained fallback dialog, which injects an un-nonced
 * <style> tag that this app's CSP silently blocks).
 */
#components-reconnect-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected,
#components-reconnect-modal.components-reconnect-resume-failed {
    display: flex;
}

.reconnect-modal__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    max-width: 32rem;
    padding: 2.4rem 3.2rem;
    border-radius: 0.8rem;
    background-color: #fff;
    color: #333;
    font-family: sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.reconnect-modal__content {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

#components-reconnect-modal.components-reconnect-show .reconnect-modal__content--reconnecting,
#components-reconnect-modal.components-reconnect-retrying .reconnect-modal__content--reconnecting {
    display: flex;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-modal__content--failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-modal__content--failed,
#components-reconnect-modal.components-reconnect-resume-failed .reconnect-modal__content--failed {
    display: flex;
}

.reconnect-modal__title {
    font-size: 1.7rem;
}

.reconnect-modal__content--failed a {
    color: #de5f5f;
    font-weight: 700;
    text-decoration: underline;
}

.reconnect-modal__spinner {
    width: 3.2rem;
    height: 3.2rem;
    border: 0.35rem solid rgba(247, 173, 47, 0.25);
    border-top-color: #f7ad2f;
    border-radius: 50%;
    animation: reconnect-modal-spin 0.8s linear infinite;
}

@keyframes reconnect-modal-spin {
    to {
        transform: rotate(360deg);
    }
}
