/* ============================================================
   ARIA COMMAND CENTER — AGENT SLOTS + AVATAR
   ============================================================ */

/* ---- ARIA AVATAR SECTION ---- */
#aria-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-glow);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

#aria-avatar-wrap::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 60px;
  background: radial-gradient(ellipse, var(--cyan-dim) 0%, transparent 70%);
  pointer-events: none;
}

/* The orb — default idle state */
.aria-orb {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.orb-core {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
    rgba(0, 245, 255, 0.9) 0%,
    rgba(0, 120, 200, 0.6) 40%,
    rgba(0, 40, 100, 0.8) 100%
  );
  box-shadow:
    0 0 20px rgba(0, 245, 255, 0.6),
    0 0 60px rgba(0, 245, 255, 0.2),
    inset 0 0 20px rgba(0, 200, 255, 0.3);
  animation: orb-breathe 3s ease-in-out infinite;
}

.orb-ring1 {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(0, 245, 255, 0.4);
  animation: orb-ring-spin 4s linear infinite;
}

.orb-ring2 {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 245, 255, 0.15);
  animation: orb-ring-spin 7s linear infinite reverse;
}

.orb-particles {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.orb-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--cyan);
  border-radius: 50%;
  animation: orbit-particle 3s linear infinite;
}

.orb-particle:nth-child(1) { animation-delay: 0s; top: 50%; left: 0; transform-origin: 65px 0; }
.orb-particle:nth-child(2) { animation-delay: -1s; top: 0; left: 50%; transform-origin: 0 65px; }
.orb-particle:nth-child(3) { animation-delay: -2s; top: 50%; right: 0; transform-origin: -65px 0; }

@keyframes orbit-particle {
  0% { transform: rotate(0deg) translateX(63px); opacity: 1; }
  50% { opacity: 0.3; }
  100% { transform: rotate(360deg) translateX(63px); opacity: 1; }
}

@keyframes orb-breathe {
  0%, 100% { box-shadow: 0 0 20px rgba(0,245,255,0.6), 0 0 60px rgba(0,245,255,0.2), inset 0 0 20px rgba(0,200,255,0.3); transform: scale(1); }
  50% { box-shadow: 0 0 30px rgba(0,245,255,0.8), 0 0 80px rgba(0,245,255,0.35), inset 0 0 25px rgba(0,200,255,0.4); transform: scale(1.04); }
}

@keyframes orb-ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Face always visible — orb effect is the glow ring around her */
.aria-face {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  z-index: 2;
}

/* Hide the blue orb core since face is shown */
.orb-core {
  opacity: 0;
}

/* Rings still spin around the face */
.orb-ring1,
.orb-ring2 {
  border-color: rgba(0, 245, 255, 0.35);
  z-index: 3;
}

/* When speaking — rings pulse faster, glow harder */
.aria-orb.speaking .orb-ring1,
.aria-orb.speaking .orb-ring2 {
  animation-duration: 1.2s;
  border-color: rgba(0, 245, 255, 0.7);
}

.aria-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
  filter: saturate(1.1) brightness(0.95);
}

.aria-face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, transparent 50%, rgba(0, 40, 100, 0.4) 100%);
  mix-blend-mode: multiply;
}

/* Sound waves when speaking */
.aria-waves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

.aria-orb.speaking .aria-waves { opacity: 1; }

.wave-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 245, 255, 0.5);
  animation: wave-expand 1.5s ease-out infinite;
}

.wave-ring:nth-child(2) { animation-delay: 0.5s; }
.wave-ring:nth-child(3) { animation-delay: 1s; }

@keyframes wave-expand {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Name + status under orb */
.aria-name {
  font-family: var(--font-hud);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan-glow);
}

.aria-status {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  margin-top: 3px;
  font-family: var(--font-hud);
}

.aria-status.talking {
  color: var(--green);
  animation: blink-text 0.8s ease-in-out infinite alternate;
}

@keyframes blink-text {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Last Aria response bubble */
.aria-last-response {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--cyan-dim);
  border-left: 2px solid var(--cyan);
  border-radius: 0 4px 4px 0;
  font-size: 11px;
  color: var(--text-primary);
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
  width: 100%;
  font-style: italic;
}

/* ---- VOICE BUTTON ---- */
#voice-btn {
  margin-top: 12px;
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--cyan);
  border-radius: 2px;
  color: var(--cyan);
  font-family: var(--font-hud);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

