.mind-map-container {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  position: relative;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  transition: background-color 0.2s ease;
}

.mind-map-container:active {
  cursor: grabbing;
}

.mind-map-container.dragging {
  cursor: grabbing;
}

.mind-map-svg {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  transition: transform 0.1s ease-out;
  cursor: grab;
  overflow: visible;
}

.mind-map-svg:active {
  cursor: grabbing;
}

.connection-line {
  stroke: var(--text-tertiary);
  stroke-width: 2;
  fill: none;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.connection-line:hover {
  stroke: var(--text-secondary);
  opacity: 1;
}

.node {
  cursor: pointer;
  pointer-events: all;
}

.node:hover .node-bg {
  filter: brightness(1.15);
  stroke-width: 3;
}

.node.selected .node-bg {
  filter: brightness(1.3) drop-shadow(0 0 10px currentColor);
}

.node-bg {
  transition: all 0.2s ease-in-out;
}

.node-text {
  pointer-events: none;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  user-select: none;
}

.expand-button {
  cursor: pointer;
  pointer-events: all;
}

.expand-button:hover .expand-circle {
  filter: brightness(1.3);
  stroke-width: 2;
}

.expand-circle {
  transition: filter 0.15s ease, stroke-width 0.15s ease;
}

.expand-icon {
  pointer-events: none;
  user-select: none;
}

.children-count {
  pointer-events: none;
  opacity: 0.7;
}

.controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.zoom-btn, .reset-btn, .collapse-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 8px;
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reset-btn, .collapse-btn {
  width: auto;
  padding: 0 12px;
  font-size: 12px;
}

.zoom-btn:hover, .reset-btn:hover, .collapse-btn:hover {
  background-color: var(--btn-secondary-hover);
  border-color: var(--border-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.zoom-btn:active, .reset-btn:active, .collapse-btn:active {
  transform: translateY(0);
}

.collapse-btn {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
}

.collapse-btn:hover {
  background-color: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

/* Function type specific styles */
.node.main .node-bg {
  stroke: #4f46e5;
}

.node.handler .node-bg {
  stroke: #dc2626;
}

.node.middleware .node-bg {
  stroke: #ea580c;
}

.node.config .node-bg {
  stroke: #16a34a;
}

.node.router .node-bg {
  stroke: #7c3aed;
}

.node.function .node-bg {
  stroke: #64748b;
}

/* Animation for expand/collapse */
@keyframes expandAnimation {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.node {
  animation: expandAnimation 0.3s ease-out;
}