@charset "UTF-8";
:root {
  --wf-bg: var(--bg-primary);
  --wf-border: var(--border-color);
  --wf-border-hover: var(--border-color-translucent);
  --wf-dot-color: var(--body-color);
  --stage-bg: rgb(var(--primary-rgb));
  --stage-border: var(--border-color);
  --stage-text: var(--white);
  --stage-virtual-bg: purple;
  --transition-hover: var(--border-color-hover);
  --transition-label-bg: #2071c6;
  --transition-stroke: var(--transition-label-bg);
  --transition-label-color: var(--white);
  --transition-highlight: #ff6868;
  --zoom-btn-bg: transparent;
  --zoom-btn-hover: var(--border-color);
  --zoom-btn-color: var(--text-primary);
  --vf-custom-controls-bgcolor: var(--secondary);
  --stage-desc: #ffffffc0 !important;
}

@keyframes dashmove {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -36px;
  }
}

#workflow-graph {
  cursor: grab;
  background-image: radial-gradient(circle at 1px 1px, var(--wf-dot-color) 1px, transparent 1px);
  border: 1px solid var(--stage-border);
  background-size: 38px 38px;
  border-radius: 8px;
  width: 100%;
  height: 80vh;
  position: relative;
  overflow: hidden;
}

#workflow-graph:active {
  cursor: grabbing;
}

#workflow-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

#graph {
  transform-origin: 0 0;
  width: fit-content;
  min-width: 100%;
  min-height: 100%;
  transition: transform .15s ease-out;
  position: relative;
}

#graph.dragging {
  transition: none;
}

#stages {
  width: 100%;
  height: 100%;
  position: relative;
}

#connections {
  z-index: 1;
  pointer-events: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

.stage {
  z-index: 10;
  cursor: move;
  user-select: none;
  background: var(--stage-bg);
  border: 1px solid var(--stage-border);
  border-radius: 6px;
  flex-direction: column;
  justify-content: center;
  width: 200px;
  min-height: 80px;
  padding: 12px 16px;
  display: flex;
  position: absolute;
  box-shadow: 0 4px 10px #0009;
}

.stage:hover {
  transform: translateY(-1px);
}

.stage.dragging {
  z-index: 1000;
  transform: rotate(1deg) scale(1.02);
}

.stage.virtual {
  background: var(--stage-virtual-bg);
  border-width: 1px;
}

.stage-title {
  color: var(--stage-text);
  word-wrap: break-word;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.stage-description {
  color: var(--stage-desc);
  word-wrap: break-word;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
}

.stage-badge {
  color: var(--stage-text);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--stage-border);
  border-radius: 3px;
  align-self: flex-start;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 500;
  display: inline-block;
}

.transition-path {
  stroke: var(--transition-stroke);
  stroke-width: 3px;
  fill: none;
  opacity: .8;
  transition: stroke .2s, stroke-width .2s;
}

.transition-path:hover {
  stroke-width: 3px;
  opacity: 1;
  stroke: var(--transition-hover);
  animation-duration: .5s;
}

.arrow-marker {
  fill: var(--transition-stroke);
  transition: fill .2s;
}

.transition-path:hover + .arrow-marker {
  fill: var(--transition-hover);
}

.transition-path.highlighted {
  stroke: var(--transition-highlight);
  stroke-width: 5px;
  stroke-dasharray: 12 6;
  animation: .5s linear infinite dashmove;
}

.transition-label-content {
  z-index: 20;
  min-width: 80px;
  max-width: 300px;
  color: var(--transition-label-color);
  text-align: center;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  border: 2px solid var(--transition-stroke);
  border-radius: 6px;
  padding: 2px 12px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background .2s, border .2s, box-shadow .2s;
  position: absolute;
  box-shadow: 0 2px 8px #00000026;
  background: var(--transition-label-bg) !important;
}

.transition-label-content.highlighted {
  border-color: var(--transition-highlight);
  font-weight: 700;
  transition: transform .2s;
  transform: scale(1.1);
}

.zoom-controls {
  z-index: 1000;
  background: var(--vf-custom-controls-bgcolor);
  border: 1px solid var(--wf-border);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  display: flex;
  position: absolute;
  bottom: 20px;
  right: 20px;
}

.zoom-btn:hover {
  background: var(--zoom-btn-hover);
  transform: scale(1.05);
}

.zoom-btn:active {
  transition: transform .5s;
  transform: scale(.95);
}
