/* ================================================
   AI-Themed Loading Screen - Modern & Professional
   Theme Colors: Blue Gradient + Yellow Accent
   ================================================ */

/* Hide page content while loading is active */
body.loading-active {
    overflow: hidden;
}

body.loading-active > *:not(.ai-loading-screen) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Loading Screen Container */
.ai-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #0C182C 50%, #083174 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    overflow: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.ai-loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

/* Animated Background Particles */
.ai-loader-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ai-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(92, 176, 233, 0.6);
    border-radius: 50%;
    animation: float-particle 15s infinite linear;
}

.ai-particle:nth-child(2n) {
    background: rgba(255, 210, 93, 0.5);
    animation-duration: 20s;
}

.ai-particle:nth-child(3n) {
    background: rgba(61, 114, 252, 0.6);
    animation-duration: 18s;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) scale(1);
        opacity: 0;
    }
}

/* Main Loader Container */
.ai-loader-container {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* AI Brain/Neural Network Loader */
.ai-loader {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
}

/* Center Core Circle */
.ai-loader-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #5CB0E9 0%, #3D72FC 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 30px rgba(92, 176, 233, 0.6),
        0 0 60px rgba(61, 114, 252, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    animation: pulse-core 2s ease-in-out infinite;
}

@keyframes pulse-core {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 
            0 0 30px rgba(92, 176, 233, 0.6),
            0 0 60px rgba(61, 114, 252, 0.4),
            inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 
            0 0 40px rgba(92, 176, 233, 0.8),
            0 0 80px rgba(61, 114, 252, 0.6),
            inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
}

/* Orbital Rings */
.ai-loader-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 2px solid rgba(92, 176, 233, 0.3);
    border-radius: 50%;
    animation: rotate-ring 4s linear infinite;
}

.ai-loader-ring:nth-child(1) {
    width: 100px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
    border-top-color: rgba(92, 176, 233, 0.8);
    animation-duration: 3s;
}

.ai-loader-ring:nth-child(2) {
    width: 140px;
    height: 140px;
    margin-left: -70px;
    margin-top: -70px;
    border-right-color: rgba(255, 210, 93, 0.8);
    animation-duration: 4s;
    animation-direction: reverse;
}

.ai-loader-ring:nth-child(3) {
    width: 180px;
    height: 180px;
    margin-left: -90px;
    margin-top: -90px;
    border-bottom-color: rgba(61, 114, 252, 0.8);
    animation-duration: 5s;
}

@keyframes rotate-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Orbital Dots */
.ai-loader-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #FFD25D 0%, #FFC640 100%);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 210, 93, 0.8);
    animation: orbit-dot 3s linear infinite;
}

.ai-loader-dot:nth-child(5) {
    animation-delay: 0s;
    animation-duration: 3s;
}

.ai-loader-dot:nth-child(6) {
    animation-delay: 1s;
    animation-duration: 4s;
}

.ai-loader-dot:nth-child(7) {
    animation-delay: 2s;
    animation-duration: 5s;
}

@keyframes orbit-dot {
    0% {
        transform: rotate(0deg) translateX(90px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(90px) rotate(-360deg);
    }
}

/* Loading Text */
.ai-loader-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(90deg, #5CB0E9 0%, #FFD25D 50%, #3D72FC 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    animation: gradient-flow 3s linear infinite;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Loading Percentage */
.ai-loader-percentage {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    color: #5CB0E9;
    font-weight: 500;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(92, 176, 233, 0.5);
}

/* Progress Bar */
.ai-loader-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
}

.ai-loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #5CB0E9 0%, #FFD25D 50%, #3D72FC 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer-progress 2s linear infinite;
    box-shadow: 0 0 10px rgba(92, 176, 233, 0.6);
}

@keyframes shimmer-progress {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Tagline */
.ai-loader-tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    color: rgba(197, 200, 205, 0.7);
    margin-top: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Circuit Lines (Background Decoration) - Removed */
/* .ai-circuit-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: 
        linear-gradient(90deg, rgba(92, 176, 233, 0.5) 1px, transparent 1px),
        linear-gradient(rgba(92, 176, 233, 0.5) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: move-grid 20s linear infinite;
}

@keyframes move-grid {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
} */

/* Responsive Design */
@media (max-width: 768px) {
    .ai-loader {
        width: 150px;
        height: 150px;
    }
    
    .ai-loader-core {
        width: 45px;
        height: 45px;
    }
    
    .ai-loader-ring:nth-child(1) {
        width: 75px;
        height: 75px;
        margin-left: -37.5px;
        margin-top: -37.5px;
    }
    
    .ai-loader-ring:nth-child(2) {
        width: 105px;
        height: 105px;
        margin-left: -52.5px;
        margin-top: -52.5px;
    }
    
    .ai-loader-ring:nth-child(3) {
        width: 135px;
        height: 135px;
        margin-left: -67.5px;
        margin-top: -67.5px;
    }
    
    .ai-loader-text {
        font-size: 22px;
    }
    
    .ai-loader-progress {
        width: 250px;
    }
}

