/* ============================================
   PRELOADER STYLES
   ============================================ */

.preloader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0e17 0%, #141e2b 50%, #1a2a3a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Container holding liquid goo filter */
.goo-loader {
    width: 100px;
    height: 100px;
    filter: url('#goo');
    animation: spin-orbit 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.node {
    transform-origin: 50px 50px;
}

/* Individual nodes with colors and animations */
.node-top {
    fill: #5b21b6;
    animation: pulse-small 2s ease-in-out infinite;
}

.node-right {
    fill: #a78bfa;
    animation: float-right 2.5s ease-in-out infinite;
}

.node-pink {
    fill: #ec4899;
    animation: float-pink 2.8s ease-in-out infinite;
}

.node-green {
    fill: #22c55e;
    animation: float-green 2.2s ease-in-out infinite;
}

.node-yellow {
    fill: #eab308;
    animation: float-yellow 2.6s ease-in-out infinite;
}

.node-blue {
    fill: #38bdf8;
    animation: float-blue 2.4s ease-in-out infinite;
}

/* Rotation Animation */
@keyframes spin-orbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Animation for Top Node */
@keyframes pulse-small {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.6); }
}

/* Floating Animations for each node */
@keyframes float-right {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-4px, -4px) scale(1.1); }
}

@keyframes float-pink {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(3px, -5px) scale(1.15); }
}

@keyframes float-green {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-3px, 3px) scale(1.1); }
}

@keyframes float-yellow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(4px, 2px) scale(1.12); }
}

@keyframes float-blue {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-2px, -6px) scale(1.08); }
}

/* Loading Text */
.loader-text {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Loading Progress Bar */
.loader-progress {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #5b21b6, #a78bfa, #ec4899, #22c55e);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Particles Background */
.loader-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(88, 166, 255, 0.15);
    border-radius: 50%;
    animation: particle-float 20s linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 18s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 22s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 16s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 20s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 24s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 19s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 21s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 17s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 23s; }

@keyframes particle-float {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .goo-loader {
        width: 80px;
        height: 80px;
    }
    
    .loader-text {
        font-size: 0.7rem;
        bottom: 28%;
    }
    
    .loader-progress {
        width: 120px;
        bottom: 23%;
    }
}

@media (max-width: 576px) {
    .goo-loader {
        width: 60px;
        height: 60px;
    }
    
    .loader-text {
        font-size: 0.6rem;
        bottom: 25%;
        letter-spacing: 2px;
    }
    
    .loader-progress {
        width: 100px;
        bottom: 20%;
    }
}