/* ========================================
   GLOBAL LOADING OVERLAY
   Full-screen loading animation
   ======================================== */

/* Loading overlay container */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Above all content but should not interfere with floating player */
    opacity: 1;
    transition: opacity 0.8s ease-out;
    pointer-events: all;
}

/* Hidden state */
#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Loading text container */
.loading-text {
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(20px, 4vw, 32px);
    font-weight: bold;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
}

/* Animated dots */
.loading-text .dot {
    display: inline-block;
    animation: loading-dot 1.4s infinite;
    opacity: 0;
}

.loading-text .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-text .dot:nth-child(3) {
    animation-delay: 0.4s;
}

.loading-text .dot:nth-child(4) {
    animation-delay: 0.6s;
}

/* Dot animation keyframes */
@keyframes loading-dot {
    0%, 20% {
        opacity: 0;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Ensure smooth transitions */
@media (prefers-reduced-motion: reduce) {
    #loading-overlay {
        transition: opacity 0.2s ease-out;
    }
    
    .loading-text .dot {
        animation: none;
        opacity: 1;
    }
}
