/**
 * @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-color-text-muted, #6b7280);
}

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

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

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

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

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

.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-color-error, #ef4444);
}

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

.fd-schema-form__error-title {
  margin: 0;
  font-size: var(--fd-font-size-md, 1rem);
  font-weight: var(--fd-font-weight-semibold, 600);
  color: var(--fd-color-error, #ef4444);
}

.fd-schema-form__error-message {
  margin: 0;
  font-size: var(--fd-font-size-sm, 0.875rem);
  color: var(--fd-color-text-muted, #6b7280);
  max-width: 400px;
}

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

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