/* ============================================================
   UI Ball — Minimal Pure CSS & SVG Loaders
   Inspired by Griffin Johnston (uiball.com)
   ============================================================ */

/* 1. Ring */
.uib-ring {
  --uib-size: 24px;
  --uib-color: currentColor;
  --uib-speed: 0.9s;
  --uib-stroke: 2.5px;
  position: relative;
  display: inline-block;
  height: var(--uib-size);
  width: var(--uib-size);
  border: var(--uib-stroke) solid rgba(0, 102, 178, 0.15);
  border-top-color: var(--uib-color);
  border-radius: 50%;
  animation: uibRingRotate var(--uib-speed) linear infinite;
  vertical-align: middle;
}

@keyframes uibRingRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* UI Ball Spinner Utility */
.uiball-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(0, 102, 178, 0.2);
  border-top-color: var(--color-brand-500, #0066b2);
  border-radius: 50%;
  animation: uibRingRotate 0.8s linear infinite;
  vertical-align: middle;
}

/* 2. Dot Wave */
.uib-dot-wave {
  --uib-size: 36px;
  --uib-color: currentColor;
  --uib-speed: 1s;
  --uib-dot-size: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: var(--uib-size);
  height: calc(var(--uib-dot-size) * 2);
  vertical-align: middle;
}

.uib-dot-wave__dot {
  width: var(--uib-dot-size);
  height: var(--uib-dot-size);
  border-radius: 50%;
  background-color: var(--uib-color);
  animation: uibDotWave var(--uib-speed) ease-in-out infinite;
}

.uib-dot-wave__dot:nth-child(2) { animation-delay: calc(var(--uib-speed) * 0.15); }
.uib-dot-wave__dot:nth-child(3) { animation-delay: calc(var(--uib-speed) * 0.3); }
.uib-dot-wave__dot:nth-child(4) { animation-delay: calc(var(--uib-speed) * 0.45); }

@keyframes uibDotWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 3. Orbit */
.uib-orbit {
  --uib-size: 28px;
  --uib-color: currentColor;
  --uib-speed: 1.5s;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--uib-size);
  width: var(--uib-size);
  vertical-align: middle;
}

.uib-orbit::before,
.uib-orbit::after {
  content: '';
  position: absolute;
  height: 60%;
  width: 60%;
  border-radius: 50%;
  background-color: var(--uib-color);
  animation: uibOrbit var(--uib-speed) linear infinite;
  transform: scale(0);
  opacity: 0.8;
}

.uib-orbit::after {
  animation-delay: calc(var(--uib-speed) / -2);
}

@keyframes uibOrbit {
  0%, 100% {
    transform: translate(0%) scale(0);
    opacity: 1;
  }
  50% {
    transform: translate(60%) scale(1);
    opacity: 0.4;
  }
}

/* 4. Ping */
.uib-ping {
  --uib-size: 24px;
  --uib-color: currentColor;
  --uib-speed: 1.2s;
  position: relative;
  display: inline-block;
  height: var(--uib-size);
  width: var(--uib-size);
  vertical-align: middle;
}

.uib-ping::before,
.uib-ping::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  background-color: var(--uib-color);
  animation: uibPing var(--uib-speed) cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.uib-ping::after {
  animation-delay: calc(var(--uib-speed) / -2);
}

@keyframes uibPing {
  0% { transform: scale(0); opacity: 0.8; }
  100% { transform: scale(1); opacity: 0; }
}

/* 5. Helix */
.uib-helix {
  --uib-size: 32px;
  --uib-color: currentColor;
  --uib-speed: 1.2s;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: var(--uib-size);
  height: 16px;
  vertical-align: middle;
}

.uib-helix__bar {
  width: 3px;
  height: 100%;
  background-color: var(--uib-color);
  border-radius: 2px;
  animation: uibHelix var(--uib-speed) ease-in-out infinite;
}

.uib-helix__bar:nth-child(2) { animation-delay: calc(var(--uib-speed) * -0.3); }
.uib-helix__bar:nth-child(3) { animation-delay: calc(var(--uib-speed) * -0.6); }

@keyframes uibHelix {
  0%, 100% { transform: scaleY(0.25); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}
