/* Global Loader Styles */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.loader-overlay {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 300px;
    min-width: 200px;
}

.loader-logo {
    margin-bottom: 1.5rem;
    animation: logoFloat 2s ease-in-out infinite;
}

.logo-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: logoSpin 3s linear infinite;
}

.loader-text {
    margin-bottom: 1.5rem;
    color: #6c757d;
    font-size: 1rem;
    font-weight: 500;
    animation: textPulse 1.5s ease-in-out infinite;
}

.loader-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(108, 117, 125, 0.2);
    border-top: 3px solid #4A90E2;
    border-radius: 50%;
    animation: spinnerRotate 1s linear infinite;
}

/* Animations */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes logoSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spinnerRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Fade in/out animations */
.loader-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.loader-fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .global-loader {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .loader-content {
        background: rgba(45, 55, 72, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .loader-text {
        color: #e2e8f0;
    }
    
    .spinner-ring {
        border: 3px solid rgba(226, 232, 240, 0.2);
        border-top: 3px solid #3182ce;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .loader-content {
        padding: 1.5rem;
        max-width: 250px;
        min-width: 180px;
    }
    
    .logo-image {
        width: 60px;
        height: 60px;
    }
    
    .loader-text {
        font-size: 0.9rem;
    }
    
    .spinner-ring {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
}

/* Different animation variations */
.loader-logo.pulse {
    animation: logoFloat 2s ease-in-out infinite, logoPulse 1.5s ease-in-out infinite;
}

.loader-logo.bounce {
    animation: logoBounce 1s ease-in-out infinite;
}

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

@keyframes logoBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Alternative spinner styles */
.spinner-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.spinner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4A90E2;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.spinner-dot:nth-child(2) { animation-delay: -0.16s; }
.spinner-dot:nth-child(3) { animation-delay: 0s; }

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
