/* The reconnect / deploy-pause modal (#components-reconnect-modal in App.razor).
   Blazor drives it by class: -show / -retrying while reconnecting, -paused after a pause,
   -failed when the server is unreachable, -rejected / -resume-failed when a server answered
   and refused (js/reconnect.js reloads on those two). Each message span shows only in the
   states it belongs to, so the markup carries every wording and the class picks one. */

.reconnect-modal {
    /* Same supplemental values as PartnerHub's architectnow-tokens.css. */
    --an-space-2: 8px;
    --an-space-3: 12px;
    --an-space-4: 16px;
    --an-space-5: 20px;
    --an-space-6: 24px;
    --an-radius-sm: 8px;
    --an-radius-md: 12px;
    --an-shadow-panel: 0 20px 40px rgba(0, 0, 0, 0.5);
    --an-duration-fast: 0.2s;
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1500; /* above MudBlazor dialogs (1400): a paused page must not look interactive */
    align-items: center;
    justify-content: center;
    padding: var(--an-space-4);
    background: color-mix(in srgb, var(--an-ink) 55%, transparent);
    font-family: var(--an-font-sans);
}

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

.reconnect-modal.components-reconnect-hide {
    display: none;
}

.reconnect-card {
    max-width: 26rem;
    width: 100%;
    padding: var(--an-space-6) var(--an-space-6) var(--an-space-5);
    background: var(--an-paper);
    border: 1px solid var(--an-border);
    border-radius: var(--an-radius-md);
    box-shadow: var(--an-shadow-panel);
    text-align: center;
}

.reconnect-logo {
    width: 40px;
    height: 40px;
    margin-bottom: var(--an-space-3);
}

.reconnect-title {
    margin: 0 0 var(--an-space-2);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--an-ink);
}

.reconnect-detail {
    margin: 0;
    color: var(--an-gray-3);
    line-height: 1.5;
}

/* Every wording is present; the state picks one. */
.reconnect-when-reconnecting,
.reconnect-when-paused,
.reconnect-when-failed,
.reconnect-retry {
    display: none;
}

.components-reconnect-show .reconnect-when-reconnecting,
.components-reconnect-retrying .reconnect-when-reconnecting,
.components-reconnect-rejected .reconnect-when-reconnecting,
.components-reconnect-resume-failed .reconnect-when-reconnecting {
    display: inline;
}

.components-reconnect-paused .reconnect-when-paused {
    display: inline;
}

.components-reconnect-failed .reconnect-when-failed {
    display: inline;
}

.components-reconnect-failed .reconnect-retry {
    display: inline-block;
}

.reconnect-retry {
    margin-top: var(--an-space-4);
    padding: var(--an-space-2) var(--an-space-5);
    border: 0;
    border-radius: var(--an-radius-sm);
    background: var(--an-red);
    color: var(--an-white);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--an-duration-fast) var(--an-ease);
}

.reconnect-retry:hover,
.reconnect-retry:focus-visible {
    background: var(--an-red-deep);
}

/* A quiet pulse while we wait; none for people who asked for less motion. */
.reconnect-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: var(--an-space-2);
    border-radius: 50%;
    background: var(--an-red);
    vertical-align: middle;
    animation: reconnect-pulse 1.2s ease-in-out infinite;
}

.components-reconnect-failed .reconnect-pulse {
    animation: none;
    background: var(--an-gray-4);
}

@keyframes reconnect-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .reconnect-pulse {
        animation: none;
    }
}
