﻿/* Ultra Modern WhatsApp Loader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: radial-gradient(ellipse at center, #0a0a0a 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    #preloader::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at 20% 30%, rgba(37, 211, 102, 0.1) 0%, transparent 50%), radial-gradient(circle at 80% 70%, rgba(7, 94, 84, 0.15) 0%, transparent 50%), radial-gradient(circle at 40% 90%, rgba(37, 211, 102, 0.08) 0%, transparent 50%);
        animation: glowPulse 4s ease-in-out infinite alternate;
    }

@keyframes glowPulse {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }

    100% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.loader-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Particle System Background */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: #25D366;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 6s infinite linear;
}

    .particle:nth-child(1) {
        width: 4px;
        height: 4px;
        left: 10%;
        animation-delay: 0s;
    }

    .particle:nth-child(2) {
        width: 6px;
        height: 6px;
        left: 20%;
        animation-delay: 1s;
    }

    .particle:nth-child(3) {
        width: 3px;
        height: 3px;
        left: 30%;
        animation-delay: 2s;
    }

    .particle:nth-child(4) {
        width: 5px;
        height: 5px;
        left: 40%;
        animation-delay: 0.5s;
    }

    .particle:nth-child(5) {
        width: 4px;
        height: 4px;
        left: 50%;
        animation-delay: 1.5s;
    }

    .particle:nth-child(6) {
        width: 6px;
        height: 6px;
        left: 60%;
        animation-delay: 2.5s;
    }

    .particle:nth-child(7) {
        width: 3px;
        height: 3px;
        left: 70%;
        animation-delay: 3s;
    }

    .particle:nth-child(8) {
        width: 5px;
        height: 5px;
        left: 80%;
        animation-delay: 0.2s;
    }

    .particle:nth-child(9) {
        width: 4px;
        height: 4px;
        left: 90%;
        animation-delay: 1.8s;
    }

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }

    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }

    90% {
        opacity: 1;
        transform: translateY(-10vh) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(0);
    }
}

/* Glassmorphism WhatsApp Logo */
.whatsapp-logo-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 40px;
    background: rgba(37, 211, 102, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(37, 211, 102, 0.2);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(37, 211, 102, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: logoFloat 3s ease-in-out infinite;
}

    .whatsapp-logo-container::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(45deg, #25D366, #075E54, #25D366);
        border-radius: 32px;
        z-index: -1;
        animation: borderGlow 2s linear infinite;
    }

@keyframes borderGlow {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

.whatsapp-logo {
    font-size: 60px;
    color: #25D366;
    animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% {
        text-shadow: 0 0 20px rgba(37, 211, 102, 0.5);
        transform: scale(1);
    }

    100% {
        text-shadow: 0 0 30px rgba(37, 211, 102, 0.8);
        transform: scale(1.1);
    }
}

/* Animated Loading Bars */
.loading-bars {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
}

.loading-bar {
    width: 4px;
    height: 40px;
    background: linear-gradient(to top, #075E54, #25D366);
    border-radius: 2px;
    animation: barPulse 1.2s ease-in-out infinite;
}

    .loading-bar:nth-child(1) {
        animation-delay: 0s;
    }

    .loading-bar:nth-child(2) {
        animation-delay: 0.1s;
    }

    .loading-bar:nth-child(3) {
        animation-delay: 0.2s;
    }

    .loading-bar:nth-child(4) {
        animation-delay: 0.3s;
    }

    .loading-bar:nth-child(5) {
        animation-delay: 0.4s;
    }

@keyframes barPulse {
    0%, 100% {
        transform: scaleY(0.4);
        opacity: 0.6;
    }

    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Loading Text with Typewriter Effect */
.loading-text {
    color: #25D366;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    opacity: 0;
    animation: textReveal 3s ease-out infinite;
}

@keyframes textReveal {
    0%, 20% {
        opacity: 0;
        transform: translateY(20px);
    }

    30%, 70% {
        opacity: 1;
        transform: translateY(0);
    }

    80%, 100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Progress Ring */
.progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
}

    .progress-ring svg {
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }

    .progress-ring circle {
        fill: none;
        stroke: rgba(37, 211, 102, 0.2);
        stroke-width: 3;
        cx: 100;
        cy: 100;
        r: 90;
    }

    .progress-ring .progress {
        stroke: #25D366;
        stroke-linecap: round;
        stroke-dasharray: 565.48;
        stroke-dashoffset: 565.48;
        animation: progressAnimation 3s ease-out infinite;
    }

@keyframes progressAnimation {
    0% {
        stroke-dashoffset: 565.48;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

/* Fade out animation */
#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .loader-container {
        width: 250px;
        height: 250px;
    }

    .whatsapp-logo-container {
        width: 80px;
        height: 80px;
    }

    .whatsapp-logo {
        font-size: 40px;
    }

    .loading-text {
        font-size: 18px;
    }
}
