/* stylelint-disable block-no-empty */

/* ==========================================================================
   Config
   ========================================================================== */
$loading-line-height: 5px;
$loading-line-width: 32px;

/* ==========================================================================
   Styles
   ========================================================================== */
.gui-loading-overlay {
  background: rgba($neutral-base-lightest, .5);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;

  .gui-loading-overlay-text {
    @apply mt-0 mb-2;
  }

  .gui-gc-loader + .gui-loading-overlay-text {
    @apply mt-4;
  }

  .gui-line {
    animation-duration: 2s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
  }

  .gui-line-1 {
    animation-name: line1;
  }

  .gui-line-2 {
    animation-name: line2;
  }

  .gui-line-3 {
    animation-name: line3;
  }

  .gui-line-4 {
    animation-name: line4;
  }

  .gui-line-5 {
    animation-name: line5;
  }

  .gui-line-6 {
    animation-name: line6;
  }
}

@keyframes line1 {
  16.666666667% {
    transform: translateY(-$loading-line-height*2); opacity: 0;
  }
  33.333333334% {}
  50.000000001% {}
  66.666666668% {}
  83.333333335% {}
  100.00000000% { opacity: 0; }
}

@keyframes line2 {
  16.666666667% {
    transform: translateY(-$loading-line-height*2);
    opacity: 1;
  }

  33.333333334% {
    transform: translateY(-$loading-line-height*2);
    opacity: 1;
  }

  50.000000001% {
    transform: translateY(-$loading-line-height*4); opacity: 0;
  }
  66.666666668% {}
  83.333333335% {}
  100.00000000% { opacity: 0; }
}

@keyframes line3 {
  16.666666667% {
    transform: translateY(-$loading-line-height*2);
  }

  33.333333334% {
    transform: translateY(-$loading-line-height*2);
  }

  50.000000001% {
    transform: translateY(-$loading-line-height*4); opacity: 1;
  }

  66.666666668% {
    transform: translateY(-$loading-line-height*4); opacity: 1;
  }

  83.333333335% {
    transform: translateY(-$loading-line-height*6); opacity: 0;
  }
  100.00000000% { opacity: 0; }
}

@keyframes line4 {
  16.666666667% {}

  33.333333334% {
    transform: translateX($loading-line-width);
  }

  50.000000001% {
    transform: translateX($loading-line-width) translateY(-$loading-line-height*2);
  }

  66.666666668% {
    transform: translateX($loading-line-width) translateY(-$loading-line-height*2);
  }

  83.333333335% {
    transform: translateX($loading-line-width) translateY(-$loading-line-height*4);
  }

  100.00000000% {
    transform: translateX($loading-line-width) translateY(-$loading-line-height*4);
  }
}

@keyframes line5 {
  16.666666667% {}
  33.333333334% {}

  50.000000001% {
    transform: translateX(0);
  }

  66.666666668% {
    transform: translateX($loading-line-width);
  }

  83.333333335% {
    transform: translateX($loading-line-width) translateY(-$loading-line-height*2);
  }

  100.00000000% {
    transform: translateX($loading-line-width) translateY(-$loading-line-height*2);
  }
}

@keyframes line6 {
  16.666666667% {}
  33.333333334% {}
  50.000000001% {}
  66.666666668% {}

  83.333333335% {
    transform: translateX(0);
  }

  100.00000000% {
    transform: translateX($loading-line-width);
  }
}

.gui-loading-overlay--fixed {
  position: fixed;
}
