/*
 * Workflow Visual Editor Styles
 * CSS for the interactive workflow canvas, nodes, and transitions
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Node type colors */
  --workflow-node-start-bg: #dcfce7;
  --workflow-node-start-border: #22c55e;
  --workflow-node-start-text: #166534;

  --workflow-node-action-bg: #dbeafe;
  --workflow-node-action-border: #3b82f6;
  --workflow-node-action-text: #1e40af;

  --workflow-node-decision-bg: #fef9c3;
  --workflow-node-decision-border: #eab308;
  --workflow-node-decision-text: #854d0e;

  --workflow-node-terminal-bg: #fee2e2;
  --workflow-node-terminal-border: #ef4444;
  --workflow-node-terminal-text: #991b1b;

  /* Canvas colors */
  --workflow-canvas-bg: #f9fafb;
  --workflow-canvas-grid: #e5e7eb;
  --workflow-canvas-grid-major: #d1d5db;

  /* Transition/connection colors */
  --workflow-transition-stroke: #6b7280;
  --workflow-transition-stroke-hover: #374151;
  --workflow-transition-stroke-selected: #3b82f6;

  /* Selection colors */
  --workflow-selection-ring: #3b82f6;
  --workflow-selection-bg: rgba(59, 130, 246, 0.1);

  /* Shadow tokens */
  --workflow-node-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --workflow-node-shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --workflow-node-shadow-selected: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Dark mode overrides */
html.dark {
  --workflow-node-start-bg: rgba(34, 197, 94, 0.2);
  --workflow-node-start-border: #22c55e;
  --workflow-node-start-text: #86efac;

  --workflow-node-action-bg: rgba(59, 130, 246, 0.2);
  --workflow-node-action-border: #3b82f6;
  --workflow-node-action-text: #93c5fd;

  --workflow-node-decision-bg: rgba(234, 179, 8, 0.2);
  --workflow-node-decision-border: #eab308;
  --workflow-node-decision-text: #fde047;

  --workflow-node-terminal-bg: rgba(239, 68, 68, 0.2);
  --workflow-node-terminal-border: #ef4444;
  --workflow-node-terminal-text: #fca5a5;

  --workflow-canvas-bg: #18181b;
  --workflow-canvas-grid: #27272a;
  --workflow-canvas-grid-major: #3f3f46;

  --workflow-transition-stroke: #71717a;
  --workflow-transition-stroke-hover: #a1a1aa;
  --workflow-transition-stroke-selected: #60a5fa;

  --workflow-selection-ring: #60a5fa;
  --workflow-selection-bg: rgba(96, 165, 250, 0.15);
}

/* ============================================
   Canvas Container
   ============================================ */
