.loading-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s linear;
}

.loading-bar-container.active {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

/* Add fadeout animation effect */
.loading-bar-container.fadeout {
    opacity: 1;
    animation: fadeout 1s ease-in-out forwards;
}

.loading-bar {
    background-color: rgba(0, 0, 0, 0.2);
    height: 100%;
    width: 100%;
}

.loading-bar-progress {
    background-color: #007bff; /* Primary blue color */
    height: 100%;
    width: 30%;
    animation: loading-progress 2s infinite ease-in-out;
    position: relative;
}

/* Error styling */
.loading-bar-container.has-error .loading-bar-progress {
    background-color: #dc3545; /* Danger red color */
    animation: loading-progress-error 0.75s infinite ease-in-out;
}

.loading-message {
    position: fixed;
    top: 5px;
    right: 10px;
    background-color: #007bff;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Error message styling */
.loading-error-message {
    position: fixed;
    top: 5px;
    right: 10px;
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    max-width: 80%;
}

/* Add fadeout animation for message */
.loading-bar-container.fadeout .loading-message,
.loading-bar-container.fadeout .loading-error-message {
    animation: fadeout 1s ease-in-out forwards;
}

@keyframes loading-progress {
    0% {
        left: -30%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: -30%;
    }
}

/* Error animation is quicker */
@keyframes loading-progress-error {
    0% {
        left: -30%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: -30%;
    }
}

/* Define the fadeout animation */
@keyframes fadeout {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}