:root {
  --color-red: #FF0000;
  --color-blue: #0057FF;
  --color-yellow: #F8DE22;
  --color-orange: #FF6B00;
  --color-light: #FFFFFF;
  --color-dark: #151515;
  --color-black: 0, 0, 0;
  --transition-fast: 0.2s;
}

/* reset */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
  color: inherit;
  scroll-behavior: smooth;
}
html, body {
  width: 100%;   
}
body {
  font-family: "Open Sans", sans-serif;
  min-height: 100vh;
  height: max-content;
  width: 100dvw;
  overflow: hidden;
  position: relative;
}
li, a {
  list-style: none;
  text-decoration: none;
}


.workspace {
  background-image:
    linear-gradient(#000 2px, transparent 2px),
    linear-gradient(90deg, #000 2px, transparent 2px);
  background-size: 40px 40px;
  background-color: #FFF;
  position: relative;
  width: 100vw;
  height: 100vh;
}

.svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.flow-line {
  fill: none;
  stroke: var(--color-blue);
  stroke-width: 3;
  stroke-dasharray: 8 8;
  animation: dashAnim 1s linear infinite;
  filter: drop-shadow(0 0 6px rgba(14, 165, 233, 0.6));
}

@keyframes dashAnim {
  to { stroke-dashoffset: -16; }
}

.flow-node {
  position: absolute;
  left: 4vw;
  top: 5vh;
  width: 240px;
  background-color: var(--color-light);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 3px solid #000;
  box-shadow: 6px 6px 0px #000, 0 15px 30px rgba(var(--color-black), 0.5);
  z-index: 10;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}
.flow-node:hover {
  transform: scaleX(1.02);
}
.flow-node:active {
  cursor: grabbing;
  box-shadow: 6px 6px 0px #000, 0 25px 50px rgba(var(--color-black), 0.8);
}

.node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(var(--color-light), 0.05);
  border-bottom: 1px solid rgba(var(--color-light), 0.1);
}

.editable {
  color: var(--color-dark);
  font-weight: 600;
  outline: none;
  padding: 4px;
  transition: all var(--transition-fast);
  cursor: text;
  flex-grow: 1;
}
.editable-title {
  text-transform: uppercase;
}
.editable:focus {
  background-color: rgba(var(--color-black), 0.3);
}
.delete-btn {
  background: transparent;
  color: var(--color-dark);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all var(--transition-fast);
  margin-left: 8px;
}
.delete-btn:hover {
  background-color: var(--color-red);
  color: var(--color-light);
}

.node-body {
  padding: 16px;
  color: var(--color-dark);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 8px;
}

.add-node-btn {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-yellow);
  color: var(--color-light);
  border: 3px solid var(--color-yellow);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(var(--color-black),0.4);
  transition: all var(--transition-fast);
  z-index: 20;
}
.add-node-btn:hover {
  background-color: var(--color-blue);
  transform: translateX(-50%) scale(1.1);
  border: 3px solid var(--color-blue);
}