/**
 * Busy / loading state for submit buttons and primary actions.
 */

@keyframes zy-spin {
  to {
    transform: rotate(360deg);
  }
}

button.zy-btn-busy {
  position: relative;
  pointer-events: none;
  opacity: 0.9;
  cursor: progress !important;
  color: transparent !important;
  text-shadow: none !important;
}

button.zy-btn-busy *,
button.zy-btn-busy i,
button.zy-btn-busy b {
  visibility: hidden;
}

button.zy-btn-busy::after {
  visibility: visible;
  content: "";
  position: absolute;
  width: 1.15em;
  height: 1.15em;
  top: 50%;
  left: 50%;
  margin: -0.575em 0 0 -0.575em;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.96);
  animation: zy-spin 0.68s linear infinite;
  box-sizing: border-box;
}

/* Keep compact toolbar buttons from shrinking when label hides */
button.dash-btn-sm.zy-btn-busy {
  min-width: 6.5rem;
}

/* Inputs don't support reliable ::after spinners cross-browser — wait cursor + muted look */
input[type="submit"].zy-btn-busy {
  opacity: 0.75 !important;
  cursor: progress !important;
  pointer-events: none;
}

/* Dark buttons (outline spinner) — add both classes if needed */
button.zy-btn-busy-outline::after {
  border-color: rgba(15, 23, 42, 0.15);
  border-top-color: #0f172a;
}
