body {
  font-family: sans-serif;
  --bs-bg-opacity: 1;
  background: linear-gradient(135deg, #78B9B5, #0F828C, #065084, #320A6B) !important;
}

.btn {
  margin-left: 5px !important;
  border-radius: 50px !important; /* round all buttons */
}

.controls-card {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
}

.tree-container-wrapper {
  display: flex;
  justify-content: center;
}

.tree-container {
  width: 100%;
  min-height: 500px;
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  overflow: auto; /* Add scrollbars if tree is too wide */
  display: flex;
  justify-content: center;
  align-items: center;
}

#tree-svg {
  width: 100%;
  height: 100%;
  min-width: 800px; /* Minimum width to avoid cramping small trees */
  min-height: 500px;
}

.node circle {
  stroke: #343a40;
  stroke-width: 2px;
  transition: fill 0.3s ease, stroke 0.3s ease;
}

.node text.value-text {
  font-size: 16px;
  font-weight: bold;
  fill: #ffffff;
  text-anchor: middle;
  dominant-baseline: central;
}

.node text.height-text {
  font-size: 11px;
  fill: #6c757d;
  text-anchor: middle;
  dominant-baseline: central;
}

.link {
  stroke: #6c757d;
  stroke-width: 2px;
  fill: none;
}

.mini-link {
  stroke: #6c757d;
  fill: none;
}

/* Default node color */
.node .node-circle {
  fill: #0d6efd; /* Bootstrap Primary */
}

/* Highlighted for search */
.node.highlighted .node-circle {
  fill: #198754; /* Bootstrap Success */
  stroke: #198754;
  stroke-width: 3px;
}

/* Highlight for traversal path */
.node.traversed .node-circle {
  fill: #ffc107; /* Bootstrap Warning */
  stroke: #ffc107;
}

#info-box {
  padding: 10px 15px;
  border-radius: 0.375rem; /* Bootstrap's rounded */
  min-height: 50px;
  text-align: center;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.info-found {
  border: 1px solid #198754; /* Bootstrap Success */
  background-color: #d1e7dd;
  color: #0f5132;
}

.info-not-found {
  border: 1px solid #dc3545; /* Bootstrap Danger */
  background-color: #f8d7da;
  color: #842029;
}

/* Styles for Details Modal */
.detail-step {
  display: flex;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #e9ecef;
}

.detail-step:last-child {
  border-bottom: none;
}

.step-description {
  flex-basis: 60%;
  padding-right: 1rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
}

.step-description-only {
  padding: 0.25rem 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  border-bottom: 1px dashed #eee;
}
.step-description-only:last-child {
  border-bottom: none;
}

.mini-vis {
  width: 100%; /* Take full width */
  margin-top: 10px; /* Add some space above */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #fdfdfd;
  min-height: 150px;
}

.mini-tree-svg {
  width: 100%;
  height: auto;
}

.mini-svg {
  width: 100%;
  height: 60px;
}

.mini-node circle {
  stroke-width: 2px;
}

.mini-node text {
  font-size: 14px;
  font-weight: bold;
  fill: white;
  text-anchor: middle;
  dominant-baseline: central;
}

.current-node circle {
  fill: #0d6efd; /* Bootstrap Primary */
  stroke: #0a58ca;
}

.target-node circle {
  fill: #ffc107; /* Bootstrap Warning */
  stroke: #d9a406;
}

.comparison-arrow {
  stroke: #6c757d;
  stroke-width: 2;
  marker-end: url(#arrowhead);
}

.comparison-text {
  font-size: 18px;
  font-weight: bold;
  text-anchor: middle;
  fill: #212529;
}

.operation-header {
  background-color: #e7f1ff;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid #0d6efd;
  font-weight: bold;
}

.operation-header-child {
  background-color: #dbf8fc;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid #9d0dfd;
}

.mini-tree-svg .node-circle {
  stroke: black; /* Color of the border */
  stroke-width: 0.5px; /* Thickness of the border */
}
