/* Knowledge Graph Styles — Millennium Aqua */

#knowledge-graph-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

#knowledge-graph {
  position: relative;
  width: 100%;
  height: 600px;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #c8c8c8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

#graph-controls {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.graph-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #c8c8c8;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #e6e6e6 100%);
  color: #333333;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.12);
  transition: all 0.15s ease;
}

.graph-btn:hover {
  background: linear-gradient(180deg, #f8f8f8 0%, #d8d8d8 100%);
  border-color: #b0b0b0;
}

.graph-btn:active {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.graph-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  z-index: 5;
  transition: opacity 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #666666;
}

.graph-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.graph-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #007aff;
  border-right-color: rgba(0, 122, 255, 0.2);
  animation: graph-spin 0.8s linear infinite;
}

@keyframes graph-spin {
  to {
    transform: rotate(360deg);
  }
}

#graph-stats {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #666666;
}

#graph-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #666666;
}

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

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.domain {
  background: #007aff;
}
.legend-dot.topic {
  background: #8cc63f;
}
.legend-dot.post {
  background: #febc2e;
}

.graph-tooltip {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 250px;
  background: #ffffff;
  border: 1px solid #c8c8c8;
  color: #333333;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

@media (max-width: 768px) {
  #knowledge-graph {
    height: 400px;
  }
  #graph-legend {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  #knowledge-graph {
    height: 300px;
  }
}
