/**
 * Modern Loader Styles
 */

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Animated Spinner */
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #2ecc71;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Floating dots animation */
.loader-dots {
    display: flex;
    gap: 0.5rem;
}

.loader-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2ecc71;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0s;
}

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

/* Loading text */
.loader-text {
    font-size: 1rem;
    color: #0f2818;
    font-weight: 500;
    letter-spacing: 2px;
}

.loader-text span {
    animation: blink 1.4s infinite ease-in-out;
}

.loader-text span:nth-child(1) {
    animation-delay: 0s;
}

.loader-text span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-text span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Percentage display */
.loader-percentage {
    font-size: 2rem;
    color: #2ecc71;
    font-weight: bold;
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Progress bar */
.loader-progress-bar {
    width: 200px;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1.5rem;
    position: relative;
}

.loader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

@keyframes blink {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Pulsing circle background */
.loader-bg-circle {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(46, 204, 113, 0.05);
    animation: pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
}

/* Alternative: Gradient spinner */
.spinner-gradient {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-radius: 50%;
    background: linear-gradient(45deg, transparent 30%, #2ecc71);
    animation: spin 0.8s linear infinite;
}

/* Minimalist line loader */
.loader-line {
    width: 60px;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loader-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: #2ecc71;
    border-radius: 2px;
    animation: slide 1.5s infinite ease-in-out;
}

@keyframes slide {
    0% {
        left: -30%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .loader-content {
        gap: 1.5rem;
    }
    
    .spinner {
        width: 50px;
        height: 50px;
    }
    
    .loader-text {
        font-size: 0.9rem;
    }
}
