/* ==========================================================
   SiteLink Vision - Modern Dark Theme & Glassmorphism Design
   ========================================================== */

:root {
  --bg-main: #090d16;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-surface: #0f172a;
  --bg-header: rgba(15, 23, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);

  --accent-primary: #6366f1;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --status-200: #10b981;
  --status-300: #f59e0b;
  --status-400: #ef4444;
  --status-500: #ec4899;

  --node-bg: #1e293b;
  --node-border: #334155;
  --link-color: rgba(148, 163, 184, 0.3);
  --link-hover: #38bdf8;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  --shadow-panel: 0 10px 30px rgba(0, 0, 0, 0.5);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.06) 0%, transparent 45%),
              var(--bg-main);
}

/* ==========================================================
   Header & Controls
   ========================================================== */

.app-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-title .accent {
  background: var(--accent-cyan-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.crawl-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 890px;
  margin: 0 24px;
}

.input-url-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-url-wrapper .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

.input-url-wrapper input {
  width: 100%;
  height: 42px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 16px 0 42px;
  color: var(--text-main);
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.input-url-wrapper input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.95);
}

.form-settings {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.setting-item label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.setting-item select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.setting-item select option {
  background: var(--bg-surface);
  color: var(--text-main);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #ef4444;
}

.btn-outline {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0 14px;
  height: 36px;
  font-size: 0.8rem;
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.hidden {
  display: none !important;
}

/* ==========================================================
   Sub-Header (KPI Cards & Controls)
   ========================================================== */

.sub-header {
  padding: 10px 24px;
  background: rgba(10, 15, 29, 0.65);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 30;
}

.kpi-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  padding: 6px 14px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-width: 95px;
}

.kpi-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
  color: #fff;
  letter-spacing: -0.02em;
}

.kpi-card#kpiPages .kpi-value { color: #38bdf8; }
.kpi-card#kpiLinks .kpi-value { color: #a78bfa; }
.kpi-card#kpiClusters .kpi-value { color: #ec4899; }
.kpi-card#kpiDepth .kpi-value { color: #34d399; }
.kpi-card#kpiErrors .kpi-value { color: #f87171; }

.kpi-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.view-switcher {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.view-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.view-tab:hover {
  color: var(--text-main);
}

.view-tab.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box input {
  height: 36px;
  width: 170px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: var(--text-main);
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-secondary);
  width: 200px;
}

.filter-select {
  height: 36px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 0 10px;
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
}

.export-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--shadow-panel);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-menu button {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.dropdown-menu button:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}

/* ==========================================================
   Live Crawl Status Bar
   ========================================================== */

