/* ====== RECONNECT MODAL — shared visual layer for Blazor Server's built-in
   ReconnectModal (Web/WebAdmin) and MAUI's ApiReconnectModal. Triggers differ
   per platform (framework circuit-state vs DelegatingHandler retry), but the
   pixels match. .reconnect-overlay is MAUI-only — Web's modal uses <dialog>'s
   native top-layer instead.

   This file is the natural standalone for any host that just needs the
   reconnect UI without the rest of the marketplace styling — load it on its
   own from WebAdmin etc. ====== */
.reconnect-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-system);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
    animation: reconnect-fade-in 0.3s ease-out;
}

.reconnect-overlay .reconnect-card {
    animation: reconnect-slide-up 0.4s cubic-bezier(0.05, 0.89, 0.25, 1.02);
}

.reconnect-card {
    background: var(--bg-white, white);
    color: var(--text-primary, #000);
    width: 20rem;
    max-width: calc(100% - 2rem);
    padding: 2rem;
    /* A floating panel, like a sheet: the radius scale's --r-panel (ui-theme.css). The
       fallback is the classic value, for a host that loads this file without the theme. */
    border-radius: var(--r-panel, 20px);
    box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
    -webkit-user-select: none;
    user-select: none;
}

.reconnect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.reconnect-container p {
    margin: 0;
    text-align: center;
    font-size: 14px;
}

.reconnect-pulse {
    position: relative;
    width: 80px;
    height: 80px;
}

.reconnect-pulse div {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    border: 3px solid #0087ff;
    opacity: 1;
    border-radius: 50%;
    /* Animate transform/opacity only (compositor-driven) instead of
       top/left/width/height, which forced a layout every frame and made the
       reconnect ripple visibly stutter. transform-origin is the 40px,40px
       centre, so scale(0)→scale(1) grows the ring from the middle exactly as
       the old top/left/width/height keyframe did. */
    transform: scale(0);
    will-change: transform, opacity;
    animation: reconnect-pulse-anim 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.reconnect-pulse div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes reconnect-pulse-anim {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    4.9% {
        transform: scale(0);
        opacity: 0;
    }
    5% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes reconnect-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes reconnect-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes reconnect-slide-up {
    from {
        transform: translateY(30px) scale(0.95);
    }
    to {
        transform: translateY(0);
    }
}
