.memory-visualizer-container {
  position: relative;
  width: 100%;
  height: 500px;
  margin: 0 auto;
  background-color: transparent;
  border-radius: 12px;
}

.memory-visualizer-canvas {
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.node-tooltip {
  position: absolute;
  z-index: 100;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  opacity: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.node-tooltip.position-top {
  transform: translate(-50%, calc(-100% - 25px)) translateZ(0);
}
.node-tooltip.position-bottom {
  transform: translate(-50%, 25px) translateZ(0);
}

.node-tooltip.visible {
  opacity: 1;
}

.tooltip-content {
  background: linear-gradient(135deg, #3c3c3c, #2a2a2a);
  color: #f0f0f0;
  padding: 10px 16px;
  border-radius: 8px;
  max-width: 250px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.tooltip-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.tooltip-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 10px 0;
}

.tooltip-section {
  text-align: left;
}

.tooltip-section .tooltip-label {
  font-weight: 600;
  font-size: 13px;
  color: #ccc;
  margin-bottom: 4px;
}

.tooltip-section .tooltip-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #a3e635; /* A lime green for code-like text */
  background-color: rgba(0, 0, 0, 0.2);
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-block;
}

.tooltip-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tooltip-section li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-top: 2px;
}

.related-text {
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  padding-right: 5px;
}

.related-score {
  color: #aaa;
  font-weight: bold;
}

.tooltip-content .score {
  font-weight: 600;
  margin-top: 6px;
  font-size: 13px;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 0; 
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.position-top .tooltip-content::after {
  top: 100%;
  margin-left: -8px;
  border-top: 8px solid #3c3c3c;
}

.position-bottom .tooltip-content::after {
  bottom: 100%;
  margin-left: -8px;
  border-bottom: 8px solid #2a2a2a;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (max-width: 768px) {
  .memory-visualizer-container {
    height: 400px;
  }
  
  .tooltip-content {
    max-width: 200px;
    padding: 6px 10px;
  }
  
  .tooltip-content p {
    font-size: 12px;
  }
} 