/* ============================================================
   Continuum RX - ARIA shell styles (aria.css)
   The system-tray sigil + slide-in companion panel. Loaded by
   index.html alongside core.css / qrx.css. Scoped to .aria-*.
   ============================================================ */

/* ---- tray sigil ---- */
.tray-btn.aria-tray {
  width: auto; padding: 0 11px; font-size: 15px; line-height: 1;
  color: #ff2e6d; border-color: rgba(255, 46, 109, 0.55);
  text-shadow: 0 0 8px rgba(255, 46, 109, 0.5);
  animation: aria-pulse 3.4s ease-in-out infinite;
}
.tray-btn.aria-tray:hover {
  color: #fff; background: rgba(255, 46, 109, 0.16);
  box-shadow: 0 0 12px rgba(255, 46, 109, 0.5);
}
.tray-btn.aria-tray.active {
  color: #fff; border-color: #ff2e6d; background: rgba(255, 46, 109, 0.2);
  box-shadow: 0 0 14px rgba(255, 46, 109, 0.55);
  animation: none;
}
@keyframes aria-pulse {
  0%, 100% { text-shadow: 0 0 6px rgba(255, 46, 109, 0.35); }
  50%      { text-shadow: 0 0 12px rgba(255, 46, 109, 0.75); }
}

/* ---- slide-in panel ---- */
.aria-panel {
  --aria-accent: #ff2e6d;
  position: fixed; top: 0; right: 0; z-index: 4000;
  width: 360px; max-width: 92vw; height: 100%;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0b0e18 0%, #080b14 100%);
  border-left: 1px solid rgba(255, 46, 109, 0.28);
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.55);
  font-family: var(--font-retro, 'Courier New', monospace);
  color: #e2e8f0;
  transform: translateX(104%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.aria-panel.aria-in { transform: translateX(0); }
.aria-panel.aria-hidden { display: none; }

/* subtle scanline wash */
.aria-panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background: repeating-linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 3px);
}
.aria-panel > * { position: relative; z-index: 1; }

