/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
/* ============================================================
   Reconnect dialog
   Blazor shows this when the SignalR circuit drops. The copy,
   the spinner/alert swap and the action row are all driven by
   the state classes the framework puts on the <dialog>
   (components-reconnect-show / -retrying / -failed / -paused /
   -resume-failed), so the markup stays dumb and themeable.
   ============================================================ */

/* Everything state-specific starts hidden. */
.components-reconnect-first-attempt-visible[b-5v9dz2xoi2],
.components-reconnect-repeated-attempt-visible[b-5v9dz2xoi2],
.components-reconnect-failed-visible[b-5v9dz2xoi2],
.components-pause-visible[b-5v9dz2xoi2],
.components-resume-failed-visible[b-5v9dz2xoi2],
.components-rejoining-animation[b-5v9dz2xoi2],
.rc-actions[b-5v9dz2xoi2] {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-paused .components-pause-visible[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible[b-5v9dz2xoi2] {
    display: block;
}

#components-reconnect-modal.components-reconnect-show .components-rejoining-animation[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-failed .rc-alert.components-reconnect-failed-visible[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-paused .rc-alert.components-pause-visible[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-resume-failed .rc-alert.components-resume-failed-visible[b-5v9dz2xoi2] {
    display: grid;
}

#components-reconnect-modal.components-reconnect-failed .rc-actions-failed[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-paused .rc-actions-paused[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-resume-failed .rc-actions-resume-failed[b-5v9dz2xoi2] {
    display: flex;
}

/* Shell ------------------------------------------------------ */

#components-reconnect-modal[b-5v9dz2xoi2] {
    width: min(25rem, calc(100vw - 2rem));
    max-width: 100%;
    max-height: calc(100dvh - 4rem);
    margin: 18vh auto auto;
    padding: 1.9rem 1.6rem 1.5rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-3);
    text-align: center;
}

#components-reconnect-modal[open][b-5v9dz2xoi2] {
    animation: rc-dialog-in-b-5v9dz2xoi2 .26s cubic-bezier(.22, .8, .36, 1) both;
}

#components-reconnect-modal[b-5v9dz2xoi2]::backdrop {
    background: rgba(9, 11, 14, .52);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: rc-backdrop-in-b-5v9dz2xoi2 .26s ease both;
}

@keyframes rc-dialog-in-b-5v9dz2xoi2 {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rc-backdrop-in-b-5v9dz2xoi2 {
    from { opacity: 0; }
    to { opacity: 1; }
}

.components-reconnect-container[b-5v9dz2xoi2] {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Status visual: spinner ring while connecting, a tinted badge when the
   connection is down or the session is paused. */

.components-reconnect-visual[b-5v9dz2xoi2] {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: 1.1rem;
}

.components-reconnect-visual > *[b-5v9dz2xoi2] {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
}

.components-rejoining-animation[b-5v9dz2xoi2] {
    position: relative;
}

.components-rejoining-animation span[b-5v9dz2xoi2] {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3rem;
    height: 3rem;
    margin: -1.5rem 0 0 -1.5rem;
    border: 2px solid var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: rc-ripple-b-5v9dz2xoi2 1.8s cubic-bezier(0, .2, .8, 1) infinite;
}

.components-rejoining-animation span:nth-child(2)[b-5v9dz2xoi2] {
    animation-delay: -.9s;
}

@keyframes rc-ripple-b-5v9dz2xoi2 {
    0% { transform: scale(.35); opacity: 0; }
    18% { opacity: .85; }
    100% { transform: scale(1); opacity: 0; }
}

.rc-alert[b-5v9dz2xoi2] {
    place-items: center;
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.rc-alert .icon[b-5v9dz2xoi2] {
    width: 1.6rem;
    height: 1.6rem;
}

#components-reconnect-modal.components-reconnect-failed .components-reconnect-visual .rc-alert[b-5v9dz2xoi2],
#components-reconnect-modal.components-reconnect-resume-failed .components-reconnect-visual .rc-alert[b-5v9dz2xoi2] {
    border-color: var(--danger-line);
    background: var(--warn-bg);
    color: var(--warn-ink);
}

#components-reconnect-modal.components-reconnect-paused .components-reconnect-visual .rc-alert[b-5v9dz2xoi2] {
    border-color: var(--line);
    background: var(--line-soft);
    color: var(--ink-3);
}

/* Copy ------------------------------------------------------- */

.components-reconnect-title[b-5v9dz2xoi2] {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ink);
}

.components-reconnect-text[b-5v9dz2xoi2] {
    margin: .4rem 0 0;
    font-size: .88rem;
    line-height: 1.55;
    color: var(--ink-3);
}

/* Actions ---------------------------------------------------- */

.rc-actions[b-5v9dz2xoi2] {
    width: 100%;
    margin-top: 1.35rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
}

.rc-btn[b-5v9dz2xoi2] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0 1.15rem;
    border: 1px solid transparent;
    border-radius: .7rem;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, filter .15s ease;
}

.rc-btn-primary[b-5v9dz2xoi2] {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.rc-btn-primary:hover[b-5v9dz2xoi2] {
    filter: brightness(1.07);
}

.rc-btn-ghost[b-5v9dz2xoi2] {
    border-color: var(--line);
    background: transparent;
    color: var(--ink-2);
}

.rc-btn-ghost:hover[b-5v9dz2xoi2] {
    background: var(--hover);
    color: var(--ink);
}

@media (max-width: 480px) {
    #components-reconnect-modal[b-5v9dz2xoi2] {
        margin-top: 12vh;
        padding: 1.6rem 1.25rem 1.25rem;
    }

    .rc-btn[b-5v9dz2xoi2] {
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    #components-reconnect-modal[open][b-5v9dz2xoi2],
    #components-reconnect-modal[b-5v9dz2xoi2]::backdrop,
    .components-rejoining-animation span[b-5v9dz2xoi2] {
        animation: none;
    }

    .components-rejoining-animation span:first-child[b-5v9dz2xoi2] {
        opacity: .7;
        transform: scale(.85);
    }
}
