/* kennisgraaf.css — styles for the interactive knowledge graph page */

/* ── page layout ── */
.graaf-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* ── toolbar ── */
.graaf-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-wrap: wrap;
  flex-shrink: 0;
  z-index: 10;
}

.graaf-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2, #f3f4f6);
  border-radius: 8px;
  padding: 7px 12px;
  min-width: 200px;
}

.graaf-search svg {
  width: 15px;
  height: 15px;
  stroke: #9ca3af;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}

.graaf-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--text, #111827);
  width: 180px;
}

.graaf-search input::placeholder { color: #9ca3af; }

/* ── filter chips ── */
.graaf-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.graaf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 20px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text, #374151);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}

.graaf-chip:hover {
  background: var(--surface-2, #f3f4f6);
}

.graaf-chip--active {
  background: var(--surface-2, #f3f4f6);
  border-color: var(--accent, #1ac190);
  font-weight: 600;
}

.graaf-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── legend ── */
.graaf-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: #6b7280;
  margin-left: auto;
}

.graaf-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* ── graph canvas ── */
.graaf-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--surface-2, #f9fafb);
  cursor: grab;
}

.graaf-container:active { cursor: grabbing; }

#graafSvg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── SVG elements ── */
.graaf-link {
  stroke: #d1d5db;
  stroke-width: 1px;
  stroke-opacity: 0.5;
}

.graaf-node {
  cursor: pointer;
}

.graaf-node circle {
  stroke: rgba(255,255,255,0.85);
  stroke-width: 1.5px;
  transition: filter 0.15s;
}

.graaf-node:hover circle {
  filter: brightness(1.15) drop-shadow(0 2px 6px rgba(0,0,0,0.18));
}

.graaf-label {
  font-size: 9.5px;
  fill: #374151;
  pointer-events: none;
  user-select: none;
  paint-order: stroke fill;
  stroke: var(--surface-2, #f9fafb);
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* ── loading overlay ── */
.graaf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--surface-2, #f9fafb);
  z-index: 5;
  transition: opacity 0.3s;
}

.graaf-loading p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.graaf-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border, #e5e7eb);
  border-top-color: var(--accent, #1ac190);
  border-radius: 50%;
  animation: graaf-spin 0.7s linear infinite;
}

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

/* ── tooltip ── */
.graaf-tooltip {
  position: absolute;
  z-index: 20;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px 16px;
  max-width: 270px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  pointer-events: none;
  display: none;
}

.graaf-tooltip__type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 5px;
}

.graaf-tooltip__name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 7px;
  line-height: 1.3;
  color: var(--text, #111827);
}

.graaf-tooltip__desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.55;
  margin-bottom: 10px;
}

.graaf-tooltip__link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #1ac190);
  text-decoration: none;
  pointer-events: auto;
}

.graaf-tooltip__link:hover { text-decoration: underline; }

/* ── hint text ── */
.graaf-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #9ca3af;
  pointer-events: none;
  white-space: nowrap;
}

/* ── responsive ── */
@media (max-width: 640px) {
  .graaf-toolbar { padding: 8px 12px; gap: 8px; }
  .graaf-search { min-width: unset; }
  .graaf-search input { width: 130px; }
  .graaf-legend { display: none; }
  .graaf-page { height: calc(100vh - 56px); }
}
