/* 🌐 General Layout */
body {
  background-color: #f8f9fa;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

/* 🧱 Node Grid Structure */
#nodeGrid {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: #fff;
}

/* ⚡ Image Styling */
.node-card img.node-img {
  width: 100% !important;
  max-width: 345px !important;
  height: auto !important;
  max-height: 340px !important;
  display: block;
  margin: 0 auto;
  }

/* 🧠 Flex Grid Rows */
.switch-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.node-row {
  display: flex;
  flex-direction: column; /* vertical stack of nodes */
  align-items: center;
  gap: 1rem;
}

/* 🖇️ Topology Layout Container */
.topology-wrapper {
  position: relative;
  min-height: 300px;
}

/* 🧵 SVG Overlay for Connections */
#connectionLines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;

}

/* 🧩 Cards */
.card-triplet {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  flex: 1 1 300px;
  min-width: 250px;
}

/* Reset and base layout */
body {
  margin: 0;
  font-family: sans-serif;
  background: #f0f2f5;
}

.hidden {
  display: none;
}

/* Controls Panel */
.controls {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #ccc;
}

.controls label {
  margin-right: 16px;
  font-weight: 500;
  font-size: 14px;
}

.slider-group,
.image-mode-group {
  margin-top: 12px;
}

/* Legend Panel */
#legendPanel {
  width: 180px;
  padding: 12px;
  border-right: 1px solid #ccc;
  background: #fff;
  font-size: 14px;
}

#legendPanel h3 {
  margin-bottom: 8px;
  font-size: 15px;
  color: #333;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.legend-color {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid #888;
}

/* Main Layout */
.topology-wrapper {
  display: flex;
  padding: 16px;
  position: relative;
}

/* Diagram Panel */
.diagram-panel {
  flex: 1;
  padding-left: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Node Grid */
#nodeGrid {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
}

/* Switch Grid Layout */
#switchGrid {
  display: flex;
  align-items: center;
}

.switch-row{
display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.node-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  }

/* Card Styles */
.node-card {
  width: 220px;
  height: auto;
  background: #fff;
  border: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-radius: 6px;
  padding-top: 2px;
  padding-bottom: 2px;
  z-index: 5;
}

/* Images and Labels */
.node-image {
  width: 218px;
  height: auto;
  object-fit:  contain;
  display: block;
}
