/* Loading Screen Module Styles */

/* Animation duration variable */
:root {
  --loading-star-animation-duration: 1.5s;
}

/* Main loading screen container */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.loading-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #020931;
  z-index: 1;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Peak brightness detection */
.peak-brightness-trigger {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  animation: peak-brightness-detect calc(var(--loading-star-animation-duration) / 2) infinite linear;
}

@keyframes peak-brightness-detect {
  0%,
  100% {
    opacity: 0;
  }
}

/* Star glow container and effect */
.loading-star-glow-container {
  position: absolute;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  transform: translate3d(0, 0, 0);
}

.loading-star-glow {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: rgba(250, 243, 148, 0.4);
  animation: loading-glow-circle var(--loading-star-animation-duration) ease-in-out infinite;
  will-change: opacity, filter, transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

/* Star SVG styling */
.loading-star {
  overflow: visible;
  display: block;
  width: 60px;
  height: 60px;
  position: relative;
  z-index: 3;
}

.loading-star-path {
  animation: loading-path var(--loading-star-animation-duration) ease-in-out infinite;
  will-change: fill-opacity;
  backface-visibility: hidden;
  fill: #faf394;
  stroke-width: 0px;
}

/* Animation keyframes */
@keyframes loading-path {
  0%,
  100% {
    fill-opacity: 0.15;
  }
  50% {
    fill-opacity: 1;
  }
}

@keyframes loading-glow-circle {
  0%,
  100% {
    opacity: 0.3;
    transform: translate3d(0, 0, 0) scale(0.85);
    filter: blur(5px) drop-shadow(0 0 0.8em #faf394) drop-shadow(0 0 1.5em #faf394) drop-shadow(0 0 4em #ffffff);
    box-shadow: 0 0 15px 5px rgba(250, 243, 148, 0.3);
  }
  50% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1.1);
    filter: blur(8px) drop-shadow(0 0 1.2em #faf394) drop-shadow(0 0 2.5em #faf394) drop-shadow(0 0 6em #ffffff);
    box-shadow: 0 0 30px 10px rgba(250, 243, 148, 0.5);
  }
}
