@use "../../libs/css/theme" as *;
@use "../../libs/css/mixin" as *;


@include b(loading-icon) {
  align-items: center;
  justify-content: center;
  color: #c8c9cc;

  @include e(text) {
    color: $hy-text-color--grey;
    font-size: 14px;
    line-height: 20px;
  }

  @include e(spinner) {
    width: 30px;
    height: 30px;
    position: relative;
    /* #ifndef APP-NVUE */
    box-sizing: border-box;
    max-width: 100%;
    max-height: 100%;
    animation: hy-rotate 1s linear infinite;
    /* #endif */

    @include m(semicircle) {
      border: 2px solid transparent;
      border-radius: 50%;
    }

    @include m(circle) {
      border-radius: 50%;
      border: 2px solid #e5e5e5;
    }
  }

  @include e(row) {
    @include flex(row);

    @include m(text) {
      margin-left: $hy-border-margin-padding-base;
    }
  }

  @include e(column) {
    @include flex(column);

    @include m(text) {
      margin-top: $hy-border-margin-padding-base;
    }
  }
}

/* #ifndef APP-NVUE */
:host {
  font-size: 0;
  line-height: 1px;
}

@include b(loading-icon) {
  @include e(spinner) {
    @include m(spinner) {
      animation-timing-function: steps(12);
    }
  }

  &__text:empty {
    display: none;
  }

  @include e(vertical, text) {
    color: $hy-text-color--grey;
  }

  @include e(dot) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    &:before {
      /* #ifndef APP-NVUE */
      display: block;
      /* #endif */
      width: 2px;
      height: 25%;
      margin: 0 auto;
      background-color: currentColor;
      border-radius: 40%;
      content: " ";
    }
  }
}

@for $i from 1 through 12 {
  .hy-loading-icon__dot:nth-of-type(#{$i}) {
    transform: rotate($i * 30deg);
    opacity: 1 - 0.0625 * ($i - 1);
  }
}

@keyframes hy-rotate {
  0% {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(1turn);
  }
}

/* #endif */