/* YouTube-style Loading Progress Bar */
#loading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #2563eb, #1d4ed8);
    z-index: 99999;
    transition: width 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

#loading-progress-bar.active {
    opacity: 1;
}

#loading-progress-bar.complete {
    width: 100% !important;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.5s ease 0.3s;
}

/* Optional: Spinner overlay for long operations */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