/* ---- header ---- */
.aria-head {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 14px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.aria-avatar {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px;
  color: var(--aria-accent);
  border: 1px solid var(--aria-accent);
  background: radial-gradient(circle at 50% 40%, rgba(255,46,109,0.25), rgba(255,46,109,0.04));
  box-shadow: 0 0 14px rgba(255, 46, 109, 0.35), inset 0 0 12px rgba(255, 46, 109, 0.2);
  animation: aria-idle 3.6s ease-in-out infinite;
}
@keyframes aria-idle {
  0%, 100% { box-shadow: 0 0 12px rgba(255,46,109,0.28), inset 0 0 10px rgba(255,46,109,0.16); }
  50%      { box-shadow: 0 0 20px rgba(255,46,109,0.5),  inset 0 0 16px rgba(255,46,109,0.28); }
}
.aria-avatar.thinking { animation: aria-think 0.5s steps(2) infinite; }
@keyframes aria-think { 0% { opacity: 1; } 50% { opacity: 0.35; } 100% { opacity: 1; } }
.aria-avatar.speaking { animation: aria-speak 0.7s ease-in-out infinite; }
@keyframes aria-speak {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.09); }
}
.aria-id { flex: 1 1 auto; min-width: 0; }
.aria-name { font-weight: 800; letter-spacing: 1px; color: #fff; }
.aria-tag { font-size: 11px; color: #8b93a7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aria-x {
  background: none; border: none; color: #8b93a7; cursor: pointer; font-size: 15px;
  width: 26px; height: 26px; border-radius: 4px;
}
.aria-x:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ---- status row ---- */
.aria-status {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 11px; color: #8b93a7;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.aria-dot { width: 8px; height: 8px; border-radius: 50%; background: #4b5064; flex: 0 0 auto; }
.aria-dot.ok { background: #46f08a; box-shadow: 0 0 8px rgba(70,240,138,0.6); }
.aria-dot.off { background: #ff5a5a; box-shadow: 0 0 8px rgba(255,90,90,0.5); }
.aria-status > span:nth-child(2) { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aria-persona-btn {
  background: none; border: 1px solid rgba(255,255,255,0.12); color: var(--aria-accent);
  border-radius: 4px; cursor: pointer; width: 24px; height: 20px; font-size: 10px;
}
.aria-persona-btn:hover { border-color: var(--aria-accent); }

/* ---- persona menu ---- */
.aria-persona-menu {
  position: absolute; top: 88px; right: 12px; z-index: 5; width: 236px;
  background: #10131f; border: 1px solid rgba(255,46,109,0.35); border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6); overflow: hidden;
}
.aria-persona-menu.aria-hidden { display: none; }
.aria-persona-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  background: none; border: none; border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #e2e8f0; cursor: pointer; font-family: inherit; font-size: 12px;
}
.aria-persona-menu button em { display: block; color: #7c8296; font-style: normal; font-size: 10px; margin-top: 2px; }
.aria-persona-menu button:hover { background: rgba(255,46,109,0.12); }
.aria-persona-menu button.sel { background: rgba(255,46,109,0.18); }

/* ---- conversation log ---- */
.aria-log {
  flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.aria-msg { display: flex; }
.aria-msg.user { justify-content: flex-end; }
.aria-bubble {
  max-width: 84%; padding: 8px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.aria-msg.aria .aria-bubble {
  color: #ffd6e4; background: rgba(255, 46, 109, 0.12);
  border: 1px solid rgba(255, 46, 109, 0.3); border-top-left-radius: 3px;
}
.aria-msg.user .aria-bubble {
  color: #cffaff; background: rgba(34, 230, 255, 0.1);
  border: 1px solid rgba(34, 230, 255, 0.3); border-top-right-radius: 3px;
}
.aria-bubble.streaming::after {
  content: '...'; display: inline-block; margin-left: 4px; color: var(--aria-accent);
  letter-spacing: 2px; vertical-align: baseline; overflow: hidden; width: 0;
  animation: aria-typing 1s steps(4, end) infinite;
}
@keyframes aria-typing { from { width: 0; } to { width: 2.1em; } }
.aria-bubble.error { color: #ffb4b4; border-color: rgba(255,90,90,0.4); background: rgba(255,90,90,0.08); }

/* ---- action result chips ---- */
.aria-actions { display: flex; flex-direction: column; gap: 5px; margin: -4px 0 2px; }
.aria-chip {
  align-self: flex-start; max-width: 92%; font-size: 11px; padding: 5px 9px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); color: #b9c0d0;
}
.aria-chip.done { color: #9df5c4; border-color: rgba(70,240,138,0.4); background: rgba(70,240,138,0.08); }
.aria-chip.failed { color: #ffb4b4; border-color: rgba(255,90,90,0.4); background: rgba(255,90,90,0.08); }
.aria-chip.cancelled, .aria-chip.skipped { color: #8b93a7; }

/* ---- action proposal cards (ARIA suggests, you run) ---- */
.aria-action {
  display: flex; align-items: center; gap: 8px; align-self: stretch;
  padding: 8px 10px; border-radius: 8px; font-size: 12px;
  border: 1px solid rgba(255,46,109,0.35); background: rgba(255,46,109,0.08); color: #ffd6e4;
}
.aria-action.danger { border-color: rgba(255,140,90,0.5); background: rgba(255,140,90,0.1); color: #ffd6c2; }
.aria-action .aa-label { flex: 1 1 auto; min-width: 0; }
.aria-action .aa-btns { display: flex; gap: 5px; flex: 0 0 auto; }
.aria-action button {
  font-family: inherit; font-size: 11px; padding: 4px 9px; border-radius: 5px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2); background: transparent; color: #e2e8f0;
}
.aria-action .aa-run { background: var(--aria-accent); border-color: var(--aria-accent); color: #fff; }
.aria-action.danger .aa-run { background: #ff7a4a; border-color: #ff7a4a; }
.aria-action button:disabled { opacity: 0.5; cursor: default; }

/* ---- shell output block (ARIA inspecting the OS) ---- */
.aria-shell {
  align-self: stretch; border: 1px solid rgba(57,255,20,0.28); border-radius: 8px;
  background: #030b03; overflow: hidden;
}
.aria-shell-cmd {
  padding: 5px 9px; font-size: 11px; color: #22e6ff; background: rgba(34,230,255,0.06);
  border-bottom: 1px solid rgba(57,255,20,0.2);
}
.aria-shell-out {
  margin: 0; padding: 8px 10px; font-size: 11.5px; line-height: 1.45; color: #7dff5e;
  white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto;
  text-shadow: 0 0 5px rgba(57,255,20,0.3);
}

/* ---- quick actions ---- */
.aria-quick {
  display: flex; gap: 6px; padding: 8px 14px 0;
}
.aria-quick button {
  flex: 1 1 auto; padding: 6px 4px; font-size: 10.5px; font-family: inherit;
  background: #151826; border: 1px solid rgba(255,255,255,0.1); color: #b9c0d0;
  border-radius: 5px; cursor: pointer;
}
.aria-quick button:hover { border-color: var(--aria-accent); color: #fff; }

/* ---- input ---- */
.aria-input { display: flex; gap: 8px; padding: 10px 14px; }
.aria-input input {
  flex: 1 1 auto; min-width: 0; padding: 9px 12px; font-family: inherit; font-size: 12.5px;
  background: #0e1120; border: 1px solid rgba(255,255,255,0.14); border-radius: 7px; color: #e2e8f0;
}
.aria-input input:focus { outline: none; border-color: var(--aria-accent); box-shadow: 0 0 0 2px rgba(255,46,109,0.18); }
.aria-input button {
  flex: 0 0 auto; width: 40px; border-radius: 7px; cursor: pointer; font-size: 13px;
  background: var(--aria-accent); border: none; color: #fff;
}
.aria-input button:disabled { opacity: 0.45; cursor: default; }

/* ---- metrics strip ---- */
.aria-metrics {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px 12px;
  font-size: 10.5px; color: #8b93a7; border-top: 1px solid rgba(255,255,255,0.05);
}
.aria-metrics .m-item { display: flex; align-items: center; gap: 4px; }
.aria-metrics b { color: var(--aria-accent); font-size: 12px; }
.aria-metrics .m-sep { width: 1px; height: 12px; background: rgba(255,255,255,0.12); }
.aria-metrics .m-bar {
  display: inline-block; width: 64px; height: 7px; border-radius: 4px;
  background: rgba(255,255,255,0.1); overflow: hidden;
}
.aria-metrics .m-bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #22e6ff, var(--aria-accent));
  transition: width 0.25s ease;
}
