@import '../../core/stylesheets/variables.scss';

.md-progress {
  width: 100%;
  height: 4px;
  position: relative;
  overflow: hidden;
  transition: $swift-ease-out;

  &.md-indeterminate .md-progress-track {
    right: 0;

    &:before,
    &:after {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      will-change: left, right;
      content: '';
    }

    &:before {
      animation: progress-indeterminate 2.3s cubic-bezier(.65, .815, .735, .395) infinite;
    }

    &:after {
      animation: progress-indeterminate-short 2.3s cubic-bezier(.165, .84, .44, 1) infinite;
      animation-delay: 1.15s;
    }
  }

  &.md-progress-enter,
  &.md-progress-leave-active {
    opacity: 0;
    transform: scaleY(0) translateZ(0);
  }

  &.md-progress-enter-active {
    transform: scaleY(1) translateZ(0);
  }
}

.md-progress-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  transition: $swift-ease-out;
}

@keyframes progress-indeterminate {
  0% {
    right: 100%;
    left: -35%;
  }

  60% {
    right: -100%;
    left: 100%;
  }

  100% {
    right: -100%;
    left: 100%;
  }
}

@keyframes progress-indeterminate-short {
  0% {
    right: 100%;
    left: -200%;
  }

  60% {
    right: -8%;
    left: 107%;
  }

  100% {
    right: -8%;
    left: 107%;
  }
}
