/**
 * @file
 * FlowDrop Workflow Editor Component Styles
 *
 * Provides styling for the workflow editor container, loading states,
 * and error displays.
 */

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

.fd-editor {
  position: relative;
  font-family: var(--fd-font-family, system-ui, -apple-system, sans-serif);
  background-color: transparent;
  overflow: hidden;
}

.fd-editor-container {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

/* Fullscreen mode support */
.fd-editor--fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}

/* ==========================================================================
   Loading State
   Uses light theme to blend with typical Drupal admin themes
   ========================================================================== */

.fd-editor__loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--fd-loading-bg, #f8fafc);
  z-index: 10;
}

.fd-editor__loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--fd-spacing-md, 1rem);
  color: var(--fd-loading-text, #64748b);
}

.fd-editor__loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--fd-loading-spinner-track, #e2e8f0);
  border-top-color: var(--fd-color-primary, #6366f1);
  border-radius: 50%;
  animation: fd-editor-spin 1s linear infinite;
}

.fd-editor__loading-text {
  font-size: var(--fd-font-size-md, 1rem);
  font-weight: var(--fd-font-weight-medium, 500);
}

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

/* ==========================================================================
   Error State
   Uses light theme to blend with typical Drupal admin themes
   ========================================================================== */

.fd-editor--error {
  background-color: var(--fd-loading-bg, #f8fafc);
}

.fd-editor__error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  padding: var(--fd-spacing-2xl, 3rem);
  text-align: center;
  gap: var(--fd-spacing-md, 1rem);
}

.fd-editor__error-icon {
  color: var(--fd-color-error, #dc2626);
  opacity: 0.9;
}

.fd-editor__error-icon svg {
  width: 64px;
  height: 64px;
}

.fd-editor__error-title {
  margin: 0;
  font-size: var(--fd-font-size-xl, 1.5rem);
  font-weight: var(--fd-font-weight-semibold, 600);
  color: var(--fd-color-error, #dc2626);
}

.fd-editor__error-message {
  margin: 0;
  font-size: var(--fd-font-size-md, 1rem);
  color: var(--fd-error-text, #475569);
  max-width: 500px;
  line-height: 1.5;
}

.fd-editor__error-hint {
  margin: var(--fd-spacing-md, 1rem) 0 0;
  font-size: var(--fd-font-size-sm, 0.875rem);
  color: var(--fd-error-hint, #94a3b8);
}

/* ==========================================================================
   Initialized State
   ========================================================================== */

.fd-editor[data-flowdrop-initialized="true"] .fd-editor__loading {
  display: none;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  .fd-editor__error {
    padding: var(--fd-spacing-lg, 1.5rem);
  }

  .fd-editor__error-icon svg {
    width: 48px;
    height: 48px;
  }

  .fd-editor__error-title {
    font-size: var(--fd-font-size-lg, 1.25rem);
  }

  .fd-editor__error-message {
    font-size: var(--fd-font-size-sm, 0.875rem);
  }
}
