@import "mixins/mixins";
@import "common/var";

@include b(loading-parent) {
  @include m(relative) {
    position: relative !important;
  }

  @include m(hidden) {
    overflow: hidden !important;
  }
}

@include b(loading-mask) {
  position: absolute;
  z-index: 2000;
  background-color: rgba(255, 255, 255, .9);
  margin: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transition: opacity 0.3s;

  @include when(fullscreen) {
    position: fixed;

    .el-loading-spinner {
      margin-top: #{- $--loading-fullscreen-spinner-size / 2};

      .circular {
        height: $--loading-fullscreen-spinner-size;
        width: $--loading-fullscreen-spinner-size;
      }
    }
  }
}

@include b(loading-spinner) {
  display: flex;
  justify-content: center;
  align-items: center;
  top: 50%;
  margin-top: #{- $--loading-spinner-size / 2};
  width: 100%;
  text-align: center;
  position: absolute;

  .el-loading-text {
    color: $--color-primary;
    margin: 3px 8px;
    font-size: 14px;
  }

  .circular {
    height: $--loading-spinner-size;
    width: $--loading-spinner-size;
    animation: loading-rotate 2s linear infinite;
  }

  .path {
    stroke-dasharray: 200, 200;
    stroke-dashoffset: 0;
    stroke-width: 6;
    stroke-linecap: round;
  }

  i {
    color: $--color-primary;
  }
}

.el-loading-fade-enter,
.el-loading-fade-leave-active {
  opacity: 0;
}

@keyframes loading-rotate {
  100% {
    transform: rotate(360deg);
  }
}
