#flowCanvas {
  position: relative;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: grab;
  background-image: radial-gradient(#cbd5e187 1px, transparent 1px);
  background-size: 20px 20px;
  height: 100%;
}

#flowCanvas:active {
  cursor: grabbing;
}

@keyframes flowAnimation {
  from {
    stroke-dashoffset: 20;
  }

  to {
    stroke-dashoffset: 0;
  }
}

.flow-controls {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  display: flex;
  gap: 10px; /* Spacing between the two buttons */
}

/* Ensure the modal content is centered and looks good */
#exportPreviewContainer {
    background: #f8fafc;
    padding: 10px;
    display: flex;
    justify-content: center;
}

.connections-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.connection-path {
  fill: none;
  stroke: var(--text-sub);
  stroke-width: 2px;
  opacity: 0.35;
  transition: stroke 0.2s;
  stroke-dasharray: 10, 10;
  animation: flowAnimation 1s linear infinite;
}

.node-info {
  border: 1px solid var(--info-icon);
  color: var(--info-icon);
  aspect-ratio: 1;
  cursor: grab;
  text-align: center;
  line-height: 1;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.flow-node {
  position: absolute;
  width: 250px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.flow-node:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.node-header {
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flow-node[data-type="start"] {
  border-bottom-width: 4px;
  border-color: #10b981;
}

.flow-node[data-type="start"]:hover {
  outline: 1px solid #10b981;
}

.flow-node[data-type="end"] {
  border-bottom-width: 4px;
  border-color: #ef4444;
}

.flow-node[data-type="end"]:hover {
  outline: 1px solid #ef4444;
}

.flow-node[data-type="process"] {
  border-bottom-width: 4px;
  border-color: var(--primary);
}

.flow-node[data-type="process"]:hover {
  outline: 1px solid var(--primary);
}

#hover-tooltip {
  position: absolute;
  width: 200px;
  height: 100px;
  font-family: 'Space Grotesk', 'sans-serif';
  top: 0;
  padding: 10px;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--text-sub);
  left: 0;
  z-index: 10;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0px 2px 5px 1px rgb(214, 214, 214);
  border: 1px dashed var(--primary);
  background-size: cover;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  scale: 0;
  transform-style: preserve-3d;
}

.flow-node.selected {
  border-color: white !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
  
  z-index: 10;
  
}

#selection-marquee {
  position: absolute;
  background: rgba(59, 130, 246, 0.1);
  border: 2px solid var(--primary);
  border-style: dashed;
  pointer-events: none;
  
  z-index: 100;
  display: none;
}

.node-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.9rem;
}

.handle {
  width: 8px;
  height: 8px;
  background: var(--text-sub);
  border-radius: 50%;
  position: absolute;
  border: 2px solid white;
  z-index: 10;
	visibility: hidden;
}

.handle.top {
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
}

.handle.bottom {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.handle.left {
  top: 50%;
  left: 0px;
  transform: translate(-50%, -50%);
}

.handle.right {
  top: 50%;
  right: 0px;
  transform: translate(50%, -50%);
}

.flow-controls {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
}
