/* =====================================================================
   Pantalla de reconexión de Blazor — versión de marca (reemplaza el banner
   gris por defecto). Blazor alterna las clases en #components-reconnect-modal:
     .components-reconnect-show      -> intentando reconectar
     .components-reconnect-failed    -> fallaron los intentos (se puede reintentar)
     .components-reconnect-rejected  -> el circuito ya no existe (recargar)
   100% temable (tokens) + funciona sin servidor (HTML/CSS/JS puro).
   ===================================================================== */

#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    animation: rc-fade .35s ease-out both;
}

/* Blazor muestra el modal poniendo alguna de estas clases */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.rc-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 32px;
    text-align: center;
    border-radius: var(--wk-r-xl, 20px);
    background: var(--wk-glass-bg, rgba(24, 24, 24, .9));
    backdrop-filter: var(--wk-glass-blur, blur(24px) saturate(180%));
    -webkit-backdrop-filter: var(--wk-glass-blur, blur(24px) saturate(180%));
    border: 1px solid var(--wk-primary-border, rgba(212, 175, 55, .4));
    box-shadow: var(--wk-shadow-lg), 0 0 18px rgba(var(--wk-primary-rgb), .06);
}

.rc-brand {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--wk-text-3, #8a8782);
}

.rc-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--wk-r-lg, 16px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rc-icon .material-symbols-outlined { font-size: 32px; }

/* Reconectando: aro girando alrededor del ícono */
.rc-icon-sync {
    background: rgba(var(--wk-primary-rgb), .12);
    border: 2px solid rgba(var(--wk-primary-rgb), .25);
    border-top-color: var(--wk-primary);
    color: var(--wk-primary-text, var(--wk-primary));
    animation: rc-spin 1s linear infinite;
}
.rc-icon-sync .material-symbols-outlined { animation: rc-counterspin 1s linear infinite; } /* mantener el ícono derecho */

/* Caído: ícono de nube desconectada */
.rc-icon-down {
    background: var(--wk-danger-light, rgba(186, 26, 26, .08));
    border: 1px solid var(--wk-danger-border, rgba(186, 26, 26, .18));
    color: var(--wk-danger, #ba1a1a);
}

.rc-title {
    margin: 0;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 19px;
    font-weight: 800;
    color: var(--wk-text, #ededed);
}
.rc-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--wk-text-3, #8a8782);
    max-width: 30ch;
}

/* Barra indeterminada (solo al reconectar) */
.rc-bar {
    width: 100%;
    height: 3px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(var(--wk-primary-rgb), .10);
    position: relative;
}
.rc-bar-fill {
    position: absolute;
    top: 0;
    height: 100%;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--wk-primary), var(--wk-primary-soft), var(--wk-primary), transparent);
    animation: rc-slide 1.8s cubic-bezier(.65, 0, .35, 1) infinite;
}

.rc-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.rc-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 22px;
    border-radius: var(--wk-r-md, 12px);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: filter .15s ease, transform .15s ease, background-color .15s ease;
}
.rc-btn .material-symbols-outlined { font-size: 18px; }
.rc-btn.primary {
    background: linear-gradient(135deg, var(--wk-primary), var(--wk-primary-strong));
    color: var(--wk-on-primary, #171717);
    box-shadow: 0 4px 14px rgba(var(--wk-primary-rgb), .25);
}
.rc-btn.primary:hover { filter: brightness(1.06); }
.rc-btn.primary:active { transform: scale(.97); }
.rc-btn.ghost {
    background: transparent;
    color: var(--wk-text-2, #cfcdc7);
    border-color: var(--wk-border-2, rgba(255, 255, 255, .15));
}
.rc-btn.ghost:hover { background: rgba(var(--wk-primary-rgb), .08); }
.rc-btn.ghost:active { transform: scale(.97); }

/* ── Conmutación de sub-estados según la clase que pone Blazor ── */
.rc-state { display: none; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
#components-reconnect-modal.components-reconnect-show     .rc-reconnecting { display: flex; }
#components-reconnect-modal.components-reconnect-failed   .rc-failed      { display: flex; }
#components-reconnect-modal.components-reconnect-rejected .rc-rejected    { display: flex; }

@keyframes rc-fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes rc-spin   { to { transform: rotate(360deg); } }
@keyframes rc-counterspin { to { transform: rotate(-360deg); } }
@keyframes rc-slide  { 0% { left: -40%; } 100% { left: 100%; } }
