/* Jarvis — futuristic dark UI */

:root {
  --cy: 34, 211, 238;   /* cyan-400 */
  --cy-deep: 8, 145, 178;
  --bg: 2, 6, 23;       /* slate-950 */
  --panel: 15, 23, 42;  /* slate-900 */
}

html, body { background: rgb(var(--bg)); }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
.font-orbitron { font-family: 'Orbitron', sans-serif; letter-spacing: 0.18em; }

/* ---------- Background layers ---------- */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(var(--cy), 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--cy), 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.0) 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.0) 75%);
}
.bg-scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.015) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}
.bg-glow {
  position: fixed; inset: -10%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(var(--cy), 0.10), transparent 60%),
    radial-gradient(700px 500px at 80% 80%, rgba(99, 102, 241, 0.08), transparent 60%);
  filter: blur(20px);
}

/* ---------- Panels ---------- */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(15,23,42,0.75), rgba(2,6,23,0.85));
  border: 1px solid rgba(var(--cy), 0.15);
  border-radius: 12px;
  padding: 14px 16px;
  backdrop-filter: blur(8px);
  box-shadow:
    inset 0 0 0 1px rgba(var(--cy), 0.04),
    0 0 24px rgba(var(--cy), 0.04);
}
.panel::before {
  content: ""; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
  background: linear-gradient(135deg, rgba(var(--cy),0.15), transparent 30%);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1px;
  opacity: 0.5;
}
.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgb(165, 243, 252);
}

/* ---------- Status pill ---------- */
.status-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: rgb(34, 211, 238);
  box-shadow: 0 0 10px rgba(var(--cy), 0.8);
  display: inline-block;
  animation: pulse 1.6s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ---------- Voice orb ---------- */
.orb-wrap {
  position: relative;
  width: min(520px, 86vw);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
#orb-canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 30px rgba(var(--cy), 0.35));
}
.orb-status {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.4em;
  font-size: 11px;
  color: rgb(165, 243, 252);
  text-transform: uppercase;
  background: rgba(2,6,23,0.6);
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--cy), 0.25);
  white-space: nowrap;
}

/* ---------- Transcript ---------- */
.transcript {
  height: 220px;
  overflow-y: auto;
  padding-right: 6px;
  font-size: 14px;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--cy), 0.4) transparent;
}
.transcript::-webkit-scrollbar { width: 6px; }
.transcript::-webkit-scrollbar-thumb {
  background: rgba(var(--cy), 0.3); border-radius: 3px;
}
.bubble {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  margin: 6px 0;
  max-width: 92%;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.bubble.user {
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  margin-left: auto;
}
.bubble.assistant {
  background: rgba(var(--cy), 0.08);
  border: 1px solid rgba(var(--cy), 0.25);
  color: #e0f2fe;
}
.bubble.system {
  background: rgba(148, 163, 184, 0.06);
  border: 1px dashed rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  font-style: italic;
  font-size: 12px;
}
.bubble .meta {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.7);
  margin-bottom: 2px;
}
.tool-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(var(--cy), 0.3);
  color: #67e8f9;
  margin-right: 6px;
}

/* ---------- Mic button ---------- */
.mic-btn {
  width: 42px; height: 42px;
  border-radius: 999px;
  background: rgba(var(--cy), 0.08);
  border: 1px solid rgba(var(--cy), 0.4);
  color: #67e8f9;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mic-btn:hover { background: rgba(var(--cy), 0.18); }
.mic-btn.listening {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.6);
  color: #fda4af;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
  animation: micpulse 1.2s infinite;
}
@keyframes micpulse {
  0%, 100% { box-shadow: 0 0 20px rgba(244, 63, 94, 0.4); }
  50% { box-shadow: 0 0 30px rgba(244, 63, 94, 0.7); }
}

/* ---------- Lists ---------- */
#task-list li, #memory-list li, #notifications li, #tool-catalog li {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(var(--cy), 0.10);
  background: rgba(2,6,23,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}
#task-list li.done { opacity: 0.5; text-decoration: line-through; }
#task-list li button, #memory-list li button {
  margin-left: auto;
  font-size: 10px;
  color: rgba(148, 163, 184, 0.8);
  background: transparent;
  border: none;
  cursor: pointer;
}
#task-list li button:hover, #memory-list li button:hover { color: #fda4af; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .orb-wrap { width: min(360px, 80vw); }
  .transcript { height: 180px; }
}
