/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
/* Retheme of the framework's reconnect overlay. The class names and their visibility
   rules are driven by blazor.web.js, so they are kept verbatim; only the look changes.
   This matters more than usual here: phones lose the circuit routinely (screen lock,
   wifi/LTE handover) and the stock white-on-blue dialog reads as a crash. */

.components-reconnect-first-attempt-visible[b-u5d0etvq5m],
.components-reconnect-repeated-attempt-visible[b-u5d0etvq5m],
.components-reconnect-failed-visible[b-u5d0etvq5m],
.components-pause-visible[b-u5d0etvq5m],
.components-resume-failed-visible[b-u5d0etvq5m],
.components-rejoining-animation[b-u5d0etvq5m] {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible[b-u5d0etvq5m],
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation[b-u5d0etvq5m],
#components-reconnect-modal.components-reconnect-paused .components-pause-visible[b-u5d0etvq5m],
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible[b-u5d0etvq5m],
#components-reconnect-modal.components-reconnect-retrying[b-u5d0etvq5m],
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible[b-u5d0etvq5m],
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation[b-u5d0etvq5m],
#components-reconnect-modal.components-reconnect-failed[b-u5d0etvq5m],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible[b-u5d0etvq5m] {
    display: block;
}

#components-reconnect-modal[b-u5d0etvq5m] {
    width: min(20rem, calc(100dvw - 2.5rem));
    /* dvh, not vh: mobile browser chrome collapses on scroll and the dialog drifts. */
    margin: 20dvh auto;
    padding: 1.75rem;
    color: var(--text);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity-b-u5d0etvq5m 0.5s both;
}

#components-reconnect-modal[open][b-u5d0etvq5m] {
    animation: components-reconnect-modal-slideUp-b-u5d0etvq5m 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s,
               components-reconnect-modal-fadeInOpacity-b-u5d0etvq5m 0.5s ease-in-out 0.3s;
    animation-fill-mode: both;
}

#components-reconnect-modal[b-u5d0etvq5m]::backdrop {
    background-color: rgb(0 0 0 / 0.45);
    backdrop-filter: blur(4px);
    animation: components-reconnect-modal-fadeInOpacity-b-u5d0etvq5m 0.5s ease-in-out;
    opacity: 1;
}

@keyframes components-reconnect-modal-slideUp-b-u5d0etvq5m {
    0% { transform: translateY(30px) scale(0.95); }
    100% { transform: translateY(0); }
}

@keyframes components-reconnect-modal-fadeInOpacity-b-u5d0etvq5m {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes components-reconnect-modal-fadeOutOpacity-b-u5d0etvq5m {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.components-reconnect-container[b-u5d0etvq5m] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#components-reconnect-modal p[b-u5d0etvq5m] {
    margin: 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

#components-reconnect-modal button[b-u5d0etvq5m] {
    min-height: 44px;
    padding: 0.5rem 1.4rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: 0;
    border-radius: var(--radius-pill);
    background-color: var(--accent);
    color: var(--accent-contrast);
    cursor: pointer;
}

#components-reconnect-modal button:hover[b-u5d0etvq5m] { background-color: var(--accent-hover); }
#components-reconnect-modal button:active[b-u5d0etvq5m] { transform: scale(0.975); }

.components-rejoining-animation[b-u5d0etvq5m] {
    position: relative;
    width: 64px;
    height: 64px;
}

.components-rejoining-animation div[b-u5d0etvq5m] {
    position: absolute;
    border: 3px solid var(--accent);
    opacity: 1;
    border-radius: 50%;
    animation: components-rejoining-animation-b-u5d0etvq5m 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.components-rejoining-animation div:nth-child(2)[b-u5d0etvq5m] {
    animation-delay: -0.5s;
}

@keyframes components-rejoining-animation-b-u5d0etvq5m {
    0%, 4.9% { top: 32px; left: 32px; width: 0; height: 0; opacity: 0; }
    5% { top: 32px; left: 32px; width: 0; height: 0; opacity: 1; }
    100% { top: 0; left: 0; width: 64px; height: 64px; opacity: 0; }
}
