.wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.header {
  padding: 12px 16px;
  background: var(--ne-color-background-secondary, #1e1e1e);
  border-bottom: 1px solid var(--ne-color-border, #333);
}

.title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ne-color-text-primary, #fff);
}

.description {
  margin: 0;
  font-size: 13px;
  color: var(--ne-color-text-secondary, #999);
  line-height: 1.5;
}

.editorContainer {
  flex: 1;
  min-height: 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 16px;
  background: var(--ne-color-background-tertiary, #252525);
  border-top: 1px solid var(--ne-color-border, #333);
}

.legendItem {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ne-color-text-secondary, #999);
}

.legendDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legendDotDataType {
  background: #3b82f6;
}

.legendDotCanConnect {
  background: #f59e0b;
}

.legendDotValidate {
  background: #8b5cf6;
}

.legendDotCapacity {
  background: #ec4899;
}

/* Custom port renderer styles */
.rulePort {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rulePortDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.ruleBadgeContainer {
  position: absolute;
  display: flex;
  gap: 2px;
  pointer-events: none;
  white-space: nowrap;
}

.ruleBadgeContainer[data-position="left"] {
  right: 100%;
  margin-right: 6px;
  flex-direction: row-reverse;
}

.ruleBadgeContainer[data-position="right"] {
  left: 100%;
  margin-left: 6px;
}

.ruleBadgeContainer[data-position="top"] {
  bottom: 100%;
  margin-bottom: 4px;
}

.ruleBadgeContainer[data-position="bottom"] {
  top: 100%;
  margin-top: 4px;
}

.ruleBadge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Invalid connection styles */
.invalidConnection {
  filter: none !important;
}

.invalidConnection path {
  stroke: #ef4444 !important;
  stroke-width: 3px !important;
  stroke-dasharray: 8 4 !important;
  animation: invalidPulse 1s ease-in-out infinite !important;
}

@keyframes invalidPulse {
  0%, 100% {
    stroke-opacity: 1;
  }
  50% {
    stroke-opacity: 0.5;
  }
}

/* Abnormal section header */
.abnormalSection {
  position: absolute;
  left: 60px;
  top: 780px;
  padding: 8px 16px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
}
