/* Modern Preloader with Glassmorphism */
.preloader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}

.preloader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Glassmorphism orbiting ring */
.preloader-ring {
    position: absolute;
    width: 180px;
    height: 180px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 3s linear infinite;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.preloader-ring::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: spin-reverse 4s linear infinite;
    top: -5px;
    left: -5px;
    box-shadow: inset 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

/* Logo container */
.preloader-logo {
    position: relative;
    z-index: 10;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: float 3s ease-in-out infinite;
}

.preloader-logo img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Particles effect around the ring */
.preloader-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: orbit 6s linear infinite;
}

.preloader-particle:nth-child(2) {
    animation-delay: -1.5s;
    width: 2px;
    height: 2px;
}

.preloader-particle:nth-child(3) {
    animation-delay: -3s;
    width: 3px;
    height: 3px;
}

.preloader-text {
    position: absolute;
    bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(200px) rotate(0deg);
        opacity: 0;
    }
    25% {
        opacity: 1;
    }
    75% {
        opacity: 1;
    }
    100% {
        transform: rotate(360deg) translateX(200px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .preloader-container {
        width: 140px;
        height: 140px;
    }

    .preloader-ring {
        width: 120px;
        height: 120px;
    }

    .preloader-logo {
        width: 70px;
        height: 70px;
    }

    .preloader-logo img {
        width: 60%;
        height: 60%;
    }
}
