/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
/* =========================================================================
   پنجره‌ی «اتصال دوباره»
   -------------------------------------------------------------------------
   کلاس‌های components-* را خود بلیزور روی دیالوگ می‌گذارد و برمی‌دارد؛ اینجا
   فقط ظاهرشان عوض شده تا شبیه بقیه‌ی سایت باشد.
   ========================================================================= */

.components-reconnect-first-attempt-visible[b-zkmx5fsn14],
.components-reconnect-repeated-attempt-visible[b-zkmx5fsn14],
.components-reconnect-failed-visible[b-zkmx5fsn14],
.components-pause-visible[b-zkmx5fsn14],
.components-resume-failed-visible[b-zkmx5fsn14],
.components-rejoining-animation[b-zkmx5fsn14],
.reconnect-failed-icon[b-zkmx5fsn14] {
    display: none;
}

/* بلیزور کلاس‌ها را روی هم می‌گذارد (مثلاً show و retrying با هم)، پس هر حالت باید حالت‌های
   بعد از خودش را کنار بزند تا دو پیام هم‌زمان دیده نشود. */
#components-reconnect-modal.components-reconnect-show:not(.components-reconnect-retrying):not(.components-reconnect-failed):not(.components-reconnect-paused):not(.components-reconnect-resume-failed) .components-reconnect-first-attempt-visible[b-zkmx5fsn14],
#components-reconnect-modal.components-reconnect-retrying:not(.components-reconnect-failed):not(.components-reconnect-paused):not(.components-reconnect-resume-failed) .components-reconnect-repeated-attempt-visible[b-zkmx5fsn14],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible[b-zkmx5fsn14],
#components-reconnect-modal.components-reconnect-paused:not(.components-reconnect-resume-failed) .components-pause-visible[b-zkmx5fsn14],
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible[b-zkmx5fsn14] {
    display: block;
}

/* حلقه‌های چرخان فقط تا وقتی هستند که هنوز امیدی به وصل شدن هست */
#components-reconnect-modal.components-reconnect-show:not(.components-reconnect-failed):not(.components-reconnect-paused):not(.components-reconnect-resume-failed) .components-rejoining-animation[b-zkmx5fsn14] {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-failed-icon[b-zkmx5fsn14] {
    display: grid;
}

#components-reconnect-modal[b-zkmx5fsn14] {
    width: min(360px, calc(100vw - 32px));
    margin: auto;
    padding: 30px 26px 26px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 22px;
    background: rgba(10, 12, 20, 0.97);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 44px rgba(34, 211, 238, 0.14);
    color: #e2e8f0;
    font-family: inherit;
    direction: rtl;
    text-align: center;
    opacity: 0;
    transition: display 0.4s allow-discrete, overlay 0.4s allow-discrete;
    animation: reconnect-fade-out-b-zkmx5fsn14 0.4s both;
}

    #components-reconnect-modal[open][b-zkmx5fsn14] {
        animation: reconnect-rise-b-zkmx5fsn14 0.9s cubic-bezier(0.05, 0.89, 0.25, 1.02),
                   reconnect-fade-in-b-zkmx5fsn14 0.35s ease-in-out;
        animation-fill-mode: both;
    }

    /* نوار نئونی بالای پنجره */
    #components-reconnect-modal[b-zkmx5fsn14]::before {
        content: "";
        position: absolute;
        inset-inline: 26px;
        top: 0;
        height: 2px;
        border-radius: 999px;
        background: linear-gradient(90deg, transparent, #22d3ee, #a855f7, transparent);
    }

#components-reconnect-modal[b-zkmx5fsn14]::backdrop {
    background: rgba(3, 5, 10, 0.72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: reconnect-fade-in-b-zkmx5fsn14 0.35s ease-in-out;
}

.components-reconnect-container[b-zkmx5fsn14] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#components-reconnect-modal h2[b-zkmx5fsn14] {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #f8fafc;
}

#components-reconnect-modal p[b-zkmx5fsn14] {
    margin: 0;
    font-size: 13px;
    line-height: 2;
    color: #94a3b8;
}

#components-seconds-to-next-attempt[b-zkmx5fsn14] {
    display: inline-block;
    min-width: 18px;
    font-weight: 700;
    color: #67e8f9;
}

#components-reconnect-modal button[b-zkmx5fsn14] {
    margin-top: 6px;
    padding: 11px 26px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(120deg, #06b6d4, #a855f7);
    color: #06111f;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    #components-reconnect-modal button:hover[b-zkmx5fsn14] {
        transform: translateY(-1px);
        box-shadow: 0 8px 22px rgba(34, 211, 238, 0.32);
    }

    #components-reconnect-modal button:active[b-zkmx5fsn14] {
        transform: translateY(0);
    }

.reconnect-failed-icon[b-zkmx5fsn14] {
    width: 62px;
    height: 62px;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

    .reconnect-failed-icon svg[b-zkmx5fsn14] {
        width: 30px;
        height: 30px;
    }

/* دو حلقه که از مرکز باز می‌شوند: همان حسی که «دارد تلاش می‌کند» می‌دهد */
.components-rejoining-animation[b-zkmx5fsn14] {
    position: relative;
    width: 72px;
    height: 72px;
}

    .components-rejoining-animation div[b-zkmx5fsn14] {
        position: absolute;
        border: 2px solid #22d3ee;
        border-radius: 50%;
        opacity: 1;
        animation: reconnect-ripple-b-zkmx5fsn14 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    }

        .components-rejoining-animation div:nth-child(2)[b-zkmx5fsn14] {
            border-color: #a855f7;
            animation-delay: -0.5s;
        }

@keyframes reconnect-ripple-b-zkmx5fsn14 {
    0%, 4.9% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    5% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        top: 0;
        left: 0;
        width: 72px;
        height: 72px;
        opacity: 0;
    }
}

@keyframes reconnect-rise-b-zkmx5fsn14 {
    from {
        transform: translateY(26px) scale(0.96);
    }

    to {
        transform: translateY(0) scale(1);
    }
}

@keyframes reconnect-fade-in-b-zkmx5fsn14 {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes reconnect-fade-out-b-zkmx5fsn14 {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* تم روشن */
html[data-theme="light"] #components-reconnect-modal[b-zkmx5fsn14] {
    background: #ffffff;
    border-color: rgba(8, 145, 178, 0.3);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    color: #0f172a;
}

    html[data-theme="light"] #components-reconnect-modal h2[b-zkmx5fsn14] {
        color: #0f172a;
    }

    html[data-theme="light"] #components-reconnect-modal p[b-zkmx5fsn14] {
        color: #475569;
    }

html[data-theme="light"] #components-reconnect-modal[b-zkmx5fsn14]::backdrop {
    background: rgba(15, 23, 42, 0.35);
}

    html[data-theme="light"] #components-seconds-to-next-attempt[b-zkmx5fsn14] {
        color: #0e7490;
    }

    /* روی زمینه‌ی سفید، قرمزِ کم‌رنگ خوانده نمی‌شود */
    html[data-theme="light"] .reconnect-failed-icon[b-zkmx5fsn14] {
        border-color: rgba(220, 38, 38, 0.28);
        background: rgba(220, 38, 38, 0.08);
        color: #dc2626;
    }