#voice-btn:hover {
  background: var(--cyan-dim);
  box-shadow: 0 0 16px var(--cyan-glow);
}

#voice-btn.listening {
  background: rgba(255, 51, 102, 0.1);
  border-color: var(--red);
  color: var(--red);
  animation: pulse-btn 1s ease-in-out infinite;
}

@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 51, 102, 0.4); }
  50% { box-shadow: 0 0 20px rgba(255, 51, 102, 0.7); }
}

.mic-icon { font-size: 14px; }

/* ---- AGENT SLOTS ---- */
#agents-panel {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#agents-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

#agents-list::-webkit-scrollbar {
  width: 3px;
}
#agents-list::-webkit-scrollbar-track {
  background: transparent;
}
#agents-list::-webkit-scrollbar-thumb {
  background: var(--border-glow);
  border-radius: 2px;
}

.agent-slot {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.06);
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.agent-slot:hover {
  background: rgba(0, 245, 255, 0.04);
}

.agent-slot.active {
  border-left: 2px solid var(--green);
  padding-left: 12px;
}

.agent-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.agent-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1px solid;
  flex-shrink: 0;
}

.agent-icon.nova { border-color: var(--cyan); background: var(--cyan-dim); }
.agent-icon.prism { border-color: var(--purple); background: rgba(184, 0, 255, 0.1); }
.agent-icon.atlas { border-color: var(--amber); background: var(--amber-dim); }
.agent-icon.vertex { border-color: var(--green); background: var(--green-dim); }
.agent-icon.mercury { border-color: #ffd700; background: rgba(255, 215, 0, 0.1); }
.agent-icon.scout { border-color: #00e5cc; background: rgba(0, 229, 204, 0.1); }
.agent-icon.hawk { border-color: var(--red); background: var(--red-dim); }

.agent-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.agent-name {
  font-family: var(--font-hud);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-primary);
}

.agent-role {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.agent-countdown {
  font-family: var(--font-hud);
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.05em;
  text-align: right;
}

.agent-countdown.fired {
  color: var(--green);
  animation: blink-text 1s ease-in-out infinite alternate;
}

/* XP Bar */
.xp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xp-bar-track {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
  position: relative;
}

.xp-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -1px;
  width: 4px;
  height: 5px;
  background: inherit;
  border-radius: 50%;
  filter: blur(2px);
}

.xp-bar-fill.nova { background: linear-gradient(90deg, var(--cyan), rgba(0, 245, 255, 0.6)); box-shadow: 0 0 6px var(--cyan-glow); }
.xp-bar-fill.prism { background: linear-gradient(90deg, var(--purple), rgba(184, 0, 255, 0.6)); box-shadow: 0 0 6px rgba(184, 0, 255, 0.4); }
.xp-bar-fill.atlas { background: linear-gradient(90deg, var(--amber), rgba(255, 183, 0, 0.6)); box-shadow: 0 0 6px var(--amber-glow); }
.xp-bar-fill.vertex { background: linear-gradient(90deg, var(--green), rgba(0, 255, 136, 0.6)); box-shadow: 0 0 6px rgba(0, 255, 136, 0.4); }
.xp-bar-fill.mercury { background: linear-gradient(90deg, #ffd700, rgba(255, 215, 0, 0.6)); box-shadow: 0 0 6px rgba(255, 215, 0, 0.4); }
.xp-bar-fill.scout { background: linear-gradient(90deg, #00e5cc, rgba(0, 229, 204, 0.6)); box-shadow: 0 0 6px rgba(0, 229, 204, 0.4); }
.xp-bar-fill.hawk { background: linear-gradient(90deg, var(--red), rgba(255, 51, 102, 0.6)); box-shadow: 0 0 6px rgba(255, 51, 102, 0.4); }

.xp-label {
  font-family: var(--font-hud);
  font-size: 8px;
  color: var(--text-dim);
  white-space: nowrap;
  letter-spacing: 0.05em;
}

/* Agent last output */
.agent-last-output {
  margin-top: 6px;
  font-size: 9.5px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Trigger button per agent */
.agent-trigger-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid rgba(0, 245, 255, 0.25);
  color: var(--text-dim);
  font-family: var(--font-hud);
  font-size: 8px;
  letter-spacing: 0.15em;
  cursor: pointer;
  border-radius: 2px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.agent-trigger-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}
