@use '../../styles/mixins' as *;

// =============================================================================
// DAG View — React Flow dark theme overrides and task node styles
// =============================================================================

.dagContainer {
  flex: 1;
  width: 100%;
  height: 100%;

  // React Flow theme overrides
  --xy-background-color: transparent;
  --xy-node-border-radius: var(--radius-lg);
  --xy-edge-stroke: var(--text-tertiary);
  --xy-minimap-background: var(--bg-inset);
  --xy-minimap-mask-background: var(--bg-overlay);
  --xy-controls-button-background-color: var(--bg-elevated);
  --xy-controls-button-background-color-hover: var(--bg-overlay);
  --xy-controls-button-color: var(--text-secondary);
  --xy-controls-button-color-hover: var(--text-primary);
  --xy-controls-button-border-color: var(--border-subtle);
  --xy-attribution-background-color: transparent;
}

.emptyDag {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

// =============================================================================
// Task Node
// =============================================================================

.taskNode {
  @include surface-card;
  width: 220px;
  min-height: 60px;
  display: flex;
  overflow: hidden;
  cursor: pointer;
  @include card-hover;

  @include mobile {
    width: 160px;
    min-height: 48px;
  }
}

.taskNodeBorder {
  width: 4px;
  flex-shrink: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.taskNodeContent {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-xs);
  min-width: 0;
}

.taskNodeHeader {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

.taskNodeIcon {
  font-size: var(--font-size-sm);
  flex-shrink: 0;
}

.taskNodeTitle {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taskNodeBadges {
  display: flex;
  gap: var(--space-xs);
}

.childBadge {
  @include surface-inset;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  padding: 1px var(--space-xs);
}

.depBadge {
  @include surface-inset;
  font-size: var(--font-size-xs);
  color: var(--accent-yellow);
  padding: 1px var(--space-xs);
}

// =============================================================================
// Handles
// =============================================================================

.handle {
  width: 6px !important;
  height: 6px !important;
  background: var(--text-tertiary) !important;
  border: 1px solid var(--border-subtle) !important;
}

// =============================================================================
// MiniMap node colors (set via nodeColor callback, not CSS)
// =============================================================================

// ---------------------------------------------------------------------------
// Empty state CTA
// ---------------------------------------------------------------------------

.emptyCta {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  text-align: center;
}

.ctaDescription {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  max-width: 280px;
  line-height: var(--line-height);
}

.ctaButton {
  @include btn-primary;
  padding: var(--space-sm) var(--space-xl);
  font-size: var(--font-size-md);
}
