.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 1;

  &__spinner {
    max-width: 50px;
    max-height: 50px;
    min-width: 50px;
    min-height: 50px;
    border: var(--tide-booking-spinner-border);
    border-top-color: var(--tide-booking-spinner-border-top-color);
    border-radius: 50%;
    border-radius: 50%;
    animation: spin 2s linear infinite;

    &--dots {
      width: auto;
      height: auto;
      border: none;
      border-radius: initial;
      animation: initial;

      &:after {
        content: ' .';
        font-size: 20px;
        animation: dots 1s steps(5, end) infinite;
      }
    }
  }

  &--centered {
    width: 100%;
    align-items: center;
  }

  &__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px;
  }

  &__line {
    width: 45px;
    display: flex;
    justify-content: space-evenly;

    &__text {
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
      text-transform: lowercase;
      font-weight: 500;
      font-size: 14px;
      letter-spacing: 0.2px;

      &::before,
      &::after {
        content: attr(data-text);
      }

      &::before {
        color: var(--tide-booking-color-primary-light);
      }

      &::after {
        color: var(--tide-booking-color-primary);
        animation: text-animation 3.6s ease infinite;
        position: absolute;
        left: 0;
      }
    }
  }

  &__ball {
    list-style: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--tide-booking-color-primary-light);

    animation: bounce 2.1s ease-in-out infinite;

    &--1 {
      animation-delay: 0s;
    }

    &--2 {
      animation-delay: 0.3s;
    }

    &--3 {
      animation-delay: 0.6s;
    }
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes dots {
  0%,
  20% {
    color: rgba(0, 0, 0, 0);
    text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);
  }

  40% {
    color: var(--tide-booking-spinner-animation-color);
    text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);
  }

  60% {
    text-shadow: 0.25em 0 0 var(--tide-booking-spinner-animation-color), 0.5em 0 0 rgba(0, 0, 0, 0);
  }

  80%,
  100% {
    text-shadow: 0.25em 0 0 var(--tide-booking-spinner-animation-color), 0.5em 0 0 var(--tide-booking-spinner-animation-color);
  }
}

@keyframes bounce {
  50% {
    transform: translateY(-18px);
    background-color: var(--tide-booking-color-primary);
  }
}

@keyframes text-animation {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  50% {
    clip-path: inset(0);
  }
  100% {
    clip-path: inset(0 0 0 100%);
  }
}
