$red: #c90414;
$blue: #1287cc;
$green: #00b217;
$yellow: #e89e00;
$orange: #c92f00;

@mixin innerColor( $color: #0db6e0 ) {
  background-color: transparentize( $color , 0.05 );
  background-image:
    linear-gradient(
        90deg,
        transparentize( lighten( $color, 5% ), 1 ) 10%,
        transparentize( lighten( $color, 10% ), 0.2 ) 30%,
        transparentize( lighten( $color, 15% ), 0 ) 70%,
        transparentize( lighten( $color, 10% ), 0.2 ) 80%,
        transparentize( lighten( $color, 5% ), 1 ) 90%
    ),
    linear-gradient(
        to right,
        transparentize( lighten( $color, 15% ), 1 ) 0%,
        transparentize( lighten( $color, 15% ), 0 ) 100%
    ),
    linear-gradient(
        to left,
        transparentize( lighten( $color, 15% ), 1 ) 0%,
        transparentize( lighten( $color, 15% ), 0 ) 100%
    );

  border-color: lighten( $color, 20% );

  box-shadow:
    0 0 0.6em lighten( $color, 10% ) inset,
    0 0 0.4em lighten( $color, 5% ) inset,
    0 0 0.5em transparentize( $color, 0.5),
    0 0 0.1em transparentize( lighten( $color, 50% ), 0.5);

}

.progress {
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.2);
  display: none;
  font-size: 1.2em;
  height: 20px;
  margin: 2rem;

  &--active .progress__bar {
    opacity: 1;
  }

  &__text {
    width: 20em;
    padding: 0 0.9em;
    position: absolute;

    em {
      font-style: normal;
    }

  }

  &__bar {
    color: white;
    font-size: 12px;
    font-weight: normal;
    text-shadow: 0 1px 1px rgba(0,0,0,0.6);
    line-height: 19px;

    display: block;
    position: relative;
    top: -1px;
    left: -1px;

    width: 0;
    height: 100%;
    opacity: 0;

    border: 1px solid;
    border-radius: 2px 0 0 2px;

    background-size: 100px 30px, 130px 30px, 130px 30px;
    background-position: -20% center, right center, left center;
    background-repeat: no-repeat, no-repeat, no-repeat;

    transition:
      opacity 0.2s ease,
      width 0.8s ease-out,
      background-color 1s ease,
      border-color 0.3s ease,
      box-shadow 1s ease;

    animation: pulse 2s ease-out infinite;

    @include innerColor($red);

    &--orange {

      @include innerColor($orange);

    }

    &--yellow {

      @include innerColor($yellow);

    }

    &--green {

      @include innerColor($green);

    }

    &--blue {

      @include innerColor($blue);

    }

    &:before,
    &:after {
      content: "";
      position: absolute;

      right: -1px;
      top: -10px;

      width: 1px;
      height: 40px;

    }

    &:before {
      width: 7px;
      right: -4px;
      background:
        radial-gradient(
            ellipse at center,
            rgba(255,255,255,0.4) 0%,
            rgba(255,255,255,0) 75%
        );

    }

    &:after {
      background:
        linear-gradient(
            to bottom,
            rgba(255,255,255,0) 0%,
            rgba(255,255,255,0.3) 25%,
            rgba(255,255,255,0.3) 75%,
            rgba(255,255,255,0) 100%
        );

    }

  }

  &--complete {

    .progress__bar {

      animation: none;
      border-radius: 2px;

      &:after,
      &:before {

        opacity: 0;

      }

    }

  }

}

@keyframes pulse {

  0% {
    background-position: -50% center, right center, left center;
  }

  100% {
    background-position: 150% center, right center, left center;
  }

}
