/* css/loader.css */

#global-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg, #050A18);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  font-family: 'Space Grotesk', sans-serif;
}

#global-loader-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.flux-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 400px;
}

.flux-label-container {
  height: 64px;
  position: relative;
  width: 100%;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flux-label {
  position: absolute;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-muted, #8FA3C8);
  text-align: center;
  letter-spacing: 1px;
  text-transform: lowercase;
  opacity: 0;
  transform: translateZ(-380px) scale(0.65);
  filter: blur(14px);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.flux-label.visible {
  opacity: 1;
  transform: translateZ(0) scale(1);
  filter: blur(0px);
}

.flux-label.exit {
  opacity: 0;
  transform: translateZ(220px) scale(1.35);
  filter: blur(10px);
}

.flux-bar-track {
  position: relative;
  height: 20px;
  width: 100%;
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  overflow: hidden;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.45), inset 0 -1px 2px rgba(255,255,255,0.05);
}

.flux-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  border-radius: 999px;
  width: 0%;
  /* Default Pilot Colors */
  --flux-from: #1d6ffb;
  --flux-to: #74e1ff;
  
  background: linear-gradient(90deg, var(--flux-from) 0%, color-mix(in oklab, var(--flux-from), var(--flux-to)) 35%, var(--flux-to) 55%, color-mix(in oklab, var(--flux-from), var(--flux-to)) 78%, var(--flux-from) 100%);
  box-shadow: 0 0 18px color-mix(in oklab, var(--flux-from) 55%, transparent), 0 0 32px color-mix(in oklab, var(--flux-to) 40%, transparent), inset 0 1.5px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 3px rgba(0, 40, 120, 0.35);

}

.flux-sheen {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  mix-blend-mode: screen;

  pointer-events: none;
}

#global-loader-overlay.active .flux-sheen {
  animation: sheen-sweep 1.6s linear infinite;
}

@keyframes sheen-sweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(210%); }
}

/* Faction Overrides */
body[data-clan="spacewalkers"] .flux-bar-fill {
  --flux-from: #555555;
  --flux-to: #ffffff;
}

body[data-clan="dreamers"] .flux-bar-fill {
  --flux-from: #6a00ff;
  --flux-to: #c77dff;
}
