/* Loading Animation - Red, Blue, Yellow Theme */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0f0f;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Logo Animation */
.loading-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
    animation: logoFloat 3s ease-in-out infinite;
}

.loading-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(88, 101, 242, 0.5));
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Loading Text */
.loading-text {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Progress Bar Container */
.loading-progress-container {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

/* Animated Progress Bar with Red, Blue, Yellow */
.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        #ED4245 0%,      /* Red */
        #FAA81A 33%,     /* Blue */
        #5865F2 66%,     /* Yellow */
        #ED4245 100%     /* Red */
    );
    background-size: 300% 100%;
    border-radius: 10px;
    animation: progressLoad 2s ease-in-out forwards, progressShift 3s linear infinite;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
}

@keyframes progressLoad {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes progressShift {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 300% 0%;
    }
}

/* Spinning Dots */
.loading-dots {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.loading-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) {
    background: #FAA81A; /* Red */
    animation-delay: 0s;
}

.loading-dot:nth-child(2) {
    background: #ED4245; /* Blue */
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    background: #5865F2; /* Yellow */
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Circular Spinner */
.loading-spinner {
    width: 60px;
    height: 60px;
    margin-bottom: 2rem;
    position: relative;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    animation: spinRotate 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #ED4245; /* Red */
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    border-right-color: #5865F2; /* Blue */
    animation-delay: 0.3s;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: #FAA81A; /* Yellow */
    animation-delay: 0.6s;
}

@keyframes spinRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Status Text */
.loading-status {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-top: 1rem;
    animation: statusFade 2s ease-in-out infinite;
}

@keyframes statusFade {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

/* Particles Background Effect */
.loading-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: particleFloat 4s ease-in-out infinite;
}

.particle:nth-child(1) {
    background: #ED4245;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    background: #5865F2;
    left: 30%;
    animation-delay: 0.5s;
}

.particle:nth-child(3) {
    background: #FAA81A;
    left: 50%;
    animation-delay: 1s;
}

.particle:nth-child(4) {
    background: #ED4245;
    left: 70%;
    animation-delay: 1.5s;
}

.particle:nth-child(5) {
    background: #5865F2;
    left: 90%;
    animation-delay: 2s;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .loading-logo {
        width: 80px;
        height: 80px;
    }
    
    .loading-text {
        font-size: 1.2rem;
    }
    
    .loading-progress-container {
        width: 250px;
    }
}
