@import 'mixins';

@include b(progress) {
  @include define(background, #f2f2f2);
  @include define(width, 100%);
  @include define(size, 150px);
  @include define(font-size, 24px);

  display: inline-block;
  position: relative;

  @include e(outer) {
    display: flex;
    align-items: center;
  }

  @include e(text) {
    display: inline-block;
    margin-left: r(5);
  }

  @include m(line) {
    @include progress-theme('background-color');

    @include m(lg) {
      width: 100%;

      @include e(text) {
        font-size: 16px;
      }
    }

    @include m(md) {
      width: var(--width);

      @include e(text) {
        font-size: calc(var(--font-size) * 2 / 3);
      }
    }

    @include m(sm) {
      width: 140px;

      @include e(text) {
        font-size: 14px;
      }
    }

    @include e(track) {
      width: 100%;
      height: 100%;
      background: var(--background);
      overflow: hidden;
    }

    @include e(thumb) {
      height: 100%;
      width: 0;
      transition: width 0.6s ease, background-color 0.6s ease;
    }
  }

  @include m(circle) {
    display: inline-block;
    @include progress-type();
    @include progress-theme('stroke');

    svg {
      width: 100%;
      height: 100%;
    }

    @include e(text) {
      display: block;
      position: absolute;
      top: 50%;
      left: 0;
      width: 100%;
      margin: 0;
      text-align: center;
      line-height: 1;
      transform: translateY(-50%);
    }

    @include m(lg) {
      width: 200px;
      height: 200px;

      @include e(text) {
        font-size: 30px;
      }
    }

    @include m(md) {
      width: var(--size);
      height: var(--size);

      @include e(text) {
        font-size: var(--font-size);
      }
    }

    @include m(sm) {
      width: 80px;
      height: 80px;

      @include e(text) {
        font-size: 18px;
      }
    }
  }

  @include m(semi-circle) {
    display: inline-block;
    @include progress-type();
    @include progress-theme('stroke');

    svg {
      width: 100%;
      height: 100%;
    }

    @include e(text) {
      display: block;
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      margin: 0;
      text-align: center;
      line-height: 1;
    }

    @include m(lg) {
      width: 200px;
      height: 100px;

      @include e(text) {
        font-size: 30px;
      }
    }

    @include m(md) {
      width: var(--size);
      height: calc(var(--size) / 2);

      @include e(text) {
        font-size: var(--font-size);
      }
    }

    @include m(sm) {
      width: 80px;
      height: 40px;

      @include e(text) {
        font-size: 18px;
      }
    }
  }
}
