/* === Progress Bar === */
.progressbar, .progressbar-infinite {
    height: 4px;
    width: 100%;
    overflow: hidden;
    display: block;
    position: relative;
    .transform-origin(center bottom);
    background: rgba(red(@themeColor), green(@themeColor), blue(@themeColor), 0.5);
}
// Determined
.progressbar {
    display: block;
    vertical-align: middle;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    span {
        content: '';
        width: 100%;
        background: @themeColor;
        height: 100%;
        position: absolute;
        left: 0;
        top: 0;
        .translate3d(-100%, 0, 0);
        .transition(150ms);
    }
}
// Infinite
.progressbar-infinite {
    z-index: 15000;
    &:before, &:after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: @themeColor;
        .transform-origin(left center);
    }
    &:before {
        .animation(progressbar-infinite-1 2s linear infinite);
    }
    &:after {
        .animation(progressbar-infinite-2 2s linear infinite);
    }
    html.with-statusbar-overlay body > &, html.with-statusbar-overlay .framework7-root > & {
        top: 20px;
    }
}


// Multicolor
.progressbar-infinite.color-multi {
    background: none !important;
    &:before, &:after {
        width: 100%;
        animation: none;
    }
    &:before {
        background: none;
        .animation(progressbar-infinite-multicolor-bg 3s step-end infinite);
    }
    &:after {
        background: none;
        .animation(progressbar-infinite-multicolor-fill 3s linear infinite);
        .transform-origin(center center);
    }
}

body, .view, .views, .page, .panel, .popup, .framework7-root {
    > .progressbar, > .progressbar-infinite {
        position: absolute;
        left: 0;
        top: 0;
        z-index: 15000;
        .transform-origin(center top);
    }
}
// Animations
.progressbar-in {
    .animation(progressbar-in 300ms forwards);
}
.progressbar-out {
    .animation(progressbar-out 300ms forwards);
}

html.with-statusbar-overlay body > .progressbar, html.with-statusbar-overlay .framework7-root > .progressbar {
    top: 20px;
}
@-webkit-keyframes progressbar-in {
    from {
        opacity: 0;
        -webkit-transform: scaleY(0);
    }
    to {
        opacity: 1;
        -webkit-transform: scaleY(1);
    }
}
@keyframes progressbar-in {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}
@-webkit-keyframes progressbar-out {
    from {
        opacity: 1;
        -webkit-transform: scaleY(1);
    }
    to {
        opacity: 0;
        -webkit-transform: scaleY(0);
    }
}
@keyframes progressbar-out {
    from {
        opacity: 1;
        transform: scaleY(1);
    }
    to {
        opacity: 0;
        transform: scaleY(0);
    }
}
@-webkit-keyframes progressbar-infinite-1 {
    0% {
        -webkit-transform: translateX(-10%) scaleX(0.1);
    }
    25% {
        -webkit-transform: translateX(30%) scaleX(0.6);
    }
    50% {
        -webkit-transform: translateX(100%) scaleX(1);
    }
    100% {
        -webkit-transform: translateX(100%) scaleX(1);
    }
}
@keyframes progressbar-infinite-1 {
    0% {
        transform: translateX(-10%) scaleX(0.1);
    }
    25% {
        transform: translateX(30%) scaleX(0.6);
    }
    50% {
        transform: translateX(100%) scaleX(1);
    }
    100% {
        transform: translateX(100%) scaleX(1);
    }
}
@-webkit-keyframes progressbar-infinite-2 {
    0% {
        -webkit-transform: translateX(-100%) scaleX(1);
    }
    40% {
        -webkit-transform: translateX(-100%) scaleX(1);
    }
    75% {
        -webkit-transform: translateX(60%) scaleX(0.35);
    }
    90% {
        -webkit-transform: translateX(100%) scaleX(0.1);
    }
    100% {
        -webkit-transform: translateX(100%) scaleX(0.1);
    }
}
@keyframes progressbar-infinite-2 {
    0% {
        transform: translateX(-100%) scaleX(1);
    }
    40% {
        transform: translateX(-100%) scaleX(1);
    }
    75% {
        transform: translateX(60%) scaleX(0.35);
    }
    90% {
        transform: translateX(100%) scaleX(0.1);
    }
    100% {
        transform: translateX(100%) scaleX(0.1);
    }
}

@-webkit-keyframes progressbar-infinite-multicolor-bg {
    0% {
        background-color: @green;
    }
    25% {
        background-color: @red;
    }
    50% {
        background-color: @blue;
    }
    75% {
        background-color: @yellow;
    }
}
@keyframes progressbar-infinite-multicolor-bg {
    0% {
        background-color: @green;
    }
    25% {
        background-color: @red;
    }
    50% {
        background-color: @blue;
    }
    75% {
        background-color: @yellow;
    }
}
@-webkit-keyframes progressbar-infinite-multicolor-fill {
    0% {
        -webkit-transform: scaleX(0);
        background-color: @red;
    }
    24.9% {
        -webkit-transform: scaleX(1);
        background-color: @red;
    }
    25% {
        -webkit-transform: scaleX(0);
        background-color: @blue;
    }
    49.9% {
        -webkit-transform: scaleX(1);
        background-color: @blue;
    }
    50% {
        -webkit-transform: scaleX(0);
        background-color: @yellow;
    }
    74.9% {
        -webkit-transform: scaleX(1);
        background-color: @yellow;
    }
    75% {
        -webkit-transform: scaleX(0);
        background-color: @green;
    }
    100% {
        -webkit-transform: scaleX(1);
        background-color: @green;
    }
}
@keyframes progressbar-infinite-multicolor-fill {
    0% {
        transform: scaleX(0);
        background-color: @red;
    }
    24.9% {
        transform: scaleX(1);
        background-color: @red;
    }
    25% {
        transform: scaleX(0);
        background-color: @blue;
    }
    49.9% {
        transform: scaleX(1);
        background-color: @blue;
    }
    50% {
        transform: scaleX(0);
        background-color: @yellow;
    }
    74.9% {
        transform: scaleX(1);
        background-color: @yellow;
    }
    75% {
        transform: scaleX(0);
        background-color: @green;
    }
    100% {
        transform: scaleX(1);
        background-color: @green;
    }
}