/* ===== File Node (elkNode) ===== */
.dashflow-file-node {
  width: 100%;
  height: 100%;
  min-width: 180px;
  min-height: 60px;
  border-radius: 4px;
  background-color: lightgray;
  border: 2px solid #2E5C8A;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  color: black1;
  font-size: 28px;
  font-family: Arial, sans-serif;
  font-weight: normal;
  text-align: left;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  padding: 4px 8px;
  text-shadow: 0 0 1px rgba(0,0,0,0.3);
  position: relative;
  box-sizing: border-box;
}

.dashflow-file-node .react-flow__handle {
  width: 8px;
  height: 8px;
  background: #2E5C8A;
  border: 1px solid #1a3a5c;
}

/* ===== File Node Expand Button ===== */
.dashflow-expand-btn {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #1a3a5c;
  background: #2E5C8A;
  color: #fff;
  font-size: 25px;
  line-height: 20px;
  padding: 0;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ===== Component Node (componentNode) ===== */
.dashflow-component-node {
  width: 100%;
  height: 150%;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  color: black;
  font-size: 26px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  text-align: left;
  padding: 12px 8px;
  cursor: pointer;
  box-sizing: border-box;
}

.dashflow-component-node.collapsed {
  background-color: darkgray;
  border: 2px solid #4A90E2;
  font-size: 16px;
}

.dashflow-component-node.expanded {
  background-color: grey;
  border: 2px dashed #4A90E2;
  font-size: 28px;
}

.dashflow-component-node.selected {
  box-shadow: 0 0 0 2px #FFD700;
}

.dashflow-component-node .react-flow__handle {
  width: 8px;
  height: 8px;
  background: #2E5C8A;
  border: 1px solid #1a3a5c;
}

/* ===== Edge Sidebar ===== */
.dashflow-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background: #fff;
  border-left: 1px solid #ccc;
  box-shadow: -2px 0 8px rgba(0,0,0,0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  font-size: 15px;
  overflow: hidden;
}

.dashflow-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
  font-weight: bold;
  font-size: 16px;
}

.dashflow-sidebar-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashflow-sidebar-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  padding: 0 0 0 8px;
  line-height: 1;
}

.dashflow-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.dashflow-sidebar-empty {
  color: #999;
  padding: 8px 0;
}

.dashflow-sidebar-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  background: #f5f7fa;
  border-radius: 4px;
  border-left: 3px solid #4A90E2;
}

.dashflow-sidebar-item-kind {
  color: #4A90E2;
  font-weight: bold;
}

/* ===== Container ===== */
.dashflow-container {
  width: 100%;
  height: 100vh;
  position: relative;
}

/* ===== Edge Labels ===== */
.react-flow__edge .react-flow__edge-text {
  font-size: 18px;
  fill: #2E5C8A;
  font-family: Arial, sans-serif;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.react-flow__edge:hover .react-flow__edge-text {
  opacity: 1;
}

.react-flow__edge .react-flow__edge-textbg {
  fill: #ffffff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.react-flow__edge:hover .react-flow__edge-textbg {
  opacity: 1;
}

/* ===== Symbol Node (symbolNode) ===== */
.dashflow-symbol-node {
  width: 140px;
  height: 30px;
  border-radius: 3px;
  background-color: #6DB3F2;
  border: 1px solid #4A90E2;
  display: flex;
  align-items: center;
  color: black;
  font-size: 12px;
  font-family: monospace;
  padding: 2px 6px;
  gap: 4px;
  overflow: hidden;
  position: relative;
}

.dashflow-symbol-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2E5C8A;
  color: black;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
}

.dashflow-symbol-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashflow-symbol-node .react-flow__handle {
  width: 6px;
  height: 6px;
  background: #2E5C8A;
  border: 1px solid #1a3a5c;
}

/* ===== Symbol Indicator on File Nodes ===== */
.dashflow-symbol-indicator {
  position: absolute;
  right: 2px;
  top: 2px;
  font-size: 10px;
  opacity: 0.7;
}

/* ===== Edge Styles ===== */
.dashflow-edge-file .react-flow__edge-path {
  stroke: black;
  stroke-width: 2;
}
.dashflow-edge-symbol .react-flow__edge-path {
  stroke: #8B5CF6;
  stroke-width: 1.5;
  stroke-dasharray: 5, 3;
}
.dashflow-edge-selected .react-flow__edge-path {
  stroke: green;
  stroke-width: 2;
}
