/*
Spinner Styling for initial loading
https://stackoverflow.com/questions/22531861/ring-shaped-process-spinner-with-fading-gradient-effect-around-the-ring
*/
@keyframes rotate {
  from { transform: rotate(0deg);   }
  to   { transform: rotate(360deg); }
}

.spinner {
  animation: rotate 1s linear infinite;
  background: $sky-blue-400;
  border-radius: 50%;
  height: 64px;
  width: 64px;
  position: relative;
  z-index: 9999;
}

.spinner::before,
.spinner::after {
  content: '';
  position: absolute;
}

.spinner::before {
  border-radius: 50%;
  background:
    linear-gradient(0deg,   rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0.9) 100%)   0%   0%,
    linear-gradient(90deg,  rgba(255, 255, 255, 0.9)  0%, rgba(255, 255, 255, 0.6) 100%) 100%   0%,
    linear-gradient(180deg, rgba(255, 255, 255, 0.6)  0%, rgba(255, 255, 255, 0.3) 100%) 100% 100%,
    linear-gradient(360deg, rgba(255, 255, 255, 0.3)  0%, rgba(255, 255, 255, 0) 100%)   0% 100%
;
  background-repeat: no-repeat;
  background-size: 50% 50%;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.spinner::after {
  background: $base-white;
  border-radius: 50%;
  top: 8px;
  bottom: 8px;
  left: 8px;
  right: 8px;
}

.spinner-logo {
  position: absolute;
  z-index: 10000;
}

@media screen and (max-width: map_get($base-breakpoints, 'lg')) {
  .spinner {
    width: 42px;
    height: 42px;

    top: calc(50% - 21px) !important;
    left: calc(50% - 21px) !important;

    &-logo {
      top: calc(50% - 10px) !important;
      left: calc(50% - 8px) !important;

      svg {
        width: 16px;
        height: 20px;
      }
    }

    &::after {
      top: 5px;
      bottom: 5px;
      left: 5px;
      right: 5px;
    }
  }
}

@media screen and (max-width: map_get($base-breakpoints, 'md')) {
  .spinner {
    width: 24px;
    height: 24px;

    top: calc(50% - 12px) !important;
    left: calc(50% - 12px) !important;

    &-logo {
      top: calc(50% - 7.5px) !important;
      left: calc(50% - 6px) !important;

      svg {
        width: 12px;
        height: 15px;
      }
    }

    &::after {
      top: 3px;
      bottom: 3px;
      left: 3px;
      right: 3px;
    }
  }
}

.spinner-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 13;

  .spinner {
    top: calc(50% - 32px);
    left: calc(50% - 32px);

    &-logo {
      position: absolute;
      top: calc(50% - 15px);
      left: calc(50% - 12px);
    }
  }
}
