@use "../mixins/function.scss" as *;
@use "../mixins/mixins.scss" as *;
@use "../common/var.scss" as *;

@include b(progress) {
  display: inline-block;
  width: 100%;
  position: relative;
  line-height: 1.5715;
  font-size: getCssVar("font-size", "mini");
  @include e(wrapper) {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 12px;
  }
  @include e(line) {
    background-color: getCssVar("color", "fill-2");
    border-radius: getCssVar("radius", "round");
    width: 100%;
    position: relative;
    display: inline-block;
    overflow: hidden;
  }
  @include e(line-bar) {
    height: 100%;
    border-radius: getCssVar("radius", "round");
    position: relative;
    transition:
      width 0.6s getCssVar("bezier", "1"),
      background 0.3s getCssVar("bezier", "1");
    max-width: 100%;
  }
  @include e(line-text) {
    font-size: getCssVar("font-size", "mini");
    color: getCssVar("color", "text-1");
    white-space: nowrap;
    text-align: right;
    flex-grow: 1;
    flex-shrink: 0;
    min-width: 32px;
  }
  @include e(steps) {
    display: flex;
    width: 100%;
    gap: 4px;
  }
  @include e(step-item) {
    flex: 1;
    height: 100%;
    background-color: getCssVar("color", "fill-2");
    &:first-of-type {
      border-top-left-radius: getCssVar("radius", "round");
      border-bottom-left-radius: getCssVar("radius", "round");
    }
    &:last-of-type {
      border-top-right-radius: getCssVar("radius", "round");
      border-bottom-right-radius: getCssVar("radius", "round");
    }
  }
  @each $type in $type-list {
    @include m(#{$type}) {
      @include be(progress, line-bar) {
        background-color: getCssVar("color", $type + "-6");
      }
      @include be(progress, step-item) {
        @include when(active) {
          background-color: getCssVar("color", $type + "-6");
        }
      }
    }
  }
}
