/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F3FBF7 0%, #FAFAFF 50%, #FBF9F6 100%);
    background-attachment: fixed;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.loading-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.04) 100%),
        linear-gradient(90deg, rgba(210, 195, 180, 0.01) 0%, rgba(210, 195, 180, 0) 50%, rgba(190, 200, 210, 0.01) 100%);
    pointer-events: none;
    z-index: 0;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Loading Container */
.loading-container {
    text-align: center;
    animation: fadeInScale 0.5s ease;
    position: relative;
    z-index: 1;
}

/* Loading GIF */
.loading-gif {
    width: 100px;
    height: 100px;
    margin-bottom: 30px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-gif img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(135, 154, 119, 0.4));
}

/* Animated Loading Text */
.loading-text {
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #879A77;
    letter-spacing: 10px;
    text-transform: uppercase;
    position: relative;
    text-shadow: 
        0 0 10px rgba(135, 154, 119, 0.3),
        0 0 20px rgba(135, 154, 119, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.06);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Letter animation - wave effect */
.loading-text span {
    display: inline-block;
    animation: wave 1.2s ease-in-out infinite;
}

.loading-text span:nth-child(1) { animation-delay: 0s; }
.loading-text span:nth-child(2) { animation-delay: 0.1s; }
.loading-text span:nth-child(3) { animation-delay: 0.2s; }
.loading-text span:nth-child(4) { animation-delay: 0.3s; }
.loading-text span:nth-child(5) { animation-delay: 0.4s; }
.loading-text span:nth-child(6) { animation-delay: 0.5s; }
.loading-text span:nth-child(7) { animation-delay: 0.6s; }

/* Animated dots after LOADING */
.loading-dots {
    display: inline-block;
    width: 30px;
    text-align: left;
    color: #879A77;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

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

@keyframes wave {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-15px) scale(1.1);
        opacity: 0.8;
    }
}

/* Pulse animation for GIF */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Fade in scale animation */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Progress bar */
.loading-progress {
    margin-top: 25px;
    width: 340px;
    height: 3px;
    background: rgba(135, 154, 119, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(135, 154, 119, 0.1);
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #879A77, #7a8d6a, #879A77);
    background-size: 200% 100%;
    animation: progressSlide 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(135, 154, 119, 0.3);
}

@keyframes progressSlide {
    0% {
        background-position: 0% 0%;
        width: 0%;
    }
    50% {
        background-position: 100% 0%;
        width: 100%;
    }
    100% {
        background-position: 0% 0%;
        width: 0%;
    }
}

/* Spinner (fallback if no GIF) */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(135, 154, 119, 0.15);
    border-top: 4px solid #879A77;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
    box-shadow: 0 0 16px rgba(135, 154, 119, 0.2);
}

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

/* Responsive */
@media (max-width: 768px) {
    .loading-gif {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .loading-text {
        font-size: 1.6rem;
        letter-spacing: 6px;
    }
    
    .loading-progress {
        width: 220px;
    }
}

@media (max-width: 480px) {
    .loading-text {
        font-size: 1.3rem;
        letter-spacing: 4px;
    }
    
    .loading-progress {
        width: 180px;
    }
}
