/* =============================================================================
   BLAZOR RECONNECTION MODAL - REFRESHED UI
   ============================================================================= */

/* Base Modal Structure */
#components-reconnect-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#components-reconnect-modal.components-reconnect-show {
    display: flex;
}

#components-reconnect-modal.components-reconnect-hide {
    display: none;
}

/* Backdrop with Blur */
.reconnect-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

/* Card Container */
.reconnect-card {
    position: relative;
    z-index: 2;
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 32px;
}

/* Icon Container */
.reconnect-icon-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reconnect-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: reconnectSpin 1s linear infinite;
}

.reconnect-icon {
    width: 32px;
    height: 32px;
    color: #3b82f6;
    z-index: 2;
}

/* Typography */
.reconnect-title {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.025em;
}

.reconnect-message {
    margin: 0 0 24px;
    font-size: 1rem;
    line-height: 1.5;
    color: #6b7280;
}

/* Status & Details */
.reconnect-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.reconnect-status {
    color: #3b82f6;
}

.reconnect-count {
    color: #9ca3af;
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 999px;
}

/* Progress Bar */
.reconnect-progress-track {
    width: 100%;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 32px;
}

.reconnect-progress-bar {
    height: 100%;
    background: #3b82f6;
    width: 30%;
    border-radius: 3px;
    animation: progressIndeterminate 1.5s ease-in-out infinite;
}

/* Actions */
.reconnect-actions {
    width: 100%;
}

.reconnect-btn {
    width: 100%;
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none; /* Hidden by default, shown on failure */
}

.reconnect-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.reconnect-btn:active {
    transform: translateY(0);
}

/* Animations */
@keyframes reconnectSpin {
    to { transform: rotate(360deg); }
}

@keyframes progressIndeterminate {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Failed State */
#components-reconnect-modal.components-reconnect-failed .reconnect-card {
    border-top: 4px solid #ef4444;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-spinner {
    border-top-color: #ef4444;
    border-color: rgba(239, 68, 68, 0.1);
    animation: none;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-icon {
    color: #ef4444;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-status {
    color: #ef4444;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-progress-bar {
    background: #ef4444;
    width: 100%;
    animation: none;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-btn {
    display: block;
    background: #ef4444;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-btn:hover {
    background: #dc2626;
}

/* Rejected State */
#components-reconnect-modal.components-reconnect-rejected .reconnect-card {
    border-top: 4px solid #f59e0b;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-spinner {
    border-top-color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.1);
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-icon {
    color: #f59e0b;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-status {
    color: #f59e0b;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-progress-bar {
    background: #f59e0b;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-btn {
    display: block;
    background: #f59e0b;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-btn:hover {
    background: #d97706;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .reconnect-card {
        background: #1f2937;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }

    .reconnect-title {
        color: #f9fafb;
    }

    .reconnect-message {
        color: #9ca3af;
    }

    .reconnect-count {
        background: #374151;
        color: #d1d5db;
    }

    .reconnect-progress-track {
        background: #374151;
    }
}