/* Global Loading Indicator Styles */

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 8, 37, 0.95);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.global-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.global-loader__content {
    text-align: center;
    color: #E3E1EB;
}

.global-loader__spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(227, 225, 235, 0.2);
    border-top: 4px solid #00D4AA;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.global-loader__text {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    opacity: 0.8;
}

.global-loader__dots {
    display: inline-block;
    animation: dots 1.5s infinite;
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dots Animation */
@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Alternative pulse animation for the spinner */
.global-loader__spinner--pulse {
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

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

/* Loading states for different scenarios */
.global-loader--navigation {
    background: rgba(4, 8, 37, 0.9);
}

.global-loader--form-submit {
    background: rgba(4, 8, 37, 0.8);
}

.global-loader--data-loading {
    background: rgba(4, 8, 37, 0.85);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .global-loader__spinner {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }
    
    .global-loader__text {
        font-size: 14px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .global-loader__spinner {
        animation: none;
        border: 4px solid #00D4AA;
    }
    
    .global-loader__dots {
        animation: none;
    }
    
    .global-loader__dots::after {
        content: '...';
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .global-loader {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .global-loader__spinner {
        border-color: rgba(255, 255, 255, 0.3);
        border-top-color: #ffffff;
    }
    
    .global-loader__text {
        color: #ffffff;
    }
}