/* ============================================================
   ICIA Process — Graph View Styles (Obsidian-inspired)
   ============================================================ */

.graph-container {
  position: relative;
  background: radial-gradient(ellipse at center, #0f1923 0%, #080e15 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}

.graph-svg-wrapper {
  width: 100%;
  height: 620px;
  cursor: grab;
}

.graph-svg-wrapper:active {
  cursor: grabbing;
}

.graph-svg-wrapper svg {
  display: block;
}

/* ---- Nodes: Obsidian-style glowing orbs ---- */
.graph-node {
  cursor: pointer;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.graph-node circle,
.graph-node rect,
.graph-node polygon {
  transition: filter 0.3s ease, stroke-width 0.2s ease;
}

.graph-node:hover circle,
.graph-node:hover rect,
.graph-node:hover polygon {
  filter: url(#graph-glow);
  stroke-width: 3 !important;
}

.graph-node text {
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* Search states */
.graph-node.search-match circle,
.graph-node.search-match rect,
.graph-node.search-match polygon {
  filter: url(#graph-glow);
}

.graph-node.search-dim {
  opacity: 0.08;
}

.graph-node.search-dim text {
  opacity: 0.05;
}

/* ---- Edges: soft glowing lines ---- */
.graph-edge {
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

/* ---- Legend: frosted glass ---- */
.graph-legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 16px;
  background: rgba(8, 14, 21, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  z-index: 5;
}

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

.graph-legend-item span:first-child {
  font-size: 1rem;
  line-height: 1;
}

/* ---- Tooltip: frosted glass ---- */
.graph-tooltip {
  position: fixed;
  display: none;
  max-width: 320px;
  padding: 12px 16px;
  background: rgba(8, 14, 21, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  font-size: 0.82rem;
  color: var(--text-primary);
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
}

.graph-tooltip-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 3px;
  color: #fff;
}

.graph-tooltip-type {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.graph-tooltip-desc {
  color: rgba(255,255,255,0.6);
  font-size: 0.78rem;
  line-height: 1.45;
  margin-bottom: 4px;
}

.graph-tooltip-meta {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  margin-top: 3px;
}

/* ---- Panel: frosted sidebar ---- */
.graph-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: rgba(8, 14, 21, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 20px;
  overflow-y: auto;
  z-index: 10;
  animation: slideInRight 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.graph-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.graph-panel-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  flex: 1;
  color: #fff;
}

.graph-panel-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.graph-panel-table tr:not(:last-child) {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.graph-panel-table td {
  padding: 6px 0;
}

.graph-panel-conn {
  transition: background 0.15s ease;
  border-radius: 8px;
}

.graph-panel-conn:hover {
  background: rgba(255,255,255,0.06);
}

/* ---- Filters: clean row ---- */
.graph-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.graph-filters .filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.graph-filters .filter-group label {
  font-size: 0.73rem;
  color: rgba(255,255,255,0.4);
  margin-right: 4px;
  white-space: nowrap;
}

.graph-filters .btn-sm {
  padding: 5px 12px;
  font-size: 0.75rem;
  min-width: auto;
  border-radius: 8px;
}

.graph-filters input[type="text"] {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 0.82rem;
  transition: border-color 0.2s ease;
}

.graph-filters input[type="text"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(212,168,75,0.15);
}

/* ---- Real table and view nodes ---- */
.graph-node-tabela-real { cursor: pointer; }
.graph-node-view { cursor: pointer; }

/* ---- Zoom controls ---- */
.graph-zoom-controls {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
