/**
 * Aceternity UI Effects — Vanilla CSS Port
 * Based on aceternity.com components
 * Works in static HTML sites (ManxTreasureMap, ManxHub, ToolSwitcher, HaloAI)
 */

/* ─── GLOWING CARD ──────────────────────────────────────────────────── */
.ac-glow-card {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1.5rem;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}
.ac-glow-card:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}
/* JavaScript moves --mouse-x/--mouse-y via mousemove listener */
.ac-glow-card::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--glow-color, rgba(139,92,246,0.3)), transparent 60%);
  border-radius: 50%;
  transform: translate(calc(var(--mouse-x, 50%) - 150px), calc(var(--mouse-y, 50%) - 150px));
  pointer-events: none;
  transition: transform 0.1s ease;
  opacity: 0;
}
.ac-glow-card:hover::before { opacity: 1; }

/* ─── SHIMMER BUTTON ────────────────────────────────────────────────── */
.ac-shimmer-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  transition: background 0.3s, border-color 0.3s;
}
.ac-shimmer-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.2) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  background-position: 200% center;
  transition: background-position 0.6s ease;
}
.ac-shimmer-btn:hover::after {
  background-position: -200% center;
}
.ac-shimmer-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}

/* ─── SPOTLIGHT CARD ────────────────────────────────────────────────── */
.ac-spotlight {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
}
.ac-spotlight-inner {
  position: relative;
  z-index: 1;
  padding: 2rem;
}
.ac-spotlight::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%),
    rgba(255,255,255,0.06) 0%,
    transparent 60%
  );
  pointer-events: none;
}

/* ─── SPARKLES ──────────────────────────────────────────────────────── */
@keyframes ac-sparkle-in {
  0%   { opacity: 0; transform: scale(0) rotate(0deg); }
  50%  { opacity: 1; transform: scale(1) rotate(45deg); }
  100% { opacity: 0; transform: scale(0) rotate(90deg); }
}
.ac-sparkle {
  position: absolute;
  pointer-events: none;
  animation: ac-sparkle-in 1.5s ease-in-out infinite;
}
.ac-sparkle svg {
  fill: var(--sparkle-color, #DAA520);
}
.ac-sparkles-wrapper {
  position: relative;
  display: inline-block;
}

/* ─── TRACING BEAM ──────────────────────────────────────────────────── */
.ac-tracing-beam {
  position: relative;
  padding-left: 2.5rem;
}
.ac-tracing-beam::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--beam-color, #8B5CF6) 15%,
    var(--beam-color, #8B5CF6) 85%,
    transparent
  );
}
.ac-tracing-beam::after {
  content: '';
  position: absolute;
  left: -4px;
  top: var(--beam-progress, 0%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--beam-color, #8B5CF6);
  box-shadow: 0 0 10px var(--beam-color, #8B5CF6);
  transition: top 0.1s ease;
}

/* ─── BORDER BEAM ───────────────────────────────────────────────────── */
@keyframes ac-border-beam {
  0%   { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}
.ac-border-beam-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.ac-border-beam {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}
.ac-border-beam::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--beam-angle, 0deg),
    transparent 0deg,
    var(--beam-color, #8B5CF6) 60deg,
    transparent 120deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ac-rotate-beam 3s linear infinite;
}
@keyframes ac-rotate-beam {
  from { --beam-angle: 0deg; }
  to   { --beam-angle: 360deg; }
}
@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ─── ANIMATED GRADIENT TEXT ────────────────────────────────────────── */
@keyframes ac-gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.ac-gradient-text {
  background: linear-gradient(
    270deg,
    var(--grad-1, #DAA520),
    var(--grad-2, #8B4513),
    var(--grad-3, #228B22),
    var(--grad-2, #8B4513),
    var(--grad-1, #DAA520)
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ac-gradient-shift 5s ease infinite;
}

/* ─── FLOATING ANIMATION ────────────────────────────────────────────── */
@keyframes ac-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.ac-float { animation: ac-float 3s ease-in-out infinite; }
.ac-float-slow { animation: ac-float 5s ease-in-out infinite; }
.ac-float-fast { animation: ac-float 2s ease-in-out infinite; }

/* ─── NUMBER COUNTER ────────────────────────────────────────────────── */
.ac-counter {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  transition: all 0.5s ease;
}

/* ─── TYPED TEXT CURSOR ─────────────────────────────────────────────── */
@keyframes ac-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.ac-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: currentColor;
  margin-left: 2px;
  vertical-align: middle;
  animation: ac-blink 1s step-end infinite;
}

/* ─── BADGE ─────────────────────────────────────────────────────────── */
.ac-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.ac-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: ac-pulse 2s ease infinite;
}
@keyframes ac-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.6; }
}