.crawler-status-bar {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border-bottom: 1px solid rgba(99, 102, 241, 0.3);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideDown 0.3s ease;
  z-index: 25;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.progress-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-secondary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.status-texts {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.status-sub {
  font-size: 0.72rem;
  color: var(--accent-secondary);
  font-family: 'Fira Code', monospace;
  max-width: 500px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-meter {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-meter .counter {
  font-size: 0.78rem;
  font-family: 'Fira Code', monospace;
  color: var(--text-muted);
}

.progress-bar-bg {
  width: 180px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ==========================================================
   Main Workspace & Canvas
   ========================================================== */

.main-workspace {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

.viz-container {
  flex: 1;
  height: 100%;
  position: relative;
  background-color: #0b1120;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

#vizSvg {
  width: 100%;
  height: 100%;
  cursor: grab;
}

#vizSvg:active {
  cursor: grabbing;
}

/* Canvas Toolbar */
.canvas-toolbar {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.tool-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.tool-separator {
  height: 1px;
  background: var(--border-color);
  margin: 2px 0;
}

/* Legend */
.diagram-legend {
  position: absolute;
  bottom: 18px;
  left: 18px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  z-index: 20;
  pointer-events: none;
  transition: var(--transition-fast);
}

.legend-title {
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  margin-bottom: 2px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-root { background: #ec4899; box-shadow: 0 0 6px #ec4899; }
.dot-level1 { background: #6366f1; box-shadow: 0 0 6px #6366f1; }
.dot-level2 { background: #06b6d4; box-shadow: 0 0 6px #06b6d4; }
.dot-error { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

.line-sample {
  width: 16px;
  height: 2px;
  background: var(--link-hover);
}

/* Empty State */
.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  max-width: 420px;
  padding: 32px;
  background: rgba(17, 24, 39, 0.65);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================
   Dedicated Topic Clusters & Silos Container
   ========================================================== */

.clusters-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 17, 32, 0.98);
  backdrop-filter: blur(16px);
  overflow-y: auto;
  padding: 32px;
  z-index: 15;
}

.clusters-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
}

.clusters-header-banner h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.clusters-header-banner p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.cluster-badge-total {
  background: var(--accent-gradient);
  color: #fff;
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.clusters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.cluster-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-sm);
}

.cluster-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.cluster-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cluster-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.cluster-metrics-badge {
  font-size: 0.72rem;
  font-family: 'Fira Code', monospace;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.pillar-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.pillar-box:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
}

.pillar-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #a78bfa;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.pillar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pillar-path {
  font-size: 0.75rem;
  font-family: 'Fira Code', monospace;
  color: var(--accent-secondary);
}

.cluster-articles-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cluster-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cluster-articles-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.cluster-article-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cluster-article-item:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
}

.cluster-article-path {
  font-family: 'Fira Code', monospace;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
}

.cluster-article-links {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ==========================================================
   Side Inspector Panel
   ========================================================== */

.inspector-panel {
  width: 380px;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 35;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.4);
  animation: slideLeft 0.25s ease;
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.inspector-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.inspector-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.inspector-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-secondary);
  letter-spacing: 0.06em;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

.inspect-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
}

.inspect-url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.inspect-url {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--accent-secondary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.inspect-url:hover {
  text-decoration: underline;
}

.icon-action-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.icon-action-btn:hover {
  color: #fff;
}

.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.inspect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.inspect-cell {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.cell-val {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
}

.badge-status-200 { color: var(--status-200); }
.badge-status-404 { color: var(--status-400); }
.badge-status-301 { color: var(--status-300); }

.inspector-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.inspect-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 4px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}

.inspect-tab.active {
  color: #fff;
  border-bottom-color: var(--accent-primary);
}

.links-list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.link-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(30, 41, 59, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.link-item-row:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
}

.link-item-path {
  font-family: 'Fira Code', monospace;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.link-item-status {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================
   D3 Graph Elements (Tree & Block styles)
   ========================================================== */

/* Tree Diagram styles */
.tree-link {
  fill: none;
  stroke: var(--link-color);
  stroke-width: 1.5px;
  transition: stroke 0.2s, stroke-width 0.2s;
}

.tree-link.highlighted {
  stroke: var(--accent-secondary);
  stroke-width: 2.5px;
  stroke-dasharray: 4, 2;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -12; }
}

.tree-node {
  cursor: pointer;
}

.tree-node rect.node-card {
  fill: #111827;
  stroke: #374151;
  stroke-width: 1.5px;
  rx: 8px;
  ry: 8px;
  transition: all 0.2s ease;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.tree-node:hover rect.node-card {
  stroke: var(--accent-primary);
  fill: #1e293b;
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.4));
}

.tree-node.selected rect.node-card {
  stroke: #38bdf8;
  stroke-width: 2.5px;
  fill: #0f172a;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.5));
}

.tree-node text.node-title {
  fill: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  pointer-events: none;
}

.tree-node text.node-sub {
  fill: #94a3b8;
  font-size: 9.5px;
  font-family: 'Fira Code', monospace;
  pointer-events: none;
}

.tree-node circle.status-dot {
  stroke: #090d16;
  stroke-width: 2px;
}

.tree-node circle.expand-badge {
  fill: #3b82f6;
  stroke: #1e293b;
  stroke-width: 2px;
  transition: transform 0.2s;
}

.tree-node text.expand-text {
  fill: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

/* Block / Force Diagram styles */
.block-link {
  fill: none;
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 1.4px;
  transition: stroke 0.2s, stroke-width 0.2s;
}

.block-link.highlight-outgoing {
  stroke: #06b6d4;
  stroke-width: 2.5px;
  stroke-opacity: 0.95;
}

.block-link.highlight-incoming {
  stroke: #a855f7;
  stroke-width: 2.5px;
  stroke-opacity: 0.95;
}

.block-node {
  cursor: grab;
}

.block-node:active {
  cursor: grabbing;
}

.block-node rect.block-bg {
  fill: #111827;
  stroke: #334155;
  stroke-width: 1.5px;
  rx: 6px;
  ry: 6px;
  transition: all 0.2s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.block-node:hover rect.block-bg {
  stroke: var(--accent-secondary);
  fill: #1e293b;
  filter: drop-shadow(0 0 14px rgba(6, 182, 212, 0.4));
}

.block-node.selected rect.block-bg {
  stroke: #ec4899;
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 16px rgba(236, 72, 153, 0.5));
}

.block-node.dimmed {
  opacity: 0.15;
}

.block-node text.block-label {
  fill: #f1f5f9;
  font-size: 10px;
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  pointer-events: none;
}

.block-node text.block-inout {
  fill: #94a3b8;
  font-size: 8.5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  pointer-events: none;
}
