/* ──────────────────────────────────────────────────────────
   Global loading bar
   Thin animated gradient line fixed at the very top of the
   viewport. Uses the same gradient colors as the Logo10x
   SVG, at reduced opacity for a light/subtle appearance.
   ────────────────────────────────────────────────────────── */

.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  overflow: hidden;
  background: transparent;
}

.loading-bar-active {
  opacity: 1;
}

.loading-bar-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(
    90deg,
    rgba(8, 148, 255, 0)   0%,
    rgba(8, 148, 255, 0.6) 12%,
    rgba(100, 98, 234, 0.7) 28%,
    rgba(189, 50, 214, 0.7) 44%,
    rgba(100, 98, 234, 0.7) 60%,
    rgba(8, 148, 255, 0.7)  76%,
    rgba(255, 163, 4, 0.6)  92%,
    rgba(255, 163, 4, 0)    100%
  );
  background-size: 200% 100%;
  animation: loading-bar-slide 1.4s linear infinite;
  box-shadow: 0 0 6px rgba(100, 98, 234, 0.35);
}

@keyframes loading-bar-slide {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .loading-bar {
    height: 2.5px;
  }
  .loading-bar-indicator {
    animation-duration: 1.2s;
    box-shadow: 0 0 4px rgba(100, 98, 234, 0.3);
  }
}

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .loading-bar {
    transition: opacity 120ms ease;
  }
  .loading-bar-indicator {
    animation: loading-bar-pulse 1.6s ease-in-out infinite;
    background: linear-gradient(
      90deg,
      rgba(8, 148, 255, 0.5),
      rgba(189, 50, 214, 0.6),
      rgba(100, 98, 234, 0.6),
      rgba(8, 148, 255, 0.5),
      rgba(255, 163, 4, 0.5)
    );
    background-size: 100% 100%;
  }
  @keyframes loading-bar-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
  }
}
