/* ===== Modern Loader Component ===== */

.fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #1a1f1a 0%, #2d3d2d 50%, #1e2b1e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Animated background particles */
.fullscreen-overlay::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: particleMove 20s linear infinite;
    opacity: 0.3;
}

@keyframes particleMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(-50px, -50px) rotate(360deg);
    }
}

/* Logo container with glow effect */
.loader-logo {
    position: relative;
    margin-bottom: 3.5rem;
    animation: logoFloat 3s ease-in-out infinite;
}

.loader-logo-img {
    max-width: 180px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(139, 195, 74, 0.4));
    position: relative;
    z-index: 1;
}

.loader-logo::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(139, 195, 74, 0.3) 0%, rgba(139, 195, 74, 0.15) 40%, transparent 70%);
    filter: blur(20px);
    animation: glowPulse 2s ease-in-out infinite;
    z-index: 0;
}

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

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a5d461;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    animation: messageFadeIn 0.5s ease-in-out, textPulse 2s ease-in-out infinite 0.5s;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.95;
    z-index: 10;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(165, 212, 97, 0.5);
    pointer-events: none;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.95;
    }
    50% {
        opacity: 0.7;
    }
}

/* Modern circular progress loader */
.loader {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-sizing: border-box;
}

.loader-ring:nth-child(1) {
    border: 3px solid rgba(139, 195, 74, 0.1);
    border-top-color: #8bc34a;
    animation: spin 1.5s linear infinite;
    box-shadow: 0 0 15px rgba(139, 195, 74, 0.3);
}

.loader-ring:nth-child(2) {
    border: 3px solid rgba(94, 129, 34, 0.1);
    border-right-color: #7ab82d;
    animation: spin 2s linear infinite reverse;
    opacity: 0.7;
}

.loader-ring:nth-child(3) {
    border: 3px solid rgba(165, 212, 97, 0.1);
    border-bottom-color: #a5d461;
    animation: spin 2.5s linear infinite;
    opacity: 0.5;
}

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

/* Progress dots */
.loader-dots {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.loader-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8bc34a 0%, #7ab82d 100%);
    opacity: 0.3;
    animation: dotPulse 1.4s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(139, 195, 74, 0.5);
}

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

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

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

@keyframes dotPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Loading percentage (optional) */
.loading-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

/* Fade-in animation specifically for centered loading message */
@keyframes messageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.95;
    }
}

/* Dark mode adjustments */
.dark-mode .fullscreen-overlay {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .loader-logo {
        margin-bottom: 3rem;
    }
    
    .loader-logo-img {
        max-width: 140px;
    }
    
    .loader {
        width: 120px;
        height: 120px;
    }
    
    .loading-message {
        font-size: 0.65rem;
        letter-spacing: 0.08em;
    }
    
    .loader-dots {
        bottom: -50px;
    }
}

/* Optional: Add a container wrapper class for better organization */
.loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
