/* Progressbars */

@import '../../../assets/sass/config';
@import '../../../assets/sass/direction';
@import '../../../assets/sass/mixins';
    
@keyframes progress-active {
    0% {
        width: 0;
        opacity: .4;
    }
    100% {
        width: 100%;
        opacity: 0;
    }
}

.progress-bars {
    .title-wrapper {
        position: relative;
    }
    .title {
        display: inline-block;
        margin-#{$right}: 1rem;
        color: var(--alpha-dark-body-color);
        line-height: 2.2;
    }
}

.progress-wrapper {
    position: relative;
    height: 5px;
    background-color: var(--alpha-change-border-color);
    overflow: hidden;
}

.progress-bar {
    display: flex;
    align-items: center;
    width: 0;
    height: 100%;
    padding: 0 1.5rem;
    background-color: var(--alpha-dark-color);
    white-space: nowrap;
    transition: width ease-in 1s;
    
    .title {
        color: var(--alpha-white-color);
        line-height: 5px;
    }
    .progress-percentage {
        position: absolute;
        bottom: 100%;
        #{$right}: 0;
        padding: 0;
        line-height: 2.2;
        color: var(--alpha-white-color);
    }
}
.progress-inner-text {
    .progress-wrapper {
        height: auto;
    }
    .title {
        line-height: inherit;
    }
    .progress-percentage {
        top: 50%;
        bottom: auto;
        #{$right}: 1.5rem;
        line-height: 1;
        transform: translateY(-50%);
    }
}
.progress-inner-text.percent-end-progress .progress-percentage,
.progress-inner-text.percent-end-title .progress-percentage {
    color: var(--alpha-white-color);
}
.percent-end-progress {
    .progress-bar {
        position: relative;
    }
    .progress-percentage {
        opacity: 0;
        transition: opacity 1s;
    }
    .title-wrapper .progress-percentage {
        position: absolute;
        #{$left}: 0;
        opacity: 0;
        transform: translateX(-100%);
        transition: opacity 1s, #{$left} ease-in 1s;
    }
}
.percent-end-title .title + .progress-percentage {
    position: static;
    transform: none;
}
.percent-end-bar .title-wrapper .progress-percentage {
    margin-#{$left}: auto;
}
.progress-indicating .progress-bar {
    &:before {
        content: '';
        position: absolute;
        top: 0;
        #{$right}: 0;
        bottom: 0;
        #{$left}: 0;
        background-color: var(--alpha-white-color);
        border-radius: inherit;
        opacity: 0;
        animation: progress-active 3s ease 0s infinite;
    }
}

@keyframes progress-animated {
    0% { background-position: 2em 0; }
    to { background-position: 0 0; }
}
.progress-animated .progress-bar {
    background-image: linear-gradient( 45deg,rgba(255,255,255, .15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent );
    background-size: 2em 2em;
    animation: progress-animated 1s linear infinite;
}