/* Explorer Page Styles */

.explorer-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.header-nav {
  display: flex;
  gap: 1rem;
}

.nav-link {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-alt);
  border-color: var(--text-muted);
}

.nav-link--active {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent);
}

/* Main Layout */
.explorer-main {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  min-height: 0;
}

/* Sidebar */
.explorer-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: calc(100vh - 60px);
}

.panel-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 0.75rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.panel-header .panel-title {
  margin: 0;
}

/* Search Panel */
.search-panel {
  padding: 1rem;
  border-bottom: 1px solid var(--divider);
}

.explorer-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.explorer-search input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  background: var(--surface-alt);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
}

.explorer-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

.search-results {
  max-height: 300px;
  overflow-y: auto;
}

.search-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.search-result-item {
  padding: 0.75rem;
  background: var(--surface-alt);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.search-result-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.search-result-item.active {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.result-type {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--bg);
}

.result-name {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-all;
}

.result-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Entity Details Panel */
.entity-panel {
  padding: 1rem;
  border-bottom: 1px solid var(--divider);
}

.entity-content {
  font-size: 0.85rem;
}

.entity-field {
  margin-bottom: 0.75rem;
}

.entity-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.entity-field-value {
  font-family: 'Space Mono', monospace;
  color: var(--text);
  word-break: break-all;
}

.entity-description {
  color: var(--text-soft);
  line-height: 1.5;
  max-height: 100px;
  overflow-y: auto;
}

/* Filter Panel */
.filter-panel {
  padding: 1rem;
  border-bottom: 1px solid var(--divider);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  font-size: 0.7rem;
  padding: 0.3rem 0.5rem;
  background: var(--surface-alt);
  border: 1px solid var(--divider);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover {
  border-color: var(--outline);
  color: var(--text);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* Legend Panel */
.legend-panel {
  padding: 1rem;
}

.legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Graph Container */
.explorer-graph-container {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.graph-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  background: var(--divider);
  margin: 0 0.5rem;
}

.toolbar-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

.graph-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}

.btn-icon-sm--danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Notification Toast */
.explorer-notification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  z-index: 1000;
  animation: notificationSlideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 400px;
}

.explorer-notification--info {
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
}

.explorer-notification--warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #f59e0b;
}

.explorer-notification--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #ef4444;
}

@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.explorer-graph {
  flex: 1;
  position: relative;
  min-height: 500px;
}

.graph-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.graph-placeholder svg {
  margin-bottom: 1rem;
}

/* Graph Tooltip */
.explorer-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  box-shadow: var(--shadow);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 300px;
}

.explorer-tooltip.visible {
  opacity: 1;
}

.tooltip-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  word-break: break-all;
}

.tooltip-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tooltip-meta {
  font-size: 0.7rem;
  color: var(--text-soft);
  margin-top: 0.25rem;
}

/* Graph Node Styles */
.explorer-graph svg {
  width: 100%;
  height: 100%;
}

.node-circle {
  cursor: pointer;
  transition: r 0.15s;
}

.node-circle:hover {
  filter: brightness(1.2);
}

.node-label {
  font-size: 10px;
  fill: var(--text);
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: middle;
}

.link-line {
  stroke: var(--outline);
  stroke-opacity: 0.4;
  fill: none;
}

.link-line:hover {
  stroke-opacity: 0.8;
}

.link-label {
  font-size: 8px;
  fill: var(--text-muted);
  pointer-events: none;
}

/* Loading State */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 19, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--divider);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Mobile */
@media (max-width: 900px) {
  .explorer-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  
  .explorer-sidebar {
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  
  .search-results {
    max-height: 200px;
  }
  
  .filter-panel, .legend-panel {
    display: none;
  }
}
