/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0e161f 0%, #1a2332 50%, #0e161f 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: all 0.8s ease-in-out;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    position: relative;
}

/* Logo Animation */
.preloader-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    position: relative;
    animation: logoFloat 3s ease-in-out infinite;
}

.preloader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(74, 108, 247, 0.5));
    animation: logoGlow 2s ease-in-out infinite alternate;
}

/* Floating Animation */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

/* Glow Animation */
@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 0 20px rgba(74, 108, 247, 0.5));
    }
    100% {
        filter: drop-shadow(0 0 30px rgba(74, 108, 247, 0.8)) drop-shadow(0 0 40px rgba(102, 126, 234, 0.3));
    }
}

/* Progress Blocks */
.preloader-blocks {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px auto;
    width: 200px;
}

.preloader-block {
    width: 12px;
    height: 12px;
    background: rgba(74, 108, 247, 0.3);
    border-radius: 2px;
    transition: all 0.3s ease;
    animation: blockPulse 1.5s ease-in-out infinite;
}

.preloader-block.active {
    background: linear-gradient(135deg, #4a6cf7, #667eea);
    box-shadow: 0 0 15px rgba(74, 108, 247, 0.6);
    transform: scale(1.2);
}

.preloader-block:nth-child(1) {
    animation-delay: 0s;
}

.preloader-block:nth-child(2) {
    animation-delay: 0.1s;
}

.preloader-block:nth-child(3) {
    animation-delay: 0.2s;
}

.preloader-block:nth-child(4) {
    animation-delay: 0.3s;
}

.preloader-block:nth-child(5) {
    animation-delay: 0.4s;
}

.preloader-block:nth-child(6) {
    animation-delay: 0.5s;
}

.preloader-block:nth-child(7) {
    animation-delay: 0.6s;
}

.preloader-block:nth-child(8) {
    animation-delay: 0.7s;
}

.preloader-block:nth-child(9) {
    animation-delay: 0.8s;
}

.preloader-block:nth-child(10) {
    animation-delay: 0.9s;
}

@keyframes blockPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Animated Background Elements */
.preloader-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.preloader-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(74, 108, 247, 0.6);
    border-radius: 50%;
    animation: particleFloat 6s linear infinite;
}

.preloader-particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.preloader-particle:nth-child(2) {
    top: 60%;
    left: 20%;
    animation-delay: 1s;
    animation-duration: 6s;
}

.preloader-particle:nth-child(3) {
    top: 30%;
    left: 80%;
    animation-delay: 2s;
    animation-duration: 7s;
}

.preloader-particle:nth-child(4) {
    top: 80%;
    left: 70%;
    animation-delay: 3s;
    animation-duration: 9s;
}

.preloader-particle:nth-child(5) {
    top: 10%;
    left: 50%;
    animation-delay: 4s;
    animation-duration: 5s;
}

.preloader-particle:nth-child(6) {
    top: 70%;
    left: 90%;
    animation-delay: 5s;
    animation-duration: 8s;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* Loading Dots */
.preloader-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 8px;
}

.preloader-dot {
    width: 8px;
    height: 8px;
    background: #4a6cf7;
    border-radius: 50%;
    animation: dotPulse 1.5s ease-in-out infinite;
}

.preloader-dot:nth-child(1) {
    animation-delay: 0s;
}

.preloader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.preloader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .preloader-logo {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
    }
    
    .preloader-blocks {
        width: 150px;
        gap: 6px;
    }
    
    .preloader-block {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .preloader-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 15px;
    }
    
    .preloader-blocks {
        width: 120px;
        gap: 4px;
    }
    
    .preloader-block {
        width: 8px;
        height: 8px;
    }
}

/* Hide body scroll during preloader */
body.preloader-active {
    overflow: hidden;
}

/* Smooth transition when preloader finishes */
body.preloader-complete {
    overflow: auto;
}
