/* ==========================================================================
   LOCUS-SF Action HUD — Bespoke Loader & Celebration System
   Crafted with refined micro-interactions, spring curves, and zero AI slop
   ========================================================================== */

.locus-action-hud {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
}

.locus-action-hud.is-visible {
  opacity: 1;
  visibility: visible;
}

.locus-action-hud.locus-hud-hidden {
  display: none;
}

.locus-hud-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.locus-hud-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 32px));
  background: #ffffff;
  border-radius: 32px;
  padding: 36px 32px 30px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 25px 60px -12px rgba(17, 34, 77, 0.22), 0 0 0 1px rgba(17, 34, 77, 0.04);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
}

.locus-action-hud.is-visible .locus-hud-card {
  transform: scale(1) translateY(0);
}

.locus-hud-visual {
  position: relative;
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.locus-hud-spinner {
  width: 60px;
  height: 60px;
}

.locus-hud-spin-svg {
  width: 100%;
  height: 100%;
  animation: locusHudRotate 1s linear infinite;
}

.locus-hud-spin-track {
  stroke: #f1f5f9;
}

.locus-hud-spin-head {
  stroke: #8B151B; /* San Fernando burgundy */
  animation: locusHudDash 1.4s ease-in-out infinite;
}

@keyframes locusHudRotate {
  100% { transform: rotate(360deg); }
}

@keyframes locusHudDash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; stroke: #11224D; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; stroke: #8B151B; }
}

.locus-hud-badge {
  position: relative;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: locusHudPop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes locusHudPop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.locus-hud-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.38) 0%, rgba(16, 185, 129, 0) 70%);
  animation: locusHudPulse 2s ease-in-out infinite;
}

@keyframes locusHudPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.22); opacity: 0.45; }
}

.locus-hud-check-svg {
  width: 64px;
  height: 64px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.38));
}

.locus-hud-check {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: locusHudDrawCheck 0.42s 0.12s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes locusHudDrawCheck {
  to { stroke-dashoffset: 0; }
}

.locus-hud-title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.locus-hud-sub {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.5;
  max-width: 340px;
}

.locus-hud-progress-pill {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

.locus-hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8B151B;
  animation: locusHudDotPulse 1.2s ease-in-out infinite;
}

.locus-hud-card.is-celebrating .locus-hud-dot {
  background: #10B981;
  animation: none;
}

.locus-hud-card.is-celebrating .locus-hud-progress-pill {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

@keyframes locusHudDotPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Flash animation on approved card in listing view */
@keyframes locusCardApprovedGlow {
  0% {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.7), 0 10px 30px rgba(16, 185, 129, 0.25);
    border-color: #10B981 !important;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.35), 0 14px 36px rgba(16, 185, 129, 0.18);
    border-color: #10B981 !important;
  }
  100% {
    box-shadow: 0 1px 3px 0 rgba(17, 34, 77, 0.03), 0 8px 24px -4px rgba(17, 34, 77, 0.05);
    border-color: rgba(220, 226, 235, 0.9);
  }
}

.locus-approved-highlight {
  animation: locusCardApprovedGlow 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
