/* ════════════════════════════════════════════════
   explorer.css — Hardware Explorer Styles
   OpenRelay · FIKSI 2026
═════════════════════════════════════════════════ */

/* ── SIGNAL FLOW SECTION ── */
.signal-flow-section {
  background: var(--bg);
}

/* ── BLUEPRINT CONTAINER ── */
.signal-flow-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 48px auto 0;
  background:
    var(--bg3)
    url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='none'/%3E%3Cpath d='M0 0 L20 20' stroke='rgba(245,158,11,0.05)' stroke-width='1'/%3E%3Cpath d='M20 0 L0 20' stroke='rgba(245,158,11,0.05)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 20px 20px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 48px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(245, 158, 11, 0.06);
}

/* ── COORDINATE MARKERS ── */
.coord {
  position: absolute;
  font-family: 'Chakra Petch', monospace;
  font-size: 9px;
  color: rgba(245,158,11,0.3);
  pointer-events: none;
  letter-spacing: 0.5px;
}

.coord-tl { top: 8px; left: 10px; }
.coord-tr { top: 8px; right: 10px; text-align: right; }
.coord-bl { bottom: 8px; left: 10px; }
.coord-br { bottom: 8px; right: 10px; text-align: right; }

/* ── FLOW TRACK — horizontal flex chain ── */
.signal-flow-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  z-index: 2;
}

/* ── NODE ── */
.signal-flow-node {
  flex-shrink: 0;
  width: 148px;
  padding: 16px 12px;
  background: rgba(7, 10, 15, 0.85);
  border: 1px solid var(--amber);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.signal-flow-node:hover,
.signal-flow-node.node-active {
  background: linear-gradient(135deg, var(--amber), var(--amber2));
  border-color: var(--amber2);
  box-shadow: 0 0 30px rgba(245,158,11,0.5), 0 0 60px rgba(245,158,11,0.2);
  transform: translateY(-4px) scale(1.06);
}

.signal-flow-node:hover .node-label,
.signal-flow-node.node-active .node-label {
  color: rgba(0,0,0,0.6);
}

.signal-flow-node:hover .node-title,
.signal-flow-node.node-active .node-title {
  color: #000;
}

.node-label {
  font-family: 'Chakra Petch', monospace;
  font-size: 9px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
  letter-spacing: 1px;
  transition: color 0.25s;
}

.node-title {
  font-family: 'Chakra Petch', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.3;
  transition: color 0.25s;
}

/* ── CONNECTION BETWEEN NODES ── */
.signal-flow-connection {
  flex-shrink: 0;
  width: 48px;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--amber) 0%,
    transparent 50%,
    var(--amber) 100%
  );
  background-size: 200% 100%;
  background-position: 0 0;
  animation: march 1.8s linear infinite;
  opacity: 0.35;
  transition: opacity 0.25s, box-shadow 0.25s;
  position: relative;
}

.signal-flow-connection::before,
.signal-flow-connection::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.5;
}
.signal-flow-connection::before { left: 0; }
.signal-flow-connection::after  { right: 0; }

.signal-flow-connection.conn-active {
  opacity: 1;
  box-shadow: 0 0 8px rgba(245,158,11,0.6);
}

@keyframes march {
  0%   { background-position: 0 0; }
  100% { background-position: -200% 0; }
}

/* ── NODE LABELS BELOW THE FLOW ── */
.signal-flow-labels {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 20px;
  gap: 0;
}

.node-sub-label {
  flex-shrink: 0;
  width: 148px;
  text-align: center;
  font-family: 'Chakra Petch', monospace;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 0 4px;
}

.conn-spacer {
  flex-shrink: 0;
  width: 48px;
}

/* ── DETAIL PANEL ── */
.detail-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  height: 100vh;
  background: var(--bg2);
  border-left: 1px solid var(--border2);
  box-shadow: -8px 0 32px rgba(0,0,0,0.5);
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-panel.open {
  right: 0;
}

.detail-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 1;
}

.detail-panel-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--amber3), transparent);
}

.detail-panel-title {
  font-family: 'Chakra Petch', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--amber);
  margin: 0;
}

.detail-panel-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}

.detail-panel-close:hover {
  color: var(--amber);
  border-color: var(--border2);
  background: var(--amber-dim);
}

.detail-panel-close svg { width: 14px; height: 14px; }

.detail-panel-content {
  padding: 24px;
  color: var(--text-dim);
  line-height: 1.7;
  font-size: 13.5px;
  flex: 1;
}

.detail-panel-content p {
  margin-bottom: 14px;
}

.detail-panel-content h4 {
  font-family: 'Chakra Petch', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 20px 0 10px;
}

.detail-panel-content ul {
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.detail-panel-content ul li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
}

.detail-panel-content ul li::before {
  content: '›';
  color: var(--amber);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.detail-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.detail-spec-row:last-child { border-bottom: none; }
.detail-spec-key { color: var(--text-dim); }
.detail-spec-val {
  font-family: 'Chakra Petch', monospace;
  color: var(--amber);
  font-weight: 600;
  font-size: 11px;
}
.detail-spec-val.green { color: var(--green); }
.detail-spec-val.blue  { color: var(--blue); }

/* ── OVERLAY when panel is open ── */
.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}
.panel-overlay.visible { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .signal-flow-track {
    flex-direction: column;
    align-items: center;
  }

  .signal-flow-connection {
    width: 2px;
    height: 32px;
    background: linear-gradient(
      180deg,
      var(--amber) 0%,
      transparent 50%,
      var(--amber) 100%
    );
    background-size: 100% 200%;
    animation: march-v 1.8s linear infinite;
  }

  .signal-flow-connection::before { top: 0; left: 50%; transform: translate(-50%, 0); }
  .signal-flow-connection::after  { bottom: 0; top: auto; left: 50%; transform: translate(-50%, 0); }

  @keyframes march-v {
    0%   { background-position: 0 0; }
    100% { background-position: 0 -200%; }
  }

  .signal-flow-labels {
    display: none;
  }

  .detail-panel {
    width: 100%;
    max-width: 100%;
  }
}