/* ナレッジグラフ関連のスタイル */

/* グラフコンテナ */
.graph-container {
  width: 100%;
  height: 400px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f9f9f9;
  margin: 15px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* グラフ表示がアクティブな時のコンテナ */
.graph-container.active {
  height: 500px;
}

/* グラフ表示エリア */
.graph-display {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* グラフツールバー */
.graph-toolbar {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  background-color: #f0f0f0;
  border-bottom: 1px solid #ddd;
  border-radius: 8px 8px 0 0;
}

/* グラフツールバーボタン */
.graph-toolbar button {
  padding: 4px 8px;
  margin: 0 2px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.graph-toolbar button:hover {
  background-color: #e0e0e0;
}

.graph-toolbar button.active {
  background-color: #4a89dc;
  color: white;
  border-color: #3a79cc;
}

/* グラフツールチップ */
.graph-tooltip {
  max-width: 250px;
  background-color: white;
  padding: 0;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  border: 1px solid #ddd;
  overflow: hidden;
}

.tooltip-title {
  padding: 6px 10px;
  font-weight: bold;
  color: white;
  font-size: 13px;
}

.tooltip-title.card {
  background-color: #4a89dc;
}

.tooltip-title.research {
  background-color: #8cc152;
}

.tooltip-title.note {
  background-color: #f6bb42;
}

.tooltip-title.chunk {
  background-color: #d770ad;
}

.tooltip-content {
  padding: 8px 10px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.4;
}

.tooltip-content div {
  margin-bottom: 4px;
}

/* セマンティック検索結果 */
.semantic-search-results {
  margin-top: 20px;
}

.semantic-result-item {
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: white;
  transition: all 0.2s ease;
}

.semantic-result-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.result-source {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.result-text {
  font-size: 14px;
  margin-bottom: 6px;
}

.result-similarity {
  font-size: 11px;
  color: #888;
  text-align: right;
}

.result-card-link {
  display: inline-block;
  font-size: 12px;
  color: #4a89dc;
  margin-top: 5px;
  cursor: pointer;
  text-decoration: underline;
}

/* 閉じるボタンなど */
.graph-close {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.graph-close:hover {
  color: #666;
}

/* グラフローディングインジケータ */
.graph-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
}

.graph-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top: 4px solid #4a89dc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
  .graph-container {
    height: 300px;
  }
  
  .graph-container.active {
    height: 400px;
  }
}
