/* ================================================
   ArgusOS — Jarvis Full-screen Dashboard Overlay
   ================================================ */

/* ===== Overlay backdrop ===== */
.jarvis-overlay {
  position: fixed; inset: 0; z-index: 200;
  background:
    radial-gradient(800px 600px at 50% 40%, rgba(9,175,150,0.10), transparent 70%),
    rgba(3,5,7,0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .35s cubic-bezier(.4,0,.2,1);
}
.jarvis-overlay.open {
  opacity: 1; pointer-events: auto;
}

/* ===== Close button (top-right) ===== */
.jarvis-close {
  position: absolute; top: 20px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; z-index: 3;
}
.jarvis-close:hover { border-color: var(--err); color: var(--err); }
.jarvis-close svg { width: 18px; height: 18px; }

/* ===== Title at top ===== */
.jarvis-title {
  position: absolute; top: 24px; left: 0; right: 0;
  text-align: center; font-weight: 700; font-size: 14px;
  letter-spacing: .1em; color: var(--text-muted);
  pointer-events: none; z-index: 2;
}
.jarvis-title b { color: var(--teal); }

/* ===== Hub container (SVG + core + avatars) ===== */
.jarvis-hub {
  position: relative;
  width: 520px; height: 520px;
  flex: none;
}

/* ===== Central Argus core (reuse .core styling but bigger) ===== */
.jarvis-core {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 130px; height: 130px;
  z-index: 2;
}
.jarvis-core canvas { width: 100%; height: 100%; display: block; }
.jarvis-core-label {
  position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--teal);
  letter-spacing: .08em; font-weight: 700; white-space: nowrap;
}
.jarvis-core.listening .jarvis-core-label { color: var(--salmon); }

/* ===== SVG connection lines ===== */
.jarvis-lines {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
}
.jarvis-lines line {
  stroke: var(--border-strong);
  stroke-width: 1;
  opacity: .55;
}
.jarvis-lines line.active {
  stroke: var(--teal);
  opacity: .7;
  filter: drop-shadow(0 0 3px var(--teal-glow));
}
.jarvis-lines line.blocked {
  stroke: var(--err);
  opacity: .5;
}

/* ===== Agent avatar nodes (positioned around circle) ===== */
.jarvis-node {
  position: absolute;
  width: 66px; height: 66px;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  cursor: default;
  transition: transform .2s;
}
.jarvis-node:hover { transform: translate(-50%, -50%) scale(1.1); }

.jarvis-node-ring {
  position: relative; width: 54px; height: 54px; flex: none;
}
.jarvis-node-ring img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--bg-elevated); display: block;
}
.jarvis-node-status {
  position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid transparent;
}
.jarvis-node-status.working {
  border-color: var(--teal);
  box-shadow: 0 0 8px -1px var(--teal-glow);
  animation: pulse-ring 1.8s ease-in-out infinite;
}
.jarvis-node-status.idle { border-color: var(--text-dim); }
.jarvis-node-status.blocked {
  border-color: var(--err);
  box-shadow: 0 0 8px -1px rgba(239,91,91,0.5);
}
.jarvis-node-status.offline { border-color: var(--text-dim); opacity: .4; }

.jarvis-node-name {
  margin-top: 5px; font-size: 10px; font-weight: 600;
  color: var(--text); text-align: center; white-space: nowrap;
}
.jarvis-node-role {
  font-size: 8.5px; color: var(--text-dim); text-align: center;
  font-family: var(--mono); white-space: nowrap;
}

/* ===== Speak button (inside overlay) ===== */
.jarvis-speak {
  margin-top: 28px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px 12px 16px;
  border-radius: 28px; border: 1px solid var(--border-strong);
  background: var(--teal-soft); color: var(--teal);
  font-weight: 600; font-size: 13px;
  transition: all .18s ease; flex: none;
  cursor: pointer; z-index: 2;
}
.jarvis-speak:hover { background: rgba(9,175,150,0.22); }
.jarvis-speak .mic-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal); color: #04211c;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.jarvis-speak .mic-icon svg { width: 14px; height: 14px; }
.jarvis-speak.on {
  background: var(--salmon-soft); border-color: rgba(239,130,113,0.5); color: var(--salmon);
}
.jarvis-speak.on .mic-icon { background: var(--salmon); color: #2b0e08; }

.jarvis-speak-waveform {
  display: none; align-items: center; gap: 2px; height: 16px;
}
.jarvis-speak.on .jarvis-speak-waveform { display: flex; }
.jarvis-speak.on .jarvis-speak-label { display: none; }
.jarvis-speak-waveform span {
  width: 2.5px; border-radius: 2px; background: var(--salmon);
  animation: wave 0.9s ease-in-out infinite;
}
.jarvis-speak-waveform span:nth-child(1) { height: 5px; animation-delay: 0s; }
.jarvis-speak-waveform span:nth-child(2) { height: 12px; animation-delay: .15s; }
.jarvis-speak-waveform span:nth-child(3) { height: 7px; animation-delay: .3s; }
.jarvis-speak-waveform span:nth-child(4) { height: 14px; animation-delay: .45s; }
.jarvis-speak-waveform span:nth-child(5) { height: 6px; animation-delay: .6s; }

/* ===== Status readout (below core) ===== */
.jarvis-readout {
  margin-top: 14px; text-align: center; font-family: var(--mono);
  z-index: 2;
}
.jarvis-readout-status {
  font-size: 12px; color: var(--teal); letter-spacing: .08em; font-weight: 700;
}
.jarvis-readout-sub {
  font-size: 10px; color: var(--text-dim); margin-top: 3px;
}
.jarvis-overlay.listening .jarvis-readout-status { color: var(--salmon); }

/* ===== Rail-logo click affordance ===== */
.rail-logo { cursor: pointer; transition: color .15s; }
.rail-logo:hover { color: var(--text); }

/* ===== Responsive: smaller screens ===== */
@media (max-width: 700px) {
  .jarvis-hub { width: 340px; height: 340px; }
  .jarvis-core { width: 90px; height: 90px; }
  .jarvis-node-ring { width: 40px; height: 40px; }
  .jarvis-node-name { font-size: 8.5px; }
  .jarvis-node-role { font-size: 7.5px; }
}
