/**
 * Graphiti Knowledge Graph Styles
 */

/* Container - Main Graph */
#graphiti-container {
  width: 100%;
  height: 600px;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  background: var(--md-code-bg-color);
  position: relative;
  overflow: hidden;
}

#graphiti-container svg {
  display: block;
}

/* Container - Mini Graph */
.mini-graph {
  width: 100%;
  height: 350px;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  background: var(--md-code-bg-color);
  position: relative;
  overflow: hidden;
  margin: 1rem 0;
}

.mini-graph svg {
  display: block;
}

/* Highlighted node (current page) */
.node--highlight circle {
  filter: drop-shadow(0 0 6px rgba(255, 152, 0, 0.6));
}

/* Tooltip */
.graph-tooltip {
  position: absolute;
  padding: 12px 16px;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 1000;
  max-width: 300px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.graph-tooltip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--md-default-fg-color);
}

.graph-tooltip .type {
  display: inline-block;
  padding: 2px 8px;
  background: var(--md-accent-fg-color--transparent);
  color: var(--md-accent-fg-color);
  border-radius: 4px;
  font-size: 0.8rem;
  margin: 4px 0;
}

.graph-tooltip .confidence {
  color: #f57c00;
  font-size: 0.9rem;
}

.graph-tooltip .summary {
  display: block;
  margin-top: 8px;
  color: var(--md-default-fg-color--light);
  font-size: 0.85rem;
}

.graph-tooltip em {
  display: block;
  margin-top: 8px;
  color: var(--md-accent-fg-color);
  font-size: 0.8rem;
}

/* Legend */
.graph-legend {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--md-code-bg-color);
  border-radius: 8px;
}

.graph-legend h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--md-default-fg-color--light);
}

.graph-legend-section {
  margin-bottom: 1rem;
}

.graph-legend-section:last-child {
  margin-bottom: 0;
}

.graph-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-line {
  width: 20px;
  height: 3px;
  flex-shrink: 0;
}

/* Controls */
.graph-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.graph-controls button {
  padding: 0.5rem 1rem;
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.graph-controls button:hover {
  background: var(--md-accent-fg-color);
}

/* Responsive */
@media screen and (max-width: 768px) {
  #graphiti-container {
    height: 400px;
  }
  
  .graph-legend-items {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Dark mode */
[data-md-color-scheme="slate"] .graph-tooltip {
  border-color: var(--md-default-fg-color--lightest);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
