/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
/* Blazor's reconnect dialog.
 *
 * The class names and the show/hide state classes are FRAMEWORK-OWNED -- the
 * reconnection script adds and removes them on the modal element, so the
 * selectors below are a contract with Blazor and not ours to rename. What is
 * ours is the appearance, which the stock template hard-codes as a white
 * rounded card with a pastel-blue button: on the Industry ground that reads as
 * a dialog from a different application, and in dark mode it is a white
 * rectangle.
 *
 * Restyled onto the design tokens. Kept as SCOPED css rather than moving into
 * industry.css because these class names belong to one component and nothing
 * else on the site should be able to match them by accident.
 */

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

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

#components-reconnect-modal[b-fav5xcw4ml] {
    width: 22rem;
    margin: 20vh auto;
    padding: 2rem;
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--divider);
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    font-family: var(--font-body);
    opacity: 0;
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity-b-fav5xcw4ml 0.5s both;
}

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

#components-reconnect-modal[b-fav5xcw4ml]::backdrop {
    background-color: rgb(10 12 16 / 55%);
    animation: components-reconnect-modal-fadeInOpacity-b-fav5xcw4ml 0.5s ease-in-out;
    opacity: 1;
}

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

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

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

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

#components-reconnect-modal p[b-fav5xcw4ml] {
    margin: 0;
    text-align: center;
    font-size: 14px;
}

/* Matches .btn--primary in industry.css. Restated rather than reused: the
   button is rendered by the framework's own markup and carries no class of
   ours to hook. */
#components-reconnect-modal button[b-fav5xcw4ml] {
    padding: 10px 22px;
    border: 1px solid var(--accent-fill);
    border-radius: 0;
    background-color: var(--accent-fill);
    color: var(--on-accent);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}

#components-reconnect-modal button:hover[b-fav5xcw4ml] {
    background-color: var(--accent-700);
    border-color: var(--accent-700);
}

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

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

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

@keyframes components-rejoining-animation-b-fav5xcw4ml {
    0%   { top: 40px; left: 40px; width: 0; height: 0; opacity: 0; }
    4.9% { top: 40px; left: 40px; width: 0; height: 0; opacity: 0; }
    5%   { top: 40px; left: 40px; width: 0; height: 0; opacity: 1; }
    100% { top: 0; left: 0; width: 80px; height: 80px; opacity: 0; }
}
