/**
 * @file
 * HCA Pageloader styles. All tunables arrive as CSS custom properties set
 * by the JS from module settings.
 */

.hca-pl {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hca-pl-height, 3px);
  z-index: var(--hca-pl-z, 1090);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.hca-pl--visible {
  opacity: 1;
}

.hca-pl__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--hca-pl-start, #3b82f6) 0%, var(--hca-pl-end, #6366f1) 100%);
  transition: width 0.25s ease;
  position: relative;
}

/* Comet head: bright glow at the leading edge (NProgress-style peg). */
.hca-pl--comet .hca-pl__bar::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 80px;
  height: 100%;
  box-shadow: 0 0 10px var(--hca-pl-end, #6366f1), 0 0 5px var(--hca-pl-end, #6366f1);
  transform: rotate(3deg) translateY(-2px);
  opacity: 0.9;
}

/* Dark mode: the whole bar glows in the theme's shadow language. */
[data-bs-theme="dark"] .hca-pl--glow .hca-pl__bar {
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.65), 0 1px 18px rgba(59, 130, 246, 0.35);
}

/* Optional suppression of core AJAX throbbers when the bar covers AJAX. */
html.hca-pl-no-throbber .ajax-progress-throbber,
html.hca-pl-no-throbber .ajax-progress.ajax-progress-throbber {
  display: none !important;
}

/* Reduced motion: keep the bar (it conveys real state) but stop the
   decorative transitions. */
@media (prefers-reduced-motion: reduce) {
  .hca-pl,
  .hca-pl__bar {
    transition: none;
  }
}
