/* ═══════════════════════════════════════════════════════
   CVC Dashboard — Hive Singularity UI (Sci-Fi Schematic)
   ═══════════════════════════════════════════════════════ */

#tab-swarm {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background-color: #010306; /* Darker background for high contrast */
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
}

#swarm-canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ── SVG Schematic Animations & Colors ── */

.neural-wire {
  fill: none;
  stroke: rgba(0, 255, 204, 0.15);
  stroke-width: 1.5px;
  stroke-dasharray: 4, 8;
  animation: wire-flow 20s linear infinite;
}
@keyframes wire-flow {
  to { stroke-dashoffset: -100; }
}

.pulse-read {
  fill: #00ffff;
  filter: drop-shadow(0 0 8px #00ffff);
}

.pulse-write {
  fill: #ffaa00;
  filter: drop-shadow(0 0 8px #ffaa00);
}

.robot-avatar {
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.robot-head { fill: #0b1118; stroke: rgba(255, 255, 255, 0.1); stroke-width: 1; }
.robot-body { fill: #060a10; stroke: rgba(255, 255, 255, 0.1); stroke-width: 1; }
.robot-limb { stroke-width: 2; stroke-linecap: round; opacity: 0.6; }
.robot-label { fill: #ffffff; font-size: 10px; text-anchor: middle; font-weight: bold; }

/* Thinking Animation */
.robot-avatar.thinking .robot-visor {
  animation: visor-blink 0.2s infinite alternate;
  filter: drop-shadow(0 0 10px currentColor);
}
@keyframes visor-blink {
  from { opacity: 0.2; }
  to { opacity: 1; }
}

/* Superbrain Core */
.brain-core {
  fill: rgba(0, 50, 80, 0.8);
  stroke: #00ffff;
  stroke-width: 2;
  filter: drop-shadow(0 0 25px rgba(0, 255, 255, 0.4));
  transition: fill 0.1s;
}
.brain-core.flash {
  fill: rgba(0, 200, 255, 0.9);
  filter: drop-shadow(0 0 50px rgba(0, 255, 255, 1));
}

.brain-inner {
  fill: none;
  stroke: rgba(0, 255, 255, 0.8);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
  animation: spin-slow 15s linear infinite;
  transform-origin: center;
}
.brain-inner-rev {
  fill: none;
  stroke: rgba(0, 255, 255, 0.5);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  animation: spin-slow 10s linear infinite reverse;
  transform-origin: center;
}
.brain-pulse {
  fill: none;
  stroke: rgba(0, 255, 255, 0.5);
  stroke-width: 1;
  animation: brain-throb 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-origin: center;
}
.brain-label {
  fill: #00ffff;
  font-size: 14px;
  font-weight: bold;
  text-anchor: middle;
  text-shadow: 0 0 8px #00ffff;
  letter-spacing: 2px;
}

@keyframes spin-slow { 100% { transform: rotate(360deg); } }
@keyframes brain-throb {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Sci-Fi Overlay Grid */
.swarm-ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  padding: 20px;
  box-sizing: border-box;
  background: radial-gradient(circle at center top, transparent 40%, rgba(0, 5, 15, 0.8) 100%);
}

/* Glassmorphism Panels */
.cyber-panel {
  background: rgba(2, 6, 12, 0.7);
  border: 1px solid rgba(0, 255, 204, 0.2);
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.05), inset 0 0 20px rgba(0, 255, 204, 0.02);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 6px;
  padding: 15px;
  color: #00ffcc;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

.panel-title {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(0, 255, 204, 0.2);
  padding-bottom: 5px;
  text-shadow: 0 0 5px #00ffcc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title .pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #00ffcc;
  border-radius: 50%;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(0, 255, 204, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 204, 0); }
}

/* Left Panel: Stats & Agents */
.swarm-left {
  width: 280px;
  height: calc(100vh - 40px);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
}
.stat-label { color: rgba(255, 255, 255, 0.7); }
.stat-value { color: #fff; font-weight: bold; text-shadow: 0 0 5px #fff; }

.agent-list {
  flex: 1;
  overflow-y: auto;
  margin-top: 10px;
  padding-right: 5px;
}
.agent-list::-webkit-scrollbar { width: 3px; }
.agent-list::-webkit-scrollbar-thumb { background: rgba(0, 255, 204, 0.3); }

.agent-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: rgba(0, 255, 204, 0.03);
  border-left: 2px solid #00ffcc;
  font-size: 10px;
  transition: all 0.2s;
}
.agent-item:hover { background: rgba(0, 255, 204, 0.1); cursor: pointer; }
.agent-icon { margin-right: 8px; text-shadow: 0 0 5px currentColor; }

/* Right Panel: Live Telemetry Feed */
.swarm-right {
  width: 320px;
  height: calc(100vh - 40px);
}

.terminal-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.terminal-feed::-webkit-scrollbar { width: 3px; }
.terminal-feed::-webkit-scrollbar-thumb { background: rgba(0, 255, 204, 0.3); }

.log-entry {
  font-size: 10px;
  margin-bottom: 6px;
  line-height: 1.4;
  word-break: break-all;
  animation: slide-in 0.2s ease-out forwards;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.log-time { color: rgba(255, 255, 255, 0.4); margin-right: 5px; }
.log-agent { color: #fff; font-weight: bold; }
.log-action { font-weight: bold; }
.log-action.read { color: #00ffff; text-shadow: 0 0 3px #00ffff; }
.log-action.write { color: #ffaa00; text-shadow: 0 0 3px #ffaa00; }

/* Scanline Effect */
.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.15) 50%, rgba(0,0,0,0.15));
  background-size: 100% 4px;
  z-index: 11;
  pointer-events: none;
  opacity: 0.4;
}
