/* Loading overlay: full-screen + Idea Forge logo with circular progress ring.
   Ring fills 0 -> 95% linearly over the ETA returned by /api/generation/eta,
   then snaps to 100% when the real response arrives. */

.ix-overlay {
  position: fixed;
  inset: 0;
  background: rgba(246, 244, 251, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 1000;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1B1655;
}

.ix-overlay__caption {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
}

.ix-overlay__sub {
  font-size: 0.8rem;
  color: #5B5180;
  text-align: center;
  max-width: 26rem;
}

.ix-spinner {
  position: relative;
  width: 220px;
  height: 220px;
}

.ix-spinner__logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.ix-spinner__logo img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  animation: ix-logo-pulse 2.4s ease-in-out infinite;
  transform-origin: center;
}

.ix-spinner svg {
  position: relative;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  z-index: 1;
  pointer-events: none;
}

@keyframes ix-logo-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(124, 58, 237, 0));
  }
  50% {
    opacity: 0.78;
    transform: scale(0.94);
    filter: drop-shadow(0 0 18px rgba(124, 58, 237, 0.35));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ix-spinner__logo img { animation: none; }
}

.ix-spinner circle {
  fill: none;
  stroke-width: 8;
}

.ix-spinner__track {
  stroke: #E5E0F2;
}

.ix-spinner__fill {
  stroke: url(#ixSpinnerGradient);
  stroke-linecap: round;
  stroke-dasharray: var(--circ, 565);
  stroke-dashoffset: var(--circ, 565);
  transition: stroke-dashoffset linear var(--duration, 30s);
}

.ix-spinner__fill.is-near-done {
  /* Hold near-finish at 95% until the real response arrives. */
  stroke-dashoffset: calc(var(--circ, 565) * 0.05);
}

.ix-spinner__fill.is-complete {
  /* Snap to 100% with a fast easing once the network response lands. */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 350ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ix-spinner__pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #7C3AED;
  font-variant-numeric: tabular-nums;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

@keyframes ix-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.ix-overlay__caption {
  animation: ix-pulse 2.4s ease-in-out infinite;
}
