/* ============================================================================
   TOROTO™ Branded Loading Animation System
   GPU-composited transform & opacity animations aligned with Calm Precision.
   ============================================================================ */

/* 1. Full-Page Loading Screen Overlay */
.toroto-fullpage-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #eff7f6 78%);
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.42s ease;
}

.toroto-fullpage-loader[data-loaded="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 2. Orbital Brand Glow Halo */
.toroto-loader-halo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toroto-loader-halo::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(24, 183, 167, 0.22) 0%, rgba(188, 233, 227, 0) 72%);
  animation: torotoHaloPulse 2.2s ease-in-out infinite;
  will-change: transform, opacity;
}

/* 3. Small Inline Loading Spinner */
.toroto-inline-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 2.2px solid rgba(24, 183, 167, 0.22);
  border-top-color: var(--toroto-fresh-teal, #18b7a7);
  border-right-color: var(--toroto-deep-teal, #0e6e72);
  animation: torotoRotate 0.78s linear infinite;
  will-change: transform;
}

.toroto-inline-spinner--light {
  border-color: rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-right-color: var(--toroto-soft-aqua, #bce9e3);
}

/* 4. Button Loading Indicator */
.toroto-btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toroto-btn-dot {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: currentColor;
  animation: torotoDotBounce 1.1s ease-in-out infinite;
  will-change: transform, opacity;
}

.toroto-btn-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.toroto-btn-dot:nth-child(3) {
  animation-delay: 0.32s;
}

/* 5. Top Page / Fetch Progress Bar Loader */
.toroto-page-progress {
  position: relative;
  height: 3px;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(188, 233, 227, 0.45);
}

.toroto-page-progress::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: 9999px;
  background: linear-gradient(90deg, transparent 0%, #18b7a7 45%, #0e6e72 100%);
  animation: torotoSlideBar 1.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  will-change: transform;
}

/* 6. Branded Skeleton Loading Animation */
.toroto-skeleton {
  position: relative;
  overflow: hidden;
  background: #e4efee;
  border-radius: 12px;
}

.toroto-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.58) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: torotoShimmer 1.6s ease-in-out infinite;
  will-change: transform;
}

/* 7. Water-Themed Ripple Pulse Ring (car wash active state) */
.toroto-water-ripple {
  position: relative;
}

.toroto-water-ripple::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 1.5px solid rgba(24, 183, 167, 0.55);
  animation: torotoWaterPulse 2.1s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

/* 8. Compact Mobile Loader */
.toroto-compact-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(188, 233, 227, 0.9);
  box-shadow: 0 8px 20px rgba(20, 43, 58, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: #142b3a;
}

@keyframes torotoRotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes torotoHaloPulse {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes torotoDotBounce {
  0%, 80%, 100% {
    transform: translateY(0) scale(0.85);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-3px) scale(1.05);
    opacity: 1;
  }
}

@keyframes torotoSlideBar {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(260%);
  }
}

@keyframes torotoShimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes torotoWaterPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.38);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toroto-loader-halo::before,
  .toroto-inline-spinner,
  .toroto-btn-dot,
  .toroto-page-progress::after,
  .toroto-skeleton::after,
  .toroto-water-ripple::after {
    animation: none !important;
  }
}
