/* Blazor Server Reconnection Styles */

/* ==============================================
   Blazor Reconnect Modal Override
   Blazor applies these classes automatically:
   - components-reconnect-show: reconnecting
   - components-reconnect-hide: connected/initial
   - components-reconnect-failed: retries exhausted
   - components-reconnect-rejected: circuit disposed
   ============================================== */

/* Overlay — JavaScript controls visibility via .reconnect-visible class.
   Blazor's own classes (show/hide/failed/rejected) must NOT set display
   to avoid a paint-frame flash before the MutationObserver can override. */
#components-reconnect-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 10000;
    display: none;
}

/* JS adds this class when it's time to show the modal — sole display controller */
#components-reconnect-modal.reconnect-visible {
    display: flex;
    animation: reconnectFadeIn 0.3s ease;
}

/* Card */
.reconnect-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
    animation: reconnectSlideIn 0.3s ease;
}

.reconnect-card-header {
    background: #1e293b;
    padding: 24px 32px;
    text-align: center;
}

.reconnect-logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.reconnect-card-body {
    padding: 32px;
    text-align: center;
}

/* State: Connecting (spinner) */
.reconnect-spinner {
    width: 3rem;
    height: 3rem;
    margin-bottom: 16px;
}

/* State: Failed (wifi-off icon) */
.reconnect-icon-failed {
    display: inline-block;
    font-size: 2.5rem;
    color: #6c757d;
    margin-bottom: 16px;
}

.reconnect-message {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px 0;
}

.reconnect-submessage {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0 0 24px 0;
}

.reconnect-btn {
    background: #2e7d32;
    border-color: #2e7d32;
    padding: 10px 32px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    min-width: 180px;
}

.reconnect-btn:hover {
    background: #1b5e20;
    border-color: #1b5e20;
}

/* Animations */
@keyframes reconnectFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes reconnectSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 576px) {
    .reconnect-card {
        width: 95%;
    }

    .reconnect-card-header {
        padding: 20px 24px;
    }

    .reconnect-card-body {
        padding: 24px 20px;
    }
}
