/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
/* The reconnect dialog: a glass card over the blurred page, with an equaliser that bounces while it reconnects and
   flatlines when the server is not answering. Blazor puts the state classes on the dialog. */

/* Which lines show in which state */
.components-reconnect-first-attempt-visible[b-zp4zxx898o],
.components-reconnect-repeated-attempt-visible[b-zp4zxx898o],
.components-reconnect-failed-visible[b-zp4zxx898o],
.components-pause-visible[b-zp4zxx898o],
.components-resume-failed-visible[b-zp4zxx898o] {
    display: none;
}

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

#components-reconnect-modal.components-reconnect-failed .rc-actions[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-paused .rc-actions[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-resume-failed .rc-actions[b-zp4zxx898o] {
    display: flex;
}

#components-reconnect-modal.components-reconnect-failed .rc-actions button.components-reconnect-failed-visible[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-paused .rc-actions button.components-pause-visible[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-resume-failed .rc-actions button.components-resume-failed-visible[b-zp4zxx898o] {
    display: inline-flex;
}

/* Blazor can leave "show" on while retrying or after failing: the later state wins. */
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-first-attempt-visible[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-first-attempt-visible[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-repeated-attempt-visible[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-paused .components-reconnect-first-attempt-visible[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-resume-failed .components-reconnect-first-attempt-visible[b-zp4zxx898o] {
    display: none;
}

/* The card */
#components-reconnect-modal[b-zp4zxx898o] {
    width: min(26rem, calc(100vw - 2rem));
    margin: 18vh auto auto;
    padding: 0;
    border: 1px solid #2E333B;
    border-radius: 20px;
    background:
        radial-gradient(120% 80% at 50% -10%, rgb(142 152 164 / 0.22), transparent 60%),
        radial-gradient(90% 60% at 50% 120%, rgb(255 181 71 / 0.14), transparent 60%),
        rgb(19 21 25 / 0.92);
    color: #EEEAE0;
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 30px 80px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(142 152 164 / 0.08);
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    overflow: hidden;
    opacity: 0;
    transition: display 0.4s allow-discrete, overlay 0.4s allow-discrete;
    animation: rc-fade-out-b-zp4zxx898o 0.3s both;
}

#components-reconnect-modal[open][b-zp4zxx898o] {
    animation: rc-rise-b-zp4zxx898o 0.6s cubic-bezier(.2, .9, .25, 1.05) 0.25s both, rc-fade-in-b-zp4zxx898o 0.35s ease-out 0.25s both;
}

#components-reconnect-modal[b-zp4zxx898o]::backdrop {
    background: rgb(6 7 9 / 0.55);
    backdrop-filter: blur(6px) saturate(0.8);
    animation: rc-fade-in-b-zp4zxx898o 0.4s ease-out;
}

.components-reconnect-container[b-zp4zxx898o] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem 1.75rem 1.75rem;
    text-align: center;
}

/* The logo: its eyes dim and brighten while reconnecting, and it greys out when the server is not answering */
.rc-logo[b-zp4zxx898o] {
    width: 88px;
    height: 88px;
    margin-bottom: -0.5rem;
    filter: drop-shadow(0 6px 18px rgb(0 0 0 / 0.5));
    animation: rc-breathe-b-zp4zxx898o 2.2s ease-in-out infinite;
}

#components-reconnect-modal.components-reconnect-failed .rc-logo[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-resume-failed .rc-logo[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-paused .rc-logo[b-zp4zxx898o] {
    animation: none;
    filter: grayscale(1) brightness(0.7);
}

@keyframes rc-breathe-b-zp4zxx898o {
    0%, 100% { transform: translateY(0); filter: drop-shadow(0 6px 18px rgb(0 0 0 / 0.5)) brightness(0.92); }
    50% { transform: translateY(-3px); filter: drop-shadow(0 10px 22px rgb(0 0 0 / 0.5)) brightness(1.08); }
}

