.loader-container {
    --mobile-container-width: 430px; /* define once */
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    max-width: var(--mobile-container-width);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ff9500 0%, #ff7b00 100%);
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    animation: logoFloat 2s ease-in-out infinite alternate;
}

.logo-text {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner-container {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 25px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pulse-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
}

.dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
.dot:nth-child(3) { animation-delay: 0s; }

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    animation: textFade 2s ease-in-out infinite;
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    border-radius: 2px;
    animation: progressFill 3s ease-in-out;
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: float 6s linear infinite;
}

.particle:nth-child(odd) {
    animation-duration: 8s;
}

.main-container {
    display: none;
    color: white;
    animation: fadeInUp 0.8s ease;
}

.main-container.visible {
    display: block;
}

.welcome-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.demo-button {
    background: white;
    color: #ff9500;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.demo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 80%, 100% { 
        transform: scale(0.7);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes logoFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-10px); }
}

@keyframes textFade {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes progressFill {
    0% { width: 0%; }
    20% { width: 15%; }
    40% { width: 35%; }
    60% { width: 60%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .loader-logo {
        width: 70px;
        height: 70px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .spinner {
        width: 50px;
        height: 50px;
    }
    
    .progress-bar {
        width: 160px;
    }
    
    .loading-text {
        font-size: 14px;
    }
    
    .welcome-card {
        margin: 10px;
        padding: 20px;
    }
}