/* ============================================================
   PIPERNET STUDIO // PANE & WORKBENCH VIEW STYLES
   2D Canvas Graph, Cards Matrix, Poster Art, Tables, Event Console
   ============================================================ */

/* View Mode Switcher Buttons */
.view-toggle-group {
  display: inline-flex;
  align-items: center;
  background: var(--void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-toggle-btn {
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--platinum-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  color: var(--platinum-high);
}

.view-toggle-btn.active {
  background: #ffffff;
  color: #000000;
  font-weight: 800;
}

/* Filter Chips Strip */
.knowledge-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-chip-btn {
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--platinum-body);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.filter-chip-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  font-weight: 700;
}

/* ==========================================
   PANE 0: TOPOLOGY CANVAS & CARDS MATRIX
   ========================================== */
#pane-allnodes.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.allnodes-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.mesh-stats-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--platinum-muted);
  letter-spacing: 0.04em;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.canvas-graph-container {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: var(--canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

#topologyCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#topologyCanvas:active {
  cursor: grabbing;
}

/* Vertical 2-Row Zoom Dock (Bottom-Left Corner) */
.graph-zoom-dock {
  position: absolute;
  bottom: 46px;
  left: 12px;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  overflow: hidden;
  z-index: 50;
  pointer-events: auto;
}

.graph-zoom-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--platinum-high);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
  pointer-events: auto;
}

.graph-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.graph-zoom-btn:active {
  background: rgba(255, 255, 255, 0.28);
}

.graph-zoom-btn:first-child {
  border-bottom: 1px solid var(--border-subtle);
}

/* Floating HUD Legend */
.graph-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(8, 8, 13, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--platinum-muted);
  z-index: 10;
}

.graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Floating HUD Info Tooltip */
.graph-hud-info {
  position: absolute;
  bottom: 50px;
  right: 14px;
  background: rgba(14, 14, 20, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  max-width: 320px;
  display: none;
  z-index: 20;
}

/* All 140 Nodes Cards Matrix */
.node-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.node-matrix-card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.node-matrix-card:hover {
  border-color: var(--border-medium);
  background: var(--card-hover);
  transform: translateY(-1px);
}

.node-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.node-card-id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
}

.node-card-title {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--platinum-high);
  margin-top: 3px;
  line-height: 1.35;
}

.node-card-desc {
  font-size: 11.5px;
  color: var(--platinum-body);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.node-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--platinum-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
}

/* ==========================================
   PANE 1: SOVEREIGN AGENTS (POSTER & TABLE)
   ========================================== */
.agents-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.agent-poster-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
  cursor: pointer;
  isolation: isolate;
  box-shadow: none !important;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.agent-poster-card:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--card-hover);
  transform: translateY(-3px);
}

.agent-poster-card.is-active-card {
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.card-poster-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.card-poster-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  filter: grayscale(100%) contrast(120%);
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.agent-poster-card:hover .card-poster-art img {
  opacity: 0.42;
  transform: scale(1.03);
}

.card-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 14, 20, 0.5) 0%, rgba(14, 14, 20, 0.85) 60%, rgba(14, 14, 20, 0.98) 100%);
  z-index: 1;
}

.card-top-content {
  position: relative;
  z-index: 2;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-bottom-content {
  position: relative;
  z-index: 2;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-card-name {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 800;
  color: var(--platinum-high);
  letter-spacing: -0.01em;
}

.agent-card-role {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--platinum-muted);
}

.agent-card-bio {
  font-size: 12px;
  color: var(--platinum-body);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Studio Matrix Table */
.studio-matrix-table-wrap {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.studio-matrix-table-wrap.active {
  display: block;
}

.studio-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.studio-matrix-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--platinum-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  white-space: nowrap;
}

.studio-matrix-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--platinum-body);
}

.studio-matrix-table tr:hover td {
  background: var(--card-hover);
  color: var(--platinum-high);
}

/* ==========================================
   PANE 2: LIVING KNOWLEDGE STREAM
   ========================================== */
.knowledge-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.knowledge-item-row {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.knowledge-item-row:hover {
  border-color: var(--border-medium);
  background: var(--card-hover);
}

/* ==========================================
   PANE 4: TOPOLOGY & GRAVITY (Bounded Contexts)
   ========================================== */
.gravity-banner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .gravity-banner-grid {
    grid-template-columns: 1fr;
  }
}

.gravity-callout-card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.gravity-callout-card h3 {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--platinum-high);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gravity-callout-card p {
  font-size: 12px;
  color: var(--platinum-body);
  line-height: 1.45;
  margin-bottom: 10px;
}

.code-snippet-box {
  background: var(--void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #ffffff;
}

.domains-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.domain-mesh-card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

/* ==========================================
   PANE 5 & 6: PROBES & LIVE EVENT LOG STREAM
   ========================================== */
.probes-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.probe-action-card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.probe-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.probe-card-head h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--platinum-high);
}

.probe-card-desc {
  font-size: 11.5px;
  color: var(--platinum-body);
}

.terminal-output-box {
  background: var(--void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: #e2e8f0;
  overflow-x: auto;
  max-height: 480px;
  white-space: pre-wrap;
  word-break: break-all;
}

.studio-event-stream {
  background: var(--void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-log-entry {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.event-time {
  color: var(--platinum-muted);
  font-size: 10px;
  white-space: nowrap;
}

.event-tag {
  color: #000000;
  background: #ffffff;
  padding: 1px 5px;
  border-radius: 2px;
  font-weight: 700;
  font-size: 9.5px;
}

.event-msg {
  color: var(--platinum-body);
  flex: 1;
  word-break: break-word;
}
