@import "./variables";

.f-loader {
  position: absolute;
  top: 0;
  left: 0;
  z-index: $zIndex * 1000000;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  img {
    position: relative;
    z-index: 1;
  }
  &.f-loader-variant-futuristic {
    img {
      animation: spin 2s linear infinite;
    }

    @keyframes spin {
      0% {
        transform: rotate(0deg);
      }
      100% {
        transform: rotate(360deg);
      }
    }
  }
  &.f-loader-type-page {
    position: fixed;
    .loading-text {
      font-size: 2.5rem;
    }
    &:before {
      content: "";
      width: 100%;
      height: 100%;
      position: fixed;
      top: 0;
      left: 0;
      background: $baseColor;
    }
  }

  &.f-loader-type-section {
    .loading-text {
      font-size: 2rem;
    }
    &:before {
      content: "";
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
      background: $baseColor;
    }
  }
  .loading-text {
    $dotSize: 2px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-top: 4rem;
    font-weight: 400;
    color: $themePrimaryColor;
    .dots {
      position: relative;
      margin-left: 2rem;
      left: -9999px;
      top: 5px;
      width: $dotSize;
      height: $dotSize;
      border-radius: 5px;
      background-color: $themePrimaryColor;
      color: $themePrimaryColor;
      box-shadow: 9999px 0 0 -5px $themePrimaryColor;
      animation: dots 1.5s infinite linear;
      animation-delay: 0.25s;
      &:before,
      &:after {
        content: "";
        margin-left: 0.5rem;
        display: inline-block;
        position: absolute;
        top: 0;
        width: $dotSize;
        height: $dotSize;
        border-radius: 5px;
        background-color: $themePrimaryColor;
        color: $themePrimaryColor;
      }
      &:before {
        box-shadow: 9984px 0 0 -5px $themePrimaryColor;
        animation: dotsBefore 1.5s infinite linear;
        animation-delay: 0s;
      }
      &:after {
        box-shadow: 10014px 0 0 -5px $themePrimaryColor;
        animation: dotsAfter 1.5s infinite linear;
        animation-delay: 0.5s;
      }
    }
    @keyframes dotsBefore {
      0% {
        box-shadow: 9984px 0 0 -5px $themePrimaryColor;
      }
      30% {
        box-shadow: 9984px 0 0 2px $themePrimaryColor;
      }
      60%,
      100% {
        box-shadow: 9984px 0 0 -5px $themePrimaryColor;
      }
    }

    @keyframes dots {
      0% {
        box-shadow: 9999px 0 0 -5px $themePrimaryColor;
      }
      30% {
        box-shadow: 9999px 0 0 2px $themePrimaryColor;
      }
      60%,
      100% {
        box-shadow: 9999px 0 0 -5px $themePrimaryColor;
      }
    }

    @keyframes dotsAfter {
      0% {
        box-shadow: 10014px 0 0 -5px $themePrimaryColor;
      }
      30% {
        box-shadow: 10014px 0 0 2px $themePrimaryColor;
      }
      60%,
      100% {
        box-shadow: 10014px 0 0 -5px $themePrimaryColor;
      }
    }
  }
}
