/* ==========================================
   MEHRGITI PRELOADER - Clean & Minimal
   ========================================== */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #ffffff;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* ==========================================
   LOADER CONTAINER
   ========================================== */

.loader {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ==========================================
   MEHRGITI LOGO ANIMATION
   ========================================== */

.loader::before {
    content: "";
    position: absolute;
    width: 80px;
    height: 80px;
    background: #949d37;
    border-radius: 50%;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 0 0 rgba(148, 157, 55, 0.4);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(148, 157, 55, 0.7);
    }
    
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 30px rgba(148, 157, 55, 0);
    }
    
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(148, 157, 55, 0);
    }
}

/* ==========================================
   ROTATING RING
   ========================================== */

.loader::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border: 4px solid transparent;
    border-top-color: #fdd65b;
    border-right-color: #fdd65b;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

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

/* ==========================================
   DOTS ANIMATION
   ========================================== */

.loader-dots {
    position: absolute;
    bottom: -50px;
    display: flex;
    gap: 10px;
    z-index: 1;
}

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

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

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

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

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

/* ==========================================
   DECORATIVE PARTICLES
   ========================================== */

.loader-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fdd65b;
    border-radius: 50%;
    animation: float 3s ease-in-out infinite;
}

.loader-particle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.loader-particle:nth-child(2) {
    top: 30%;
    right: 25%;
    animation-delay: 0.5s;
    background: #949d37;
}

.loader-particle:nth-child(3) {
    bottom: 25%;
    left: 30%;
    animation-delay: 1s;
}

.loader-particle:nth-child(4) {
    bottom: 20%;
    right: 20%;
    animation-delay: 1.5s;
    background: #949d37;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) scale(1.2);
        opacity: 0.8;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .loader {
        width: 150px;
        height: 150px;
    }
    
    .loader::before {
        width: 60px;
        height: 60px;
    }
    
    .loader::after {
        width: 90px;
        height: 90px;
    }
}

@media (max-width: 480px) {
    .loader {
        width: 120px;
        height: 120px;
    }
    
    .loader::before {
        width: 50px;
        height: 50px;
    }
    
    .loader::after {
        width: 75px;
        height: 75px;
    }
    
    .loader-dots {
        bottom: -40px;
    }
    
    .loader-dots span {
        width: 10px;
        height: 10px;
    }
}