/* Olympus V8 — Mobile-First Dark Glassmorphism */
:root {
  --bg: #0a0a1a;
  --surface: rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.1);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent: #3b82f6;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

/* ── NAV ── */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(10,10,26,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { font-size: 1.1rem; font-weight: 700; }
.nav-stats { display: flex; gap: 0.5rem; }
.stat {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: var(--surface);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

/* ── ORG CHART ── */
.org-chart {
  padding: 1.25rem 1rem 0.75rem;
  text-align: center;
}
.org-zeus {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.org-line {
  width: 2px;
  height: 20px;
  background: var(--border);
  margin: 0 auto;
}
.org-agents {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-width: 500px;
  margin: 0.5rem auto 0;
}

/* ── AGENT NODE ── */
.agent-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.3s ease;
}
.agent-node img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.agent-node.zeus {
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(139,92,246,0.12));
  border-color: rgba(59,130,246,0.3);
  padding: 0.75rem;
}
.agent-node.zeus img {
  width: 52px;
  height: 52px;
}
.agent-info { text-align: center; }
.agent-info strong { font-size: 0.75rem; display: block; }
.agent-info span { font-size: 0.6rem; color: var(--text-dim); }

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
  position: absolute;
  top: 6px;
  right: 6px;
  transition: all 0.3s;
}

/* Active state */
.agent-node.active {
  border-color: var(--green);
  background: rgba(16,185,129,0.1);
  box-shadow: 0 0 20px rgba(16,185,129,0.15);
}
.agent-node.active .status-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.5s infinite;
}

/* Done state */
.agent-node.done {
  border-color: var(--accent);
  background: rgba(59,130,246,0.08);
}
.agent-node.done .status-dot {
  background: var(--accent);
}

/* Error state */
.agent-node.error {
  border-color: var(--red);
  background: rgba(239,68,68,0.08);
}
.agent-node.error .status-dot {
  background: var(--red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── INPUT ── */
.input-section {
  padding: 0.75rem 1rem;
  max-width: 500px;
  margin: 0 auto;
}
#cuiForm {
  display: flex;
  gap: 0.5rem;
}
#cuiInput {
  flex: 1;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}
#cuiInput:focus { border-color: var(--accent); }
#cuiInput::placeholder { color: var(--text-dim); }
#goBtn {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
#goBtn:hover { background: #2563eb; }
#goBtn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── LIVE FEED ── */
.live-feed {
  padding: 1rem;
  max-width: 500px;
  margin: 0 auto;
}
.live-feed h3 { margin-bottom: 0.5rem; font-size: 0.95rem; }
.feed-messages {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.feed-empty {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 1.5rem;
}
.feed-msg {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: var(--surface);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.agent-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.msg-text { font-size: 0.8rem; line-height: 1.4; }

/* Agent tag colors */
.tag-zeus { background: rgba(59,130,246,0.2); color: #60a5fa; }
.tag-hermes { background: rgba(16,185,129,0.2); color: #34d399; }
.tag-cronos { background: rgba(245,158,11,0.2); color: #fbbf24; }
.tag-ares { background: rgba(239,68,68,0.2); color: #f87171; }
.tag-simple0ne { background: rgba(139,92,246,0.2); color: #a78bfa; }

/* ── RESULTS ── */
.results {
  padding: 0.5rem 1rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}
.results h3 { margin-bottom: 0.5rem; font-size: 0.95rem; }
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  animation: slideIn 0.3s ease;
}
.result-card .rc-icon { font-size: 1.3rem; margin-bottom: 0.3rem; }
.result-card .rc-title { font-weight: 600; font-size: 0.8rem; margin-bottom: 0.15rem; }
.result-card .rc-agent { font-size: 0.65rem; color: var(--text-dim); margin-bottom: 0.3rem; }
.result-card .rc-content { font-size: 0.7rem; color: var(--text-dim); line-height: 1.3; word-break: break-word; }
.result-card a {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
}
.result-card a:hover { text-decoration: underline; }

/* ── DESKTOP ── */
@media (min-width: 640px) {
  .org-agents { gap: 0.75rem; max-width: 600px; }
  .agent-node { padding: 0.75rem 0.5rem; }
  .agent-node img { width: 56px; height: 56px; }
  .agent-node.zeus img { width: 64px; height: 64px; }
  .agent-info strong { font-size: 0.85rem; }
  .agent-info span { font-size: 0.7rem; }
  .input-section, .live-feed, .results { max-width: 600px; }
  .feed-messages { max-height: 400px; }
}
