/**
 * @file
 * FlowDrop Schema Form Component Styles
 *
 * Provides styling for the schema form container, loading states,
 * and error displays.
 */

/* ==========================================================================
   Container Styles
   ========================================================================== */

.fd-schema-form {
  position: relative;
  min-height: 100px;
  font-family: var(--fd-font-family, system-ui, -apple-system, sans-serif);
}

.fd-schema-form-container {
  width: 100%;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.fd-schema-form__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--fd-spacing-lg, 1.5rem);
  gap: var(--fd-spacing-sm, 0.5rem);
  color: var(--fd-muted-foreground);
}

.fd-schema-form__loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--fd-border);
  border-top-color: var(--fd-primary);
  border-radius: 50%;
  animation: fd-schema-form-spin 0.8s linear infinite;
}

.fd-schema-form__loading-text {
  font-size: var(--fd-text-sm);
}

@keyframes fd-schema-form-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Error State
   ========================================================================== */

.fd-schema-form--error {
  border: 1px solid var(--fd-error);
  border-radius: var(--fd-radius-md, 0.5rem);
  background-color: var(--fd-error-muted);
}

.fd-schema-form__error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--fd-spacing-xl, 2rem);
  text-align: center;
  gap: var(--fd-spacing-sm, 0.5rem);
}

.fd-schema-form__error-icon {
  color: var(--fd-error);
}

.fd-schema-form__error-icon svg {
  width: 32px;
  height: 32px;
}

.fd-schema-form__error-title {
  margin: 0;
  font-size: var(--fd-text-base);
  font-weight: var(--fd-font-weight-semibold, 600);
  color: var(--fd-error);
}

.fd-schema-form__error-message {
  margin: 0;
  font-size: var(--fd-text-sm);
  color: var(--fd-muted-foreground);
  max-width: 400px;
}

/* ==========================================================================
   Initialized State (hide loading when form is mounted)
   ========================================================================== */

.fd-schema-form[data-flowdrop-initialized="true"] .fd-schema-form__loading {
  display: none;
}