/* Professional Loader Styles */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

/* Content Container */
.loader-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    position: relative;
    z-index: 2;
}

/* Logo Container */
.loader-logo-container {
    margin-bottom: 30px;
    animation: logoFadeIn 1s ease-out;
}

.loader-logo-img {
    max-height: 120px;
    max-width: 300px;
    height: auto;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

/* Title Container */
.loader-title-container {
    margin-bottom: 40px;
    animation: titleSlideUp 1.2s ease-out 0.3s both;
}

.loader-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 4px;
    line-height: 1.1;
}

.title-primary {
    color: #ff6b35;
    display: inline-block;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

.title-secondary {
    color: #ffffff;
    display: inline-block;
    margin-left: 10px;
}

.loader-tagline {
    color: #b0b0b0;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* Progress Container */
.loader-progress-container {
    margin-bottom: 30px;
    animation: progressFadeIn 1.5s ease-out 0.6s both;
}

.loader-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.loader-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b35, #f7931e, #ff6b35);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressAnimation 2s ease-in-out infinite, progressGlow 1.5s ease-in-out infinite alternate;
    transition: width 0.3s ease;
}

.loader-percentage {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Loading Text Container */
.loader-text-container {
    animation: textFadeIn 1.8s ease-out 0.9s both;
}

.loader-text {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    letter-spacing: 3px;
    animation: textPulse 2s ease-in-out infinite;
}

/* Animated Dots */
.loader-dots {
    display: inline-flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background: #ff6b35;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

/* Background Animation */
.loader-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.1;
}

.bg-animation {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, #ff6b35, transparent, #f7931e, transparent);
    animation: backgroundRotate 20s linear infinite;
}

/* Keyframe Animations */
@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes titleSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes titleGlow {
    0% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 107, 53, 0.3);
    }
    100% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 107, 53, 0.6), 0 0 40px rgba(255, 107, 53, 0.3);
    }
}

@keyframes progressFadeIn {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }
    100% {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes progressAnimation {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes progressGlow {
    0% {
        box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.8), 0 0 30px rgba(255, 107, 53, 0.4);
    }
}

@keyframes textFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8) translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2) translateY(-15px);
        opacity: 1;
    }
}

@keyframes backgroundRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Fade Out Animation */
.loader-fade-out {
    animation: fadeOut 0.8s ease-in-out forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loader-content {
        padding: 20px;
        max-width: 90%;
    }
    
    .loader-title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
    
    .loader-logo-img {
        max-height: 80px;
        max-width: 200px;
    }
    
    .loader-text {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .loader-title {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .loader-logo-img {
        max-height: 60px;
        max-width: 150px;
    }
    
    .loader-text {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    .loader-tagline {
        font-size: 0.9rem;
    }
}

/* High-performance optimizations */
#loader-wrapper * {
    will-change: transform, opacity;
    transform: translateZ(0);
}
