/**
 * Optional utilities extracted from app shell (loader, dialogs).
 * Load after moduscore-theme.css.
 */

#global-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

#global-loader.active {
  display: flex;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ov-primary) 0%, var(--ov-accent) 50%, var(--ov-primary) 100%);
  background-size: 200% 200%;
  animation: themeGradientPulse 1.5s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(15, 76, 129, 0.35);
}

@keyframes themeGradientPulse {
  0%, 100% { background-position: 0% 50%; transform: scale(1); }
  50% { background-position: 100% 50%; transform: scale(1.1); }
}

.loader-text {
  color: var(--ov-primary);
  font-size: 1rem;
  font-weight: 500;
}

.theme-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.theme-dialog-overlay.theme-dialog-open {
  display: flex;
}

.theme-dialog-panel {
  background: var(--ov-surface);
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  padding: 1.35rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--color-neutral-gray-200);
}

.theme-dialog-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-neutral-gray-900);
}

.theme-dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
