/* Custom Blazor Server reconnect UI — non-blocking, brand-styled.
   Replaces the default full-screen "Rejoin failed…" overlay. Visibility is driven
   by js/reconnect.js, which only reveals it after a grace period (so brief network
   blips / dev rebuilds never flash) and switches to the "lost" state when the
   circuit is genuinely gone. Standalone CSS so it works even if the Tailwind bundle
   failed to load. */

#components-reconnect-modal {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%) translateY(0.75rem);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-family: "Roboto", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

#components-reconnect-modal.rc-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Which card shows: reconnecting by default; the "lost" card once rc-lost-state is set. */
#components-reconnect-modal .rc-card { display: none; }
#components-reconnect-modal.rc-visible .rc-reconnecting { display: flex; }
#components-reconnect-modal.rc-visible.rc-lost-state .rc-reconnecting { display: none; }
#components-reconnect-modal.rc-visible.rc-lost-state .rc-lost { display: flex; }

.rc-card {
    align-items: center;
    gap: 0.85rem;
    /* Solid background — NOT backdrop-filter. In Safari/WebKit a fixed backdrop-filter
       layer with the spinner animating over it forces a full-viewport blur re-rasterize
       every frame, which pegs the GPU and freezes/crashes the tab if the reconnect
       overlay stays up (e.g. an idle admin whose circuit dropped). */
    background: #ffffff;
    color: #2c3e50;
    border-radius: 9999px;
    padding: 0.6rem 0.65rem 0.6rem 1.15rem;
    box-shadow: 0 12px 32px rgba(44, 62, 80, 0.18), 0 0 0 1px rgba(44, 62, 80, 0.06);
    max-width: calc(100vw - 2rem);
}
.rc-lost { border-radius: 1rem; padding: 0.85rem 0.9rem 0.85rem 1.1rem; }

.rc-spinner {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
    border: 2.5px solid #d4e9f7;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: rc-spin 0.8s linear infinite;
}
@keyframes rc-spin { to { transform: rotate(360deg); } }

.rc-dot {
    width: 0.6rem;
    height: 0.6rem;
    flex: none;
    border-radius: 9999px;
    background: #e67e22;
    box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.18);
}

.rc-text { display: flex; flex-direction: column; line-height: 1.25; }
.rc-title { font-weight: 600; font-size: 0.9rem; }
.rc-sub { font-size: 0.72rem; color: #5a6c7d; }

.rc-reload {
    appearance: none;
    border: 0;
    cursor: pointer;
    background: #eef2f6;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 9999px;
    padding: 0.45rem 0.95rem;
    transition: background 0.15s ease, transform 0.15s ease;
}
.rc-reload:hover { background: #e2e8f0; }
.rc-reload:active { transform: scale(0.97); }
.rc-reload.rc-primary { background: #3498db; color: #fff; }
.rc-reload.rc-primary:hover { background: #2980b9; }

@media (prefers-reduced-motion: reduce) {
    #components-reconnect-modal { transition: opacity 0.2s ease; transform: translateX(-50%); }
    #components-reconnect-modal.rc-visible { transform: translateX(-50%); }
    .rc-spinner { animation-duration: 1.4s; }
}
