@use "variables";

// Progress
// Credit: https://css-tricks.com/html5-progress-element/
.progress {
  appearance: none;
  background: variables.$bg-color-dark;
  border: 0;
  border-radius: variables.$border-radius;
  color: variables.$primary-color;
  height: variables.$unit-1;
  position: relative;
  width: 100%;

  &::-webkit-progress-bar {
    background: transparent;
    border-radius: variables.$border-radius;
  }

  &::-webkit-progress-value {
    background: variables.$primary-color;
    border-radius: variables.$border-radius;
  }

  &::-moz-progress-bar {
    background: variables.$primary-color;
    border-radius: variables.$border-radius;
  }

  &:indeterminate {
    animation: progress-indeterminate 1.5s linear infinite;
    background: variables.$bg-color-dark linear-gradient(to right, variables.$primary-color 30%, variables.$bg-color-dark 30%) top left / 150% 150% no-repeat;

    &::-moz-progress-bar {
      background: transparent;
    }
  }
}

@keyframes progress-indeterminate {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
