:root {
    --height-of-loader: 4px;
    --loader-color: #181818;
    --bg-color: #24b44e;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
}

#preloader.hidden {
    opacity: 0;
}

.loader-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* loader  */
.loader {
    display: block;
    width: 130px;
    height: var(--height-of-loader);
    border-radius: 30px;
    background-color: rgba(0, 0, 0, 0.2);
    margin-top: 2rem;
    position: relative;
}

.loader::before {
    content: "";
    position: absolute;
    background: var(--loader-color);
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    border-radius: 30px;
    animation: moving 1s ease-in-out infinite;
}

@keyframes moving {
    50% {
        width: 100%;
    }

    100% {
        width: 0;
        right: 0;
        left: unset;
    }
}
