/* ==========================================================================
   INNOVERSE PRELOADER STYLE
   Controls: Solid black overlay, layered SVG glowing arc, anamorphic lens flares
   ========================================================================== */

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 999999; /* Higher than headers, particles, cursors */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
  overflow: hidden;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Glow Arc Container holding SVG and lens flare lines */
.glow-arc-container {
  position: relative;
  width: 340px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  animation: preloader-float 2.8s infinite alternate ease-in-out;
}

.glow-arc-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 2;
}

/* Center Horizontal flare matching the image */
.flare-overlay {
  position: absolute;
  width: 120%;
  height: 3px;
  background: linear-gradient(90deg, 
    rgba(0, 240, 255, 0) 0%, 
    rgba(0, 240, 255, 0.8) 35%, 
    rgba(255, 255, 255, 0.98) 50%, 
    rgba(0, 240, 255, 0.8) 65%, 
    rgba(0, 240, 255, 0) 100%
  );
  top: 61%; /* Centered with the arc peak */
  left: -10%;
  transform: translateY(-50%);
  filter: blur(2px) drop-shadow(0 0 10px rgba(0, 240, 255, 0.95));
  opacity: 0.9;
  z-index: 1;
  animation: pulse-flare 2.5s infinite alternate ease-in-out;
}

/* Anamorphic slanted flare beams in the background ("X" pattern) */
.anamorphic-flare-1,
.anamorphic-flare-2 {
  position: absolute;
  width: 140%;
  height: 1.5px;
  background: linear-gradient(90deg, 
    rgba(161, 0, 255, 0) 0%, 
    rgba(0, 240, 255, 0.15) 30%, 
    rgba(0, 240, 255, 0.35) 50%, 
    rgba(0, 240, 255, 0.15) 70%, 
    rgba(161, 0, 255, 0) 100%
  );
  top: 61%;
  left: -20%;
  transform-origin: center;
  filter: blur(1.5px);
  opacity: 0.55;
  z-index: 0;
}

.anamorphic-flare-1 {
  transform: translateY(-50%) rotate(3deg);
}

.anamorphic-flare-2 {
  transform: translateY(-50%) rotate(-3deg);
}

/* Animated glow sweep line along the curve */
.sweep-line {
  stroke-dasharray: 60, 280;
  stroke-dashoffset: 340;
  animation: sweep 2.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.9));
}

/* Loading Text Styling */
.preloader-text {
  margin-top: 15px;
  font-family: var(--font-body), sans-serif;
  font-size: 0.95rem;
  letter-spacing: 2.5px;
  color: rgba(255, 255, 255, 0.5);
  animation: text-blink 1.8s infinite ease-in-out;
  font-weight: 500;
}

/* KEYFRAMES */

@keyframes pulse-flare {
  0% {
    opacity: 0.75;
    transform: translateY(-50%) scaleX(0.96);
    filter: blur(2px) drop-shadow(0 0 8px rgba(0, 240, 255, 0.8));
  }
  100% {
    opacity: 0.95;
    transform: translateY(-50%) scaleX(1.04);
    filter: blur(2.5px) drop-shadow(0 0 13px rgba(0, 240, 255, 1));
  }
}

@keyframes sweep {
  0% {
    stroke-dashoffset: 340;
  }
  100% {
    stroke-dashoffset: -60;
  }
}

@keyframes text-blink {
  0%, 100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
  }
}

@keyframes preloader-float {
  0% {
    transform: translateY(4px);
  }
  100% {
    transform: translateY(-8px);
  }
}
