/* ============================================================
   AIN Topology Graph — additions for the revamped Live Map
   - Custom hover tooltip (nodes + edges)
   - Side-panel header icon
   - Connection rows with port info
   These complement (not replace) the existing .topo-* rules in
   styles.css.
   ============================================================ */

/* ── Side-panel: bigger so port lists fit comfortably ─────── */
.topo-detail.open { width: 340px; }

/* ── Header device icon at the top of the side panel ──────── */
.topo-d-hdr-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.topo-d-hdr-icon svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.4));
}
.topo-d-stat {
  border-width: 1px !important;
  border-style: solid !important;
}

/* ── Connections list ─────────────────────────────────────── */
.topo-d-empty {
  font-size: 11px;
  color: #6b7280;
  padding: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.topo-d-conns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.topo-d-conn {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 8px 10px;
  transition: background 0.15s, border-color 0.15s;
}
.topo-d-conn:hover {
  background: rgba(6, 182, 212, 0.06);
  border-color: rgba(6, 182, 212, 0.3);
}
.topo-d-conn-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.topo-d-conn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.topo-d-conn-name {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topo-d-conn-proto {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border: 1px solid;
  border-radius: 2px;
  flex-shrink: 0;
}
.topo-d-conn-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-family: monospace;
}
.topo-d-conn-port {
  background: rgba(6, 182, 212, 0.12);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.topo-d-conn-arrow {
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
}
.topo-d-conn-ip {
  font-size: 10px;
  color: #6b7280;
  font-family: monospace;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.mono { font-family: monospace; }

/* ── Custom hover tooltip ─────────────────────────────────── */
.topo-tip {
  position: absolute;
  z-index: 50;
  min-width: 200px;
  max-width: 320px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.97), rgba(20, 30, 50, 0.95));
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 6px;
  padding: 10px 12px;
  pointer-events: none;
  font-size: 11px;
  color: #e5e7eb;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  animation: topo-tip-in 0.15s ease;
}
@keyframes topo-tip-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.topo-tip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  font-size: 10px;
}
.topo-tip-row > span:first-child {
  color: #9ca3af;
  letter-spacing: 0.5px;
}
.topo-tip-row > span:last-child,
.topo-tip-row > b {
  color: #fff;
  font-weight: 600;
}
.topo-tip-row .mono { color: #67e8f9; }

.topo-tip-head {
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
  padding-bottom: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}
.topo-tip-head b {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.topo-tip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}
.topo-tip-proto {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border: 1px solid;
  border-radius: 2px;
}

/* Edge tooltip — link layout */
.topo-tip-link {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topo-tip-side {
  text-align: center;
  min-width: 0;
}
.topo-tip-side-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.topo-tip-side-port {
  font-size: 11px;
  font-weight: 700;
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 3px;
  padding: 2px 6px;
  display: inline-block;
  margin-bottom: 4px;
}
.topo-tip-side-ip {
  font-size: 9px;
  color: #9ca3af;
  font-family: monospace;
}
.topo-tip-arrow {
  font-size: 18px;
  font-weight: 800;
  color: #06B6D4;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}