.workflow-canvas {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: var(--workflow-canvas-bg);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.workflow-canvas:active {
  cursor: grabbing;
}

/* Grid background pattern */
.workflow-canvas--grid {
  background-image:
    linear-gradient(var(--workflow-canvas-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--workflow-canvas-grid) 1px, transparent 1px),
    linear-gradient(var(--workflow-canvas-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--workflow-canvas-grid-major) 1px, transparent 1px);
  background-size:
    20px 20px,
    20px 20px,
    100px 100px,
    100px 100px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
}

/* Dots pattern alternative */
.workflow-canvas--dots {
  background-image: radial-gradient(circle, var(--workflow-canvas-grid) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Canvas viewport for pan/zoom */
.workflow-canvas__viewport {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* ============================================
   Workflow Nodes
   ============================================ */
.workflow-node {
  position: absolute;
  min-width: 140px;
  max-width: 220px;
  padding: 12px 16px;
  border-radius: 8px;
  border-width: 2px;
  border-style: solid;
  background-color: white;
  box-shadow: var(--workflow-node-shadow);
  cursor: move;
  transition:
    box-shadow 0.15s ease-in-out,
    transform 0.1s ease-out,
    border-color 0.15s ease-in-out;
  user-select: none;
  -webkit-user-select: none;
}

.workflow-node:hover {
  box-shadow: var(--workflow-node-shadow-hover);
  transform: translateY(-1px);
}

.workflow-node:active {
  cursor: grabbing;
}

/* Node type: Start (Cyan) - Cflow-inspired design with left accent border */
.workflow-node--start {
  background-color: white;
  border-color: #e5e7eb;
  border-left-color: #06b6d4;
  border-left-width: 4px;
  color: #374151;
}

.workflow-node--start .workflow-node__icon {
  color: #06b6d4;
}

.workflow-node--start .workflow-node__step-badge {
  background-color: #06b6d4;
}

/* Node type: Action (Orange) - Cflow-inspired design */
.workflow-node--action {
  background-color: white;
  border-color: #e5e7eb;
  border-left-color: #f97316;
  border-left-width: 4px;
  color: #374151;
}

.workflow-node--action .workflow-node__icon {
  color: #f97316;
}

.workflow-node--action .workflow-node__step-badge {
  background-color: #f97316;
}

/* Node type: Decision (Purple) - Cflow-inspired design */
.workflow-node--decision {
  background-color: white;
  border-color: #e5e7eb;
  border-left-color: #a855f7;
  border-left-width: 4px;
  color: #374151;
}

.workflow-node--decision .workflow-node__icon {
  color: #a855f7;
}

.workflow-node--decision .workflow-node__step-badge {
  background-color: #a855f7;
}

/* Node type: Terminal (Amber) - Cflow-inspired design */
.workflow-node--terminal {
  background-color: white;
  border-color: #e5e7eb;
  border-left-color: #f59e0b;
  border-left-width: 4px;
  color: #374151;
}

.workflow-node--terminal .workflow-node__icon {
  color: #f59e0b;
}

.workflow-node--terminal .workflow-node__step-badge {
  background-color: #f59e0b;
}

/* Step number badge - positioned at top right of node */
.workflow-node__step-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* Node content elements */
.workflow-node__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.workflow-node__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.workflow-node__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-node__subtitle {
  font-size: 12px;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Node connection handles (anchor points for transitions) */
.workflow-node__handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: white;
  border: 2px solid var(--workflow-transition-stroke);
  cursor: crosshair;
  opacity: 0;
  transition: opacity 0.15s ease-in-out, transform 0.1s ease-out;
  z-index: 10;
}

.workflow-node:hover .workflow-node__handle,
.workflow-node--selected .workflow-node__handle {
  opacity: 1;
}

.workflow-node__handle:hover {
  transform: scale(1.3);
  background-color: var(--workflow-selection-ring);
  border-color: var(--workflow-selection-ring);
}

.workflow-node__handle--top {
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
}

.workflow-node__handle--bottom {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
}

.workflow-node__handle--left {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.workflow-node__handle--right {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.workflow-node__handle--top:hover {
  transform: translateX(-50%) scale(1.3);
}

.workflow-node__handle--bottom:hover {
  transform: translateX(-50%) scale(1.3);
}

.workflow-node__handle--left:hover {
  transform: translateY(-50%) scale(1.3);
}

.workflow-node__handle--right:hover {
  transform: translateY(-50%) scale(1.3);
}

/* Handle valid target state (during connection dragging) */
.workflow-node__handle--valid-target {
  opacity: 1;
  background-color: #22c55e;
  border-color: #16a34a;
  transform: scale(1.5);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.workflow-node__handle--valid-target.workflow-node__handle--top {
  transform: translateX(-50%) scale(1.5);
}

.workflow-node__handle--valid-target.workflow-node__handle--bottom {
  transform: translateX(-50%) scale(1.5);
}

.workflow-node__handle--valid-target.workflow-node__handle--left {
  transform: translateY(-50%) scale(1.5);
}

.workflow-node__handle--valid-target.workflow-node__handle--right {
  transform: translateY(-50%) scale(1.5);
}

/* ============================================
   Selection States
   ============================================ */
.workflow-node--selected {
  box-shadow: var(--workflow-node-shadow-selected);
  outline: 2px solid var(--workflow-selection-ring);
  outline-offset: 2px;
  z-index: 100;
}

.workflow-node--hover {
  box-shadow: var(--workflow-node-shadow-hover);
}

/* Multi-select box (rubber band selection) */
.workflow-selection-box {
  position: absolute;
  border: 1px dashed var(--workflow-selection-ring);
  background-color: var(--workflow-selection-bg);
  pointer-events: none;
  z-index: 1000;
}

/* ============================================
   Transitions (Connection Lines)
   ============================================ */
.workflow-transitions {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.workflow-transition {
  fill: none;
  stroke: var(--workflow-transition-stroke);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: stroke;
  cursor: pointer;
  transition: stroke 0.15s ease-in-out, stroke-width 0.1s ease-out;
}

.workflow-transition:hover {
  stroke: var(--workflow-transition-stroke-hover);
  stroke-width: 3;
}

.workflow-transition--selected {
  stroke: var(--workflow-transition-stroke-selected);
  stroke-width: 3;
}

/* Transition arrow marker */
.workflow-transition__arrow {
  fill: var(--workflow-transition-stroke);
  transition: fill 0.15s ease-in-out;
}

.workflow-transition:hover .workflow-transition__arrow,
.workflow-transition--selected .workflow-transition__arrow {
  fill: var(--workflow-transition-stroke-selected);
}

/* Animated transition (for in-progress or preview) */
.workflow-transition--animated {
  stroke-dasharray: 8, 4;
  animation: workflow-transition-dash 0.5s linear infinite;
}

@keyframes workflow-transition-dash {
  to {
    stroke-dashoffset: -12;
  }
}

/* Temporary transition being drawn */
.workflow-transition--preview {
  stroke: var(--workflow-selection-ring);
  stroke-dasharray: 4, 4;
  opacity: 0.7;
}

/* Reconnect preview line */
.workflow-transition--reconnect-preview {
  stroke: #f59e0b;
  stroke-dasharray: 6, 4;
  opacity: 0.9;
  animation: workflow-reconnect-dash 0.4s linear infinite;
}

@keyframes workflow-reconnect-dash {
  to {
    stroke-dashoffset: -10;
  }
}

/* Dimmed transition during reconnect */
.workflow-transition--dimmed {
  opacity: 0.3;
}

/* Transition label */
.workflow-transition__label {
  position: absolute;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--workflow-transition-stroke);
  background-color: var(--workflow-canvas-bg);
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.workflow-transition__label:hover {
  color: var(--workflow-transition-stroke-hover);
}

/* ============================================
   Dragging States
   ============================================ */
.workflow-node--dragging {
  opacity: 0.8;
  z-index: 1000;
  cursor: grabbing;
}

.workflow-canvas--dragging {
  cursor: grabbing;
}

.workflow-canvas--connecting {
  cursor: crosshair;
}

.workflow-canvas--reconnecting {
  cursor: grabbing;
}

/* Reconnect handle styles */
.workflow-reconnect-handle {
  cursor: grab;
  transition: r 0.15s ease-out, fill 0.15s ease-out;
}

.workflow-reconnect-handle:hover {
  cursor: grab;
}

.workflow-reconnect-handle:active {
  cursor: grabbing;
}

/* Valid reconnect target node */
.workflow-node--valid-reconnect-target {
  outline: 3px solid #22c55e;
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

/* Invalid reconnect target node */
.workflow-node--invalid-reconnect-target {
  outline: 3px solid #ef4444;
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  opacity: 0.6;
}

/* Drop zone highlight when dragging new node */
.workflow-canvas--drop-active {
  background-color: var(--workflow-selection-bg);
}

/* ============================================
   Zoom Controls
   ============================================ */
.workflow-zoom-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
}

.workflow-zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: white;
  border: 1px solid var(--workflow-canvas-grid-major);
  color: #374151;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.workflow-zoom-btn:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.workflow-zoom-btn:active {
  background-color: #e5e7eb;
}

html.dark .workflow-zoom-btn {
  background-color: #27272a;
  border-color: #3f3f46;
  color: #a1a1aa;
}

html.dark .workflow-zoom-btn:hover {
  background-color: #3f3f46;
  color: #fafafa;
}

.workflow-zoom-level {
  font-size: 11px;
  text-align: center;
  color: #6b7280;
  padding: 4px 0;
}

html.dark .workflow-zoom-level {
  color: #71717a;
}

/* ============================================
   Minimap
   ============================================ */
.workflow-minimap {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 160px;
  height: 100px;
  border-radius: 8px;
  background-color: white;
  border: 1px solid var(--workflow-canvas-grid-major);
  overflow: hidden;
  z-index: 100;
}

html.dark .workflow-minimap {
  background-color: #27272a;
  border-color: #3f3f46;
}

.workflow-minimap__viewport {
  position: absolute;
  border: 2px solid var(--workflow-selection-ring);
  background-color: var(--workflow-selection-bg);
  cursor: move;
}

.workflow-minimap__node {
  position: absolute;
  border-radius: 2px;
}

.workflow-minimap__node--start {
  background-color: var(--workflow-node-start-border);
}

.workflow-minimap__node--action {
  background-color: var(--workflow-node-action-border);
}

.workflow-minimap__node--decision {
  background-color: var(--workflow-node-decision-border);
}

.workflow-minimap__node--terminal {
  background-color: var(--workflow-node-terminal-border);
}

/* ============================================
   Node Palette (for adding new nodes)
   ============================================ */
.workflow-palette {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background-color: white;
  border-radius: 12px;
  border: 1px solid var(--workflow-canvas-grid-major);
  box-shadow: var(--workflow-node-shadow);
  z-index: 100;
}

html.dark .workflow-palette {
  background-color: #27272a;
  border-color: #3f3f46;
}

.workflow-palette__title {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

html.dark .workflow-palette__title {
  color: #71717a;
}

.workflow-palette__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: grab;
  transition: background-color 0.15s ease-in-out;
}

.workflow-palette__item:hover {
  background-color: #f3f4f6;
}

html.dark .workflow-palette__item:hover {
  background-color: #3f3f46;
}

.workflow-palette__item:active {
  cursor: grabbing;
}

.workflow-palette__item-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workflow-palette__item--start .workflow-palette__item-icon {
  background-color: var(--workflow-node-start-bg);
  color: var(--workflow-node-start-border);
}

.workflow-palette__item--action .workflow-palette__item-icon {
  background-color: var(--workflow-node-action-bg);
  color: var(--workflow-node-action-border);
}

.workflow-palette__item--decision .workflow-palette__item-icon {
  background-color: var(--workflow-node-decision-bg);
  color: var(--workflow-node-decision-border);
}

.workflow-palette__item--terminal .workflow-palette__item-icon {
  background-color: var(--workflow-node-terminal-bg);
  color: var(--workflow-node-terminal-border);
}

.workflow-palette__item-label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

html.dark .workflow-palette__item-label {
  color: #e4e4e7;
}

/* ============================================
   Toolbar
   ============================================ */
.workflow-toolbar {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.workflow-toolbar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: white;
  border: 1px solid var(--workflow-canvas-grid-major);
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.workflow-toolbar__btn:hover {
  background-color: #f3f4f6;
  color: #111827;
}

html.dark .workflow-toolbar__btn {
  background-color: #27272a;
  border-color: #3f3f46;
  color: #a1a1aa;
}

html.dark .workflow-toolbar__btn:hover {
  background-color: #3f3f46;
  color: #fafafa;
}

.workflow-toolbar__btn--primary {
  background-color: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.workflow-toolbar__btn--primary:hover {
  background-color: #2563eb;
  border-color: #2563eb;
  color: white;
}

html.dark .workflow-toolbar__btn--primary {
  background-color: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

html.dark .workflow-toolbar__btn--primary:hover {
  background-color: #2563eb;
  border-color: #2563eb;
}

/* ============================================
   Context Menu
   ============================================ */
.workflow-context-menu {
  position: absolute;
  min-width: 160px;
  padding: 4px;
  background-color: white;
  border-radius: 8px;
  border: 1px solid var(--workflow-canvas-grid-major);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

html.dark .workflow-context-menu {
  background-color: #27272a;
  border-color: #3f3f46;
}

.workflow-context-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.1s ease-in-out;
}

.workflow-context-menu__item:hover {
  background-color: #f3f4f6;
}

html.dark .workflow-context-menu__item {
  color: #e4e4e7;
}

html.dark .workflow-context-menu__item:hover {
  background-color: #3f3f46;
}

.workflow-context-menu__item--danger {
  color: #dc2626;
}

.workflow-context-menu__item--danger:hover {
  background-color: #fee2e2;
}

html.dark .workflow-context-menu__item--danger {
  color: #f87171;
}

html.dark .workflow-context-menu__item--danger:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

.workflow-context-menu__separator {
  height: 1px;
  background-color: var(--workflow-canvas-grid-major);
  margin: 4px 0;
}

/* ============================================
   Loading & Empty States
   ============================================ */
.workflow-canvas--loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.workflow-canvas__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #6b7280;
}

html.dark .workflow-canvas__loading {
  color: #71717a;
}

.workflow-canvas__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;
  text-align: center;
}

.workflow-canvas__empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.workflow-canvas__empty-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.workflow-canvas__empty-text {
  font-size: 14px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 640px) {
  .workflow-palette {
    top: 8px;
    left: 8px;
    padding: 8px;
  }

  .workflow-palette__item {
    padding: 6px 10px;
  }

  .workflow-toolbar {
    top: 8px;
    right: 8px;
  }

  .workflow-zoom-controls {
    bottom: 8px;
    right: 8px;
  }

  .workflow-minimap {
    display: none;
  }

  .workflow-node {
    min-width: 120px;
    padding: 10px 12px;
  }

  .workflow-node__title {
    font-size: 13px;
  }

  .workflow-node__subtitle {
    font-size: 11px;
  }
}

/* ============================================
   Toolbox Sidebar
   ============================================ */
.workflow-toolbox {
  /* Sidebar positioning and sizing handled by Tailwind in partial */
}

.workflow-toolbox--collapsed {
  width: 3rem;
}

.workflow-toolbox__card {
  /* Base styles handled by Tailwind in partial */
}

.workflow-toolbox__card--dragging {
  opacity: 0.5;
  transform: scale(0.95);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.workflow-toolbox__card:focus {
  outline: 2px solid var(--workflow-selection-ring);
  outline-offset: 2px;
}

/* Ghost preview during drag */
#workflow-toolbox-ghost-preview {
  /* Ghost preview positioned and styled by JS */
}

/* ============================================
   Drop Zone States
   ============================================ */
.workflow-canvas--drop-active {
  outline: 3px dashed var(--workflow-selection-ring);
  outline-offset: -3px;
  background-color: rgba(59, 130, 246, 0.05);
}

.workflow-canvas--drop-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(59, 130, 246, 0.05);
  pointer-events: none;
  z-index: 1;
}

/* ============================================
   Auto-Connect Preview
   ============================================ */
.workflow-transition--auto-connect-preview {
  stroke: var(--workflow-selection-ring);
  stroke-dasharray: 8, 4;
  animation: workflow-auto-connect-pulse 1s ease-in-out infinite;
}

@keyframes workflow-auto-connect-pulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.workflow-node--auto-connect-source {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
  animation: workflow-auto-connect-source-pulse 1s ease-in-out infinite;
}

@keyframes workflow-auto-connect-source-pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.2);
  }
}

/* ============================================
   Form Validation Animation
   ============================================ */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
  }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* Form validation error state */
.form-error-summary {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .workflow-palette,
  .workflow-toolbar,
  .workflow-zoom-controls,
  .workflow-minimap,
  .workflow-context-menu {
    display: none !important;
  }

  .workflow-canvas {
    height: auto;
    overflow: visible;
    background: white;
  }

  .workflow-node {
    box-shadow: none;
    border-width: 1px;
  }
}
