/* Page Loader Styles */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2147483648;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

    .page-loader.hidden {
        opacity: 0;
        visibility: hidden;
    }

.loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Outer rotating ring */
.loader-ring {
    width: 120px;
    height: 120px;
    border: 3px solid transparent;
    border-radius: 50%;
    position: relative;
    animation: rotate 2s linear infinite;
    background: linear-gradient(45deg, #00f5ff, #ff006e, #8338ec, #3a86ff);
    background-size: 400% 400%;
    animation: rotate 2s linear infinite, gradientShift 3s ease-in-out infinite;
}

    .loader-ring::before {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        right: 3px;
        bottom: 3px;
        background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
        border-radius: 50%;
        z-index: 1;
    }

/* Logo container */
.loader-logo-container {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #00f5ff, #ff006e);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
    animation: logoFloat 2s ease-in-out infinite;
    overflow: hidden;
}

    .loader-logo-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        animation: shine 2s infinite;
    }

.loader-logo {
    width: 50px;
    height: 40px;
    filter: brightness(0) invert(1);
    z-index: 1;
    position: relative;
}

/* Loading text */
.loader-text {
    margin-top: 2rem;
    font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(45deg, #00f5ff, #ff006e, #8338ec);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 2s ease-in-out infinite;
    text-align: center;
    letter-spacing: 2px;
}

.loader-subtext {
    margin-top: 0.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    color: rgba(0, 245, 255, 0.7);
    animation: textGlow 2s ease-in-out infinite alternate;
    text-align: center;
    letter-spacing: 1px;
}

/* Floating particles */
.loader-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(0, 245, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 6s linear infinite;
}

    .particle:nth-child(odd) {
        background: rgba(255, 0, 110, 0.6);
        animation-duration: 8s;
    }

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

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

    .particle:nth-child(3) {
        top: 40%;
        left: 90%;
        animation-delay: -2s;
    }

    .particle:nth-child(4) {
        top: 60%;
        left: 80%;
        animation-delay: -3s;
    }

    .particle:nth-child(5) {
        top: 10%;
        left: 60%;
        animation-delay: -4s;
    }

    .particle:nth-child(6) {
        top: 90%;
        left: 70%;
        animation-delay: -5s;
    }

/* Progress bar */
.loader-progress {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00f5ff, #ff006e, #8338ec);
    background-size: 200% 100%;
    animation: progressMove 2s ease-in-out infinite, progressGradient 1.5s ease-in-out infinite;
    border-radius: 3px;
    width: 0%;
}

/* Animations */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

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

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 40px rgba(0, 245, 255, 0.6);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0px);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-10px);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes textGradient {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes textGlow {
    0% {
        color: rgba(0, 245, 255, 0.5);
        text-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
    }

    100% {
        color: rgba(0, 245, 255, 0.9);
        text-shadow: 0 0 20px rgba(0, 245, 255, 0.6);
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes progressMove {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

@keyframes progressGradient {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .loader-ring {
        width: 100px;
        height: 100px;
    }

    .loader-logo-container {
        width: 50px;
        height: 50px;
    }

    .loader-logo {
        width: 35px;
        height: 30px;
    }

    .loader-text {
        font-size: 1rem;
    }

    .loader-subtext {
        font-size: 0.8rem;
    }

    .loader-progress {
        width: 150px;
        bottom: 30px;
    }
}

/* Disable animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .page-loader *,
    .page-loader *::before,
    .page-loader *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