/* The equaliser: 11 bars, the brand gradient, each bouncing on its own beat */
.rc-eq[b-zp4zxx898o] {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    height: 44px;
    width: 100%;
    padding-bottom: 2px;
    border-bottom: 1px solid rgb(154 159 168 / 0.18);
}

.rc-eq span[b-zp4zxx898o] {
    width: 8px;
    height: 100%;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(to top, #8E98A4, #E2DBCB);
    transform-origin: bottom;
    transform: scaleY(0.15);
    box-shadow: 0 0 12px rgb(255 181 71 / 0.25);
    animation: rc-bounce-b-zp4zxx898o 1.1s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.13s);
    animation-duration: var(--d);
}

/* Not answering: the bars drop to a red flatline with a slow pulse travelling across */
#components-reconnect-modal.components-reconnect-failed .rc-eq span[b-zp4zxx898o],
#components-reconnect-modal.components-reconnect-resume-failed .rc-eq span[b-zp4zxx898o] {
    background: #F0655C;
    box-shadow: none;
    animation: rc-flat-b-zp4zxx898o 2.4s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.12s);
}

/* Paused: still, dim bars */
#components-reconnect-modal.components-reconnect-paused .rc-eq span[b-zp4zxx898o] {
    animation: none;
    transform: scaleY(0.12);
    background: #9A9FA8;
    box-shadow: none;
}

.rc-text h2[b-zp4zxx898o] {
    margin: 0 0 0.4rem;
    font: 700 1.375rem/1.25 "Sora", "Segoe UI", system-ui, sans-serif;
    letter-spacing: -0.01em;
}

.rc-text p[b-zp4zxx898o] {
    margin: 0;
    color: #9A9FA8;
    font-size: 0.9375rem;
    line-height: 1.5;
}

#components-seconds-to-next-attempt[b-zp4zxx898o] {
    color: #EEEAE0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rc-actions[b-zp4zxx898o] {
    display: none;
    gap: 0.5rem;
    justify-content: center;
}

.rc-actions button[b-zp4zxx898o] {
    display: none;
    align-items: center;
    padding: 0.55rem 1.25rem;
    border: 1px solid #2E333B;
    border-radius: 999px;
    background: #1D2026;
    color: #EEEAE0;
    font: 600 0.875rem/1.2 "Inter", "Segoe UI", system-ui, sans-serif;
    cursor: pointer;
}

.rc-actions button:hover[b-zp4zxx898o] { border-color: #9A9FA8; }
.rc-actions button:focus-visible[b-zp4zxx898o] { outline: 2px solid #E2DBCB; outline-offset: 2px; }

.rc-actions .rc-primary[b-zp4zxx898o] {
    border-color: transparent;
    background: linear-gradient(120deg, #8E98A4, #E2DBCB);
    color: #0A0B0D;
}

@keyframes rc-bounce-b-zp4zxx898o {
    0%, 100% { transform: scaleY(0.18); }
    50% { transform: scaleY(1); }
}

@keyframes rc-flat-b-zp4zxx898o {
    0%, 70%, 100% { transform: scaleY(0.06); opacity: 0.55; }
    35% { transform: scaleY(0.3); opacity: 1; }
}

@keyframes rc-rise-b-zp4zxx898o {
    from { transform: translateY(24px) scale(0.96); }
    to { transform: none; }
}

@keyframes rc-fade-in-b-zp4zxx898o {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rc-fade-out-b-zp4zxx898o {
    from { opacity: 1; }
    to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #components-reconnect-modal[open][b-zp4zxx898o] { animation: rc-fade-in-b-zp4zxx898o 0.2s both; }
    .rc-logo[b-zp4zxx898o] { animation: none; }
    .rc-eq span[b-zp4zxx898o] { animation: none !important; transform: scaleY(var(--h)); }
    #components-reconnect-modal.components-reconnect-failed .rc-eq span[b-zp4zxx898o] { transform: scaleY(0.06); }
}

#components-reconnect-modal:focus[b-zp4zxx898o], #components-reconnect-modal:focus-visible[b-zp4zxx898o] {
    outline: none;
}
