/**
 * Authentication Loading Overlay Styles
 * Provides smooth loading states during auth checks
 */

/* Loading Overlay */
#auth-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

#auth-loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Loading Content Container */
.auth-loading-content {
    text-align: center;
    padding: 40px;
}

/* Spinner Animation */
.auth-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #e5e7eb;
    border-top-color: #5A6B7B;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Text */
.auth-loading-text {
    color: #5A6B7B;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

/* Alternative Pulse Animation (optional) */
.auth-loading-pulse {
    display: inline-block;
    width: 60px;
    height: 60px;
    background: #5A6B7B;
    border-radius: 50%;
    animation: auth-pulse 1.4s ease-in-out infinite;
}

@keyframes auth-pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.7;
    }
}

/* Hide main content initially on protected pages */
body.auth-checking .main-content,
body.auth-checking .container,
body.auth-checking article {
    visibility: hidden;
}

/* Smooth reveal animation */
body.auth-verified .main-content,
body.auth-verified .container,
body.auth-verified article {
    visibility: visible;
    animation: auth-content-reveal 0.3s ease-out;
}

@keyframes auth-content-reveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error state styles */
.auth-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.auth-error-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
}

.auth-error-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
}

.auth-error-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
}

.auth-error-message {
    color: #6b7280;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 30px;
}

.auth-error-button {
    display: inline-block;
    padding: 12px 24px;
    background: #5A6B7B;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.auth-error-button:hover {
    background: #4A5A6A;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .auth-loading-content,
    .auth-error-content {
        padding: 20px;
    }
    
    .auth-spinner {
        width: 40px;
        height: 40px;
    }
    
    .auth-loading-text {
        font-size: 14px;
    }
    
    .auth-error-title {
        font-size: 20px;
    }
    
    .auth-error-message {
        font-size: 14px;
    }
}