/* ============================================================
   TOPOLOGY.CSS — CCNA Academy: drag-drop canvas, device chrome,
   link status, packet animation layer
   ============================================================ */

.topology-workspace {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: var(--sp-4);
  height: calc(100vh - var(--topbar-height) - var(--sp-6) * 2 - 60px);
}

.device-palette {
  padding: var(--sp-4);
  overflow-y: auto;
}

.palette-device {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: grab;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-1);
}
.palette-device:hover { background: var(--bg-panel-raised); border-color: var(--border-subtle); }
.palette-device:active { cursor: grabbing; }

.palette-device-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--accent-ccna);
}

.topology-canvas-wrap {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: var(--bg-inset);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.topology-canvas-wrap svg { width: 100%; height: 100%; display: block; }

.device-node {
  cursor: grab;
}
.device-node:active { cursor: grabbing; }
.device-node-body {
  fill: var(--bg-panel-raised);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}
.device-node.selected .device-node-body {
  stroke: var(--accent-primary);
  stroke-width: 2;
}
.device-node-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-primary);
  font-weight: 600;
}
.device-node-sublabel {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-muted);
}

.link-line {
  stroke: var(--signal-down);
  stroke-width: 2;
  transition: stroke var(--dur-base) var(--ease-out);
}
.link-line.up { stroke: var(--signal-up); }
.link-line.trunk { stroke-dasharray: 6 3; }

.link-led {
  transition: fill var(--dur-fast) var(--ease-out);
}
.link-led.up { fill: var(--signal-up); }
.link-led.down { fill: var(--signal-down); }

.packet-dot {
  filter: drop-shadow(0 0 4px currentColor);
}

.inspector-panel {
  padding: var(--sp-4);
  overflow-y: auto;
}

.iface-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.packet-header-box {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.packet-header-box .layer-name {
  color: var(--accent-ccna);
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

@media (max-width: 1100px) {
  .topology-workspace { grid-template-columns: 1fr; height: auto; }
}
