/* Social Radar v2 — Graph */

/* === Main Layout (Index Page) === */
.layout-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.layout-main {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.layout-sidebar {
  width: var(--sidebar-width);
  border-left: 1px solid var(--color-border);
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.25);
  background: var(--color-surface);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease;
}

/* === Graph Container === */
#graph-container {
  flex: 1;
  min-height: 400px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, rgba(191, 160, 101, 0.02) 0%, transparent 70%),
    radial-gradient(circle at 50% 50%, transparent 29%, rgba(191, 160, 101, 0.008) 30%, transparent 31%),
    radial-gradient(circle at 50% 50%, transparent 49%, rgba(191, 160, 101, 0.005) 50%, transparent 51%),
    var(--color-bg);
}

#loading-progress {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  color: var(--color-text-secondary);
  z-index: 10;
}

/* Graph Legend */
.graph-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 12px;
  padding: 6px 12px;
  background: rgba(15, 20, 25, 0.7);
  border-radius: 6px;
  border: 1px solid rgba(48, 54, 61, 0.5);
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  z-index: 10;
  pointer-events: none;
}

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

.legend-circle {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid;
  flex-shrink: 0;
}

.legend-circle-core {
  width: 12px;
  height: 12px;
  background: var(--color-tier-core);
  border-color: #7B27CC;
}

.legend-circle-regular {
  width: 10px;
  height: 10px;
  background: var(--color-tier-regular);
  border-color: #1A3A9E;
  opacity: 0.75;
}

.legend-circle-emerging {
  width: 8px;
  height: 8px;
  background: var(--color-tier-emerging);
  border-color: #00D4D4;
  opacity: 0.5;
}

.legend-gold-dash {
  display: inline-block;
  width: 20px;
  height: 0;
  border-top: 2px dashed var(--color-bridge-gold);
  flex-shrink: 0;
}

.graph-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  font-size: 0.85rem;
  color: var(--color-text-dim);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-shrink: 0;
  contain: layout;
}

.graph-meta-sep {
  margin: 0 6px;
  color: var(--color-border);
}

.graph-meta-stats {
  display: flex;
  align-items: center;
}

.graph-meta-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.graph-meta-nav a {
  color: var(--color-text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s;
}

.graph-meta-nav a:hover {
  color: var(--color-text);
}

.graph-meta-num {
  font-weight: 700;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.graph-meta-scan {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 16px;
  overflow: hidden;
}

.scan-bar {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-border) 20%,
    var(--color-accent) 50%,
    var(--color-border) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: scanMove 4s linear infinite;
  opacity: 0.4;
}

@keyframes scanMove {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.freshness-stale {
  color: #FFD93D;
}

/* === vis.js Navigation Buttons — Dark Theme + Auto-hide === */
div.vis-network .vis-navigation .vis-button {
  filter: invert(1) brightness(0.6);
  opacity: 0.15;
  transition: opacity 0.3s ease;
  width: 28px;
  height: 28px;
  background-size: 28px 28px;
}

div.vis-network:hover .vis-navigation .vis-button {
  opacity: 0.6;
}

div.vis-network .vis-navigation .vis-button:hover {
  opacity: 1;
  filter: invert(1) brightness(0.8);
}

div.vis-network .vis-navigation .vis-button:active {
  opacity: 1;
  filter: invert(1) brightness(1);
}

/* === vis.js Tooltip — Dark Theme === */
div.vis-tooltip {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  font-family: var(--font-main);
  pointer-events: none;
}

.vis-tooltip-custom {
  padding: 10px 14px;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 8px;
  border-top: 3px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  font-size: 0.8rem;
  line-height: 1.6;
  min-width: 140px;
  max-width: 260px;
}

.vis-tooltip-custom strong {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 4px;
}

.vis-tooltip-custom .tt-row {
  display: block;
}

.vis-tooltip-custom .tt-label {
  color: var(--color-text-secondary);
  margin-right: 6px;
}

.vis-tooltip-custom .tt-label::after {
  content: "\FF1A";
}

/* Edge Detail Card */
.edge-detail-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: rgba(26, 31, 46, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(48, 54, 61, 0.6);
  border-top: 3px solid var(--color-signal);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 80;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.edge-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
}

.edge-detail-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.edge-detail-close:hover {
  color: var(--color-text);
}

.edge-detail-body {
  padding: 12px 16px;
}

.edge-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}

.edge-detail-row:last-of-type {
  border-bottom: none;
}

.edge-detail-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.edge-detail-value {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--color-text);
}

.edge-detail-note {
  font-size: 0.78rem;
  color: var(--color-signal);
  background: rgba(191, 160, 101, 0.08);
  border-left: 3px solid var(--color-signal);
  padding: 6px 10px;
  margin: 6px 0;
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}

.edge-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.edge-detail-link {
  flex: 1;
  text-align: center;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-family: var(--font-main);
  color: var(--color-accent-text);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.edge-detail-link:hover {
  background: var(--color-accent-bg);
  border-color: var(--color-accent);
  text-decoration: none;
}

/* Natural language edge explanation */
.edge-detail-explain {
  font-size: 0.82rem;
  color: var(--color-text);
  line-height: 1.6;
  padding: 10px 12px;
  background: rgba(0, 229, 255, 0.08);
  border-radius: 6px;
  margin-bottom: 10px;
}

.edge-detail-explain .explain-label {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.edge-detail-raw {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
}

/* Edge hover relation type dialog */
.edge-type-dialog {
  position: absolute;
  max-width: 320px;
  padding: 10px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-signal);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 60;
  pointer-events: none;
  animation: infoTipFadeIn 0.12s ease;
}

.edge-type-dialog-body {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ============================================================
   Schema v3.0 — Burst Animation (is_burst nodes)
   ============================================================ */
@keyframes burst-glow {
  0%, 100% {
    box-shadow: 0 0 4px rgba(255, 160, 64, 0.3);
  }
  50% {
    box-shadow: 0 0 12px rgba(255, 160, 64, 0.7), 0 0 24px rgba(255, 160, 64, 0.3);
  }
}


.keyword-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.keyword-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text);
}


/* ============================================================
   View Mode Toggle Button
   ============================================================ */
.view-mode-btn {
  padding: 5px 14px;
  margin-left: 8px;
  border: 1px solid var(--color-signal);
  border-bottom: none;
  border-radius: 4px;
  background: rgba(191, 160, 101, 0.10);
  color: var(--color-signal);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  outline: none;
  vertical-align: middle;
}

.view-mode-btn:hover {
  background: rgba(191, 160, 101, 0.22);
  color: var(--color-signal-hover);
  border-color: var(--color-signal-hover);
}
