/* Loading Screen - Enhanced */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0e17 0%, #1a1f2e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MCIgaGVpZ2h0PSI2MCIgdmlld0JveD0iMCAwIDYwIDYwIj48cmVjdCB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIGZpbGw9IiMwYTBlMTciLz48cGF0aCBkPSJNMzAuMjUgMTV2MTVtMTUuNS0xMC41TDMwIDMwTTMwIDQ1VjMwbC0xNSAxNSIgc3Ryb2tlPSJyZ2JhKDI1NSwyNTUsMjU1LDAuMDUpIiBzdHJva2Utd2lkdGg9IjEiLz48L3N2Zz4=');
    opacity: 0.1;
    z-index: -1;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
}

.loader-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 30px;
    perspective: 1000px;
}

.loader {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: float 6s ease-in-out infinite;
}

.loader-logo {
    width: 80px;
    height: 80px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: rotate 20s linear infinite, pulse 4s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(74, 144, 226, 0.3));
    border-radius: 50%;
}

.loader-circle {
    position: absolute;
    border-radius: 50%;
    border-style: solid;
    border-width: 2px;
    border-color: transparent;
    animation: rotate 3s linear infinite;
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.2);
}

.loader-circle:nth-child(1) {
    width: 100%;
    height: 100%;
    border-top-color: #4a90e2;
    border-bottom-color: #4a90e2;
    animation-duration: 8s;
}

.loader-circle:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-left-color: #e74c3c;
    border-right-color: #e74c3c;
    animation-duration: 6s;
    animation-direction: reverse;
}

.loader-circle:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: #2ecc71;
    border-bottom-color: #2ecc71;
    animation-duration: 4s;
}

.loading-text {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 30px 0 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.loading-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.loading-progress {
    width: 280px;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-top: 30px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

.loading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shine 2s infinite;
}

.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        #4a90e2 0%, 
        #2ecc71 50%, 
        #e74c3c 100%);
    transition: width 0.4s cubic-bezier(0.1, 0.5, 0.1, 1);
    position: relative;
    overflow: hidden;
}

.loading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0) 100%);
    animation: shine 1.5s infinite;
}

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

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.9; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.9; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotateX(5deg) rotateY(5deg); }
    50% { transform: translateY(-20px) rotateX(-5deg) rotateY(-5deg); }
}

@keyframes shine {
    0% { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(100%) skewX(-15deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .loader-container {
        width: 120px;
        height: 120px;
    }
    
    .loader-logo {
        width: 60px;
        height: 60px;
    }
    
    .loading-text {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }
    
    .loading-progress {
        width: 220px;
    }
}
