/* Loading Bar Animation - Compiled from SCSS */
:root {
    --loadingbar-background-color: rgba(0, 0, 0, 0.8);
    --loadingbar-prospect-color: #ffffff;
}

html.dark {
    --loadingbar-background-color: rgba(0, 0, 0, 0.9);
    --loadingbar-prospect-color: #ffffff;
}

html.dark body {
    background-color: #161d22;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 62.5px;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.3s;
    user-select: none;
    overflow: hidden;
}

.loading-bar img {
    position: absolute;
    top: 500px;
    left: 0;
    filter: drop-shadow(0 -500px 0 rgba(0, 0, 0, 0));
    opacity: 0;
}

.loading-bar::after {
    content: "";
    position: absolute;
    top: 500px;
    left: 0;
    filter: drop-shadow(0 -500px 0 #ffffff);
    width: 500px;
    height: 62.5px;
    background: url("https://yuanshen.site/imgs/loading-bar.png") no-repeat left 100%;
    background-size: 500px 62.5px;
    background-position-x: 0;
    animation: loading-bar 0.8s cubic-bezier(0.28, 0.11, 0.32, 1) infinite forwards;
}

/* Mobile Loading Bar */
@media screen and (max-width: 768px) {
    .loading-bar {
        width: 300px;
        height: 37.5px;
        transform: translate(-50%, -50%) scale(1);
        display: block !important;
    }
    
    .loading-bar::after {
        width: 300px;
        height: 37.5px;
        background-size: 300px 37.5px;
    }
}

@media screen and (max-width: 480px) {
    .loading-bar {
        width: 250px;
        height: 31.25px;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .loading-bar::after {
        width: 250px;
        height: 31.25px;
        background-size: 250px 31.25px;
    }
}

@media screen and (max-width: 768px) and (orientation: landscape) {
    .loading-bar {
        width: 280px;
        height: 35px;
        transform: translate(-50%, -50%) scale(0.9);
    }
    
    .loading-bar::after {
        width: 280px;
        height: 35px;
        background-size: 280px 35px;
    }
}

@supports not (filter: drop-shadow(0 0 0 #fff)) {
    .loading-bar:before {
        content: "Your browser does not support the animation";
    }
}

@keyframes loading-bar {
    0% {
        width: 0;
    }
    16.6% {}
    33.2% {}
    49.8% {}
    66.4% {}
    83% {}
    100% {
        width: 100%;
    }
}

/* Remove loading text */
.loading-overlay::before {
    display: none;
}

/* Remove ripple effect */
.loading-overlay::after {
    display: none;
}
