/* ==========================================================================
   AI Loader - Page Loading Animation CSS
   Full-screen glow loader with rotating multi-tone box-shadow circle
   and pulsing sequential letters
   ========================================================================== */

.ai-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1a3379 0%, #0f172a 50%, #000000 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

[data-theme="light"] .ai-loader-overlay {
  background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 50%, #d1d5db 100%);
}

.ai-loader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ai-loader-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  user-select: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ai-loader-text {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.ai-loader-letter {
  display: inline-block;
  color: #ffffff;
  opacity: 0.4;
  animation: loaderLetter 3s infinite;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

[data-theme="light"] .ai-loader-letter {
  color: #1f2937;
  text-shadow: 0 0 8px rgba(0, 93, 255, 0.3);
}

.ai-loader-circle {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  animation: loaderCircle 5s linear infinite;
  pointer-events: none;
}

/* Keyframes - Rotating glowing multi-shade shadow ring */
@keyframes loaderCircle {
  0% {
    transform: rotate(90deg);
    box-shadow:
      0 6px 12px 0 #38bdf8 inset,
      0 12px 18px 0 #005dff inset,
      0 36px 36px 0 #1e40af inset,
      0 0 3px 1.2px rgba(56, 189, 248, 0.3),
      0 0 6px 1.8px rgba(0, 93, 255, 0.2);
  }
  50% {
    transform: rotate(270deg);
    box-shadow:
      0 6px 12px 0 #60a5fa inset,
      0 12px 6px 0 #0284c7 inset,
      0 24px 36px 0 #005dff inset,
      0 0 3px 1.2px rgba(56, 189, 248, 0.3),
      0 0 6px 1.8px rgba(0, 93, 255, 0.2);
  }
  100% {
    transform: rotate(450deg);
    box-shadow:
      0 6px 12px 0 #4dc8fd inset,
      0 12px 18px 0 #005dff inset,
      0 36px 36px 0 #1e40af inset,
      0 0 3px 1.2px rgba(56, 189, 248, 0.3),
      0 0 6px 1.8px rgba(0, 93, 255, 0.2);
  }
}

/* Keyframes - Sequential letter scale & brighten wave */
@keyframes loaderLetter {
  0%,
  100% {
    opacity: 0.4;
    transform: translateY(0) scale(1);
  }
  20% {
    opacity: 1;
    transform: translateY(-2px) scale(1.18);
  }
  40% {
    opacity: 0.7;
    transform: translateY(0) scale(1);
  }
}

/* Light mode shadow adjustments */
[data-theme="light"] .ai-loader-circle {
  box-shadow:
    0 6px 12px 0 #60a5fa inset,
    0 12px 18px 0 #3b82f6 inset,
    0 36px 36px 0 #2563eb inset,
    0 0 3px 1.2px rgba(96, 165, 250, 0.4),
    0 0 6px 1.8px rgba(59, 130, 246, 0.3);
}
