/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
/* Reconnect dialog, in the brand card (mock 09). The state machine is Blazor's: it adds ONE of
   components-reconnect-show / -retrying / -failed / -paused / -resume-failed to the <dialog>, and the
   rules below only decide which pieces each state reveals. Keep every class name here. */

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

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

/* The card. A <dialog> opened with showModal() sits in the top layer; margin:auto centres it and
   the width leaves 16px either side on a 360px phone. */
#components-reconnect-modal[b-fxvppm5sj0] {
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #20242A;
    overflow: visible;
    opacity: 0;
    transition: display 0.3s allow-discrete, overlay 0.3s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity-b-fxvppm5sj0 0.3s both;
}

#components-reconnect-modal[open][b-fxvppm5sj0] {
    animation: components-reconnect-modal-fadeInOpacity-b-fxvppm5sj0 0.25s ease-out both;
}

/* The browser focuses the dialog itself when it opens; the white ring around the card is that focus
   outline, not design. The buttons inside carry their own focus ring. */
#components-reconnect-modal:focus[b-fxvppm5sj0],
#components-reconnect-modal:focus-visible[b-fxvppm5sj0] {
    outline: none;
}

/* The page behind is hidden, not just dimmed: whatever was on it is stale until the connection is
   back, and a half-visible screen invites taps that cannot work. */
#components-reconnect-modal[b-fxvppm5sj0]::backdrop {
    background-color: rgba(27, 44, 66, 0.97);
    opacity: 1;
}

.components-reconnect-container[b-fxvppm5sj0] {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 22px;
    background: #fff;
    border-radius: 16px;
    border-top: 5px solid #B7202A;
    box-shadow: 0 24px 60px rgba(10, 16, 26, 0.45);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

#components-reconnect-modal h2[b-fxvppm5sj0],
#components-reconnect-modal p[b-fxvppm5sj0] {
    margin: 0;
    text-align: left;
}

.rc-title[b-fxvppm5sj0] {
    font-family: var(--ffhq-cond, 'Barlow Semi Condensed', 'Arial Narrow', sans-serif);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: #20242A;
}

.rc-body[b-fxvppm5sj0] {
    font-size: 15px;
    line-height: 1.5;
    color: #5C584F;
}

/* Quiet, as asked: the seconds-to-next-attempt count stays available without shouting. */
.rc-quiet[b-fxvppm5sj0] {
    font-size: 13px;
    line-height: 1.4;
    color: #5C584F;
}

.rc-btn[b-fxvppm5sj0] {
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: #274060;
    color: #fff;
    font-family: var(--ffhq-cond, 'Barlow Semi Condensed', 'Arial Narrow', sans-serif);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.rc-btn:hover[b-fxvppm5sj0] {
    background: #1E3450;
}

.rc-btn:focus-visible[b-fxvppm5sj0] {
    outline: 2px solid #B7202A;
    outline-offset: 2px;
}

/* Indeterminate progress: a short bar sliding along a track. */
.components-rejoining-animation[b-fxvppm5sj0] {
    position: relative;
    height: 6px;
    border-radius: 99px;
    background: #E3E1D8;
    overflow: hidden;
}

.components-rejoining-animation i[b-fxvppm5sj0] {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    border-radius: 99px;
    background: #274060;
    animation: components-rejoining-slide-b-fxvppm5sj0 1.3s ease-in-out infinite;
}

/* Order: title, reassurance, progress, then the quiet seconds line and any button. */
.components-reconnect-container > .rc-title[b-fxvppm5sj0] { order: 1; }
.components-reconnect-container > .rc-body[b-fxvppm5sj0] { order: 2; }
.components-reconnect-container > .components-rejoining-animation[b-fxvppm5sj0] { order: 3; }
.components-reconnect-container > .rc-quiet[b-fxvppm5sj0] { order: 4; }
.components-reconnect-container > .rc-btn[b-fxvppm5sj0] { order: 5; }

@keyframes components-rejoining-slide-b-fxvppm5sj0 {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

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

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

/* No motion: the bar sits still at about half, still saying "working", and the card just appears. */
@media (prefers-reduced-motion: reduce) {
    .components-rejoining-animation i[b-fxvppm5sj0] {
        animation: none;
        width: 45%;
    }

    #components-reconnect-modal[b-fxvppm5sj0],
    #components-reconnect-modal[open][b-fxvppm5sj0] {
        animation: none;
        opacity: 1;
        transition: none;
    }
}
