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

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

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

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

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

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

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

.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;
  animation: fd-editor-spin 1s linear infinite;
  border: 4px solid var(--fd-loading-spinner-track, #e2e8f0);
  border-top-color: var(--fd-primary);
  border-radius: 50%;
}

.fd-editor__loading-text {
  font-size: var(--fd-text-base);
  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 {
  opacity: 0.9;
  color: var(--fd-error);
}

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

.fd-editor__error-title {
  margin: 0;
  color: var(--fd-error);
  font-size: var(--fd-text-2xl);
  font-weight: var(--fd-font-weight-semibold, 600);
}

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

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

/* ==========================================================================
   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-text-lg);
  }

  .fd-editor__error-message {
    font-size: var(--fd-text-sm);
  }
}
