/* ===== ENHANCED LOADING SCREEN STYLES V2.0 ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
    overflow: hidden;
    /* Prevent scrollbars completely */
    box-sizing: border-box;
}

.loading-screen.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

/* Background overlay to prevent black screen flashes */
.loading-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 255, 136, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%);
    z-index: -1;
}

.loading-container {
    text-align: center;
    color: #ffffff;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.loading-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: linear-gradient(45deg, #00ff88, #00ccff);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
    animation: logoGlow 2s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.logo-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.loading-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

@keyframes logoGlow {
    0% {
        box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
        transform: scale(1) rotateZ(0deg);
    }
    100% {
        box-shadow: 0 15px 40px rgba(0, 255, 136, 0.6);
        transform: scale(1.05) rotateZ(5deg);
    }
}

.loading-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShine 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

@keyframes titleShine {
    0%, 100% { 
        opacity: 1; 
        transform: translateY(0px);
    }
    50% { 
        opacity: 0.8; 
        transform: translateY(-2px);
    }
}

.loading-subtitle {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 3rem;
    font-weight: 300;
    animation: subtitleFloat 4s ease-in-out infinite;
}

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

.progress-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 2rem;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(51, 51, 51, 0.8);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88 0%, #00ccff 50%, #00ff88 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
    animation: progressGlow 2s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.progress-glow {
    position: absolute;
    top: -2px;
    left: -10px;
    right: -10px;
    bottom: -2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.4), transparent);
    border-radius: 10px;
    opacity: 0;
    animation: progressSweep 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0% {
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
        background-size: 200% 100%;
        background-position: -200% 0;
    }
    100% {
        box-shadow: 0 0 25px rgba(0, 255, 136, 0.8);
        background-size: 200% 100%;
        background-position: 200% 0;
    }
}

@keyframes progressSweep {
    0% { opacity: 0; transform: translateX(-100%); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateX(100%); }
}

.progress-text {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    animation: progressTextGlow 1.5s ease-in-out infinite alternate;
}

@keyframes progressTextGlow {
    0% { 
        text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
        color: #fff;
    }
    100% { 
        text-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
        color: #00ff88;
    }
}

.loading-status {
    font-size: 0.95rem;
    color: #aaa;
    margin-top: 1.5rem;
    min-height: 1.5rem;
    animation: statusFade 2s ease-in-out infinite alternate;
    font-weight: 400;
    letter-spacing: 0.5px;
}

@keyframes statusFade {
    0% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* Loading dots animation */
.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
    color: #00ff88;
}

@keyframes loadingDots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ===== ENHANCED PARTICLES SYSTEM ===== */
.loading-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.loading-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #00ff88 0%, transparent 70%);
    border-radius: 50%;
    animation: particleFloat 6s linear infinite;
    opacity: 0.8;
}

.loading-particle:nth-child(2n) {
    background: radial-gradient(circle, #00ccff 0%, transparent 70%);
    animation-duration: 8s;
}

.loading-particle:nth-child(3n) {
    background: radial-gradient(circle, #ff6b6b 0%, transparent 70%);
    animation-duration: 7s;
    width: 3px;
    height: 3px;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-10vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* ===== TRANSITION OVERLAY STYLES ===== */
.loading-transition {
    pointer-events: none;
    will-change: opacity, transform;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .loading-container {
        max-width: 90%;
        padding: 1.5rem;
    }
    
    .loading-title {
        font-size: 2rem;
    }
    
    .loading-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .loading-logo {
        width: 100px;
        height: 100px;
    }
    
    .loading-logo img {
        width: 65px;
        height: 65px;
    }
    
    .progress-container {
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .loading-title {
        font-size: 1.8rem;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
    }
    
    .loading-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
    }
    
    .loading-logo img {
        width: 50px;
        height: 50px;
    }
    
    .progress-text {
        font-size: 1rem;
    }
    
    .loading-status {
        font-size: 0.85rem;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.loading-screen * {
    box-sizing: border-box;
}

/* Prevent any scroll during loading */
body.loading-active {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100% !important;
}

html.loading-active {
    overflow: hidden !important;
    height: 100vh !important;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .loading-screen *,
    .loading-screen *::before,
    .loading-screen *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-particle {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .loading-screen {
        background: #000;
    }
    
    .loading-title {
        background: #fff;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .progress-fill {
        background: #fff;
    }
}

/* Particle background for loading screen */
.loading-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.loading-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #00ff88;
    border-radius: 50%;
    animation: floatParticle 4s infinite linear;
    opacity: 0.6;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10px) translateX(10px);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .loading-title {
        font-size: 2rem;
    }
    
    .loading-subtitle {
        font-size: 1rem;
    }
    
    .loading-logo {
        width: 100px;
        height: 100px;
    }
    
    .loading-logo img {
        width: 70px;
        height: 70px;
    }
    
    .loading-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .loading-title {
        font-size: 1.8rem;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
    }
    
    .progress-container {
        max-width: 300px;
    }
}
