/* ==========================================================================
   MicroSIS.ai · BorderBeam Runtime (vanilla port of components/ui/border-beam.tsx)
   Dynamic SVG offset-path border glow with padding-box / border-box mask intersect
   and automatic dark/light theme synchronization (#FAFAFA dark / #FF2056 light).
   ========================================================================== */

.bb-host {
  position: relative;
}

.bb-beam {
  --duration: 8;
  --border-width: 1.5px;
  --light-width: 260px;
  --light-color: #FF2056;
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  box-sizing: border-box;
  border: var(--border-width) solid transparent;
  -webkit-mask-clip: padding-box, border-box !important;
  mask-clip: padding-box, border-box !important;
  -webkit-mask-composite: xor !important;
  mask-composite: intersect !important;
  -webkit-mask-image: linear-gradient(transparent, transparent), linear-gradient(#ff0000, #ff0000);
  mask-image: linear-gradient(transparent, transparent), linear-gradient(#ff0000, #ff0000);
}

html[data-theme="dark"] .bb-beam {
  --light-color: #FAFAFA;
}

.bb-beam::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  border: var(--border-width) solid rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

html[data-theme="dark"] .bb-beam::before {
  border-color: rgba(255, 255, 255, 0.1);
}

.bb-beam-light {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--light-width);
  aspect-ratio: 1 / 1;
  background: radial-gradient(ellipse at center, var(--light-color) 0%, transparent 70%, transparent 100%);
  offset-path: var(--path);
  offset-distance: 0%;
  animation: bb-offset-orbit calc(var(--duration) * 1s) linear infinite;
  animation-delay: var(--bb-delay, 0s);
  will-change: offset-distance;
}

@keyframes bb-offset-orbit {
  0% {
    offset-distance: 0%;
  }
  100% {
    offset-distance: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bb-beam-light {
    animation: none;
    offset-distance: 18%;
  }
}
