.ai-loading-overlay,
.ai-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(0, 255, 255, 0.18), transparent 35%),
    radial-gradient(circle at bottom, rgba(140, 0, 255, 0.22), transparent 40%),
    rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.ai-loading-overlay.active,
.ai-popup-overlay.active {
  display: flex;
}

.ai-loader-box,
.ai-popup-box {
  width: min(92%, 420px);
  padding: 34px 28px;
  text-align: center;
  color: #ffffff;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.92)),
    radial-gradient(circle at top, rgba(0, 255, 255, 0.16), transparent 45%);
  box-shadow:
    0 0 40px rgba(0, 255, 255, 0.18),
    0 0 90px rgba(99, 102, 241, 0.18),
    inset 0 0 30px rgba(255, 255, 255, 0.03);
  animation: aiPopIn 0.35s ease both;
}

.ai-orb {
  width: 86px;
  height: 86px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 3px solid rgba(0, 255, 255, 0.18);
  border-top-color: #22d3ee;
  border-right-color: #a855f7;
  box-shadow:
    0 0 22px rgba(34, 211, 238, 0.75),
    0 0 52px rgba(168, 85, 247, 0.4);
  animation: aiSpin 1s linear infinite;
}

.ai-loader-title,
.ai-popup-box h3 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(90deg, #67e8f9, #a78bfa, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ai-loader-text,
.ai-popup-box p {
  margin: 0;
  color: rgba(226, 232, 240, 0.86);
  line-height: 1.6;
  font-size: 15px;
}

.ai-loader-line {
  position: relative;
  overflow: hidden;
  height: 5px;
  margin-top: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.ai-loader-line::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #a855f7, #f0abfc);
  animation: aiLine 1.15s ease-in-out infinite;
}

.ai-popup-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 42px;
  font-weight: 900;
  color: #07111f;
  background: linear-gradient(135deg, #22d3ee, #a7f3d0);
  box-shadow:
    0 0 24px rgba(34, 211, 238, 0.7),
    0 0 58px rgba(16, 185, 129, 0.28);
}

.ai-popup-icon.error {
  background: linear-gradient(135deg, #fb7185, #f97316);
  box-shadow:
    0 0 24px rgba(251, 113, 133, 0.65),
    0 0 58px rgba(249, 115, 22, 0.25);
}

#aiPopupButton {
  margin-top: 24px;
  width: 100%;
  border: 0;
  cursor: pointer;
  padding: 14px 18px;
  border-radius: 16px;
  color: #020617;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  box-shadow: 0 12px 35px rgba(34, 211, 238, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#aiPopupButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 45px rgba(168, 85, 247, 0.32);
}

body.ai-lock {
  overflow: hidden;
}

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

@keyframes aiLine {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(240%);
  }
}

@keyframes aiPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(18px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
