/* ============================================================
   ADA — Adapting Digital Assistant  (HUD / JARVIS-style)
   Self-contained styles. Brand: indigo #6366F1 / cyan #818CF8.
   ============================================================ */
:root {
  --ada-indigo: #6366F1;
  --ada-cyan:   #818CF8;
  --ada-ink:    #0B1120;
  --ada-ink-2:  #111a2e;
  --ada-line:   rgba(56,189,248,0.18);
  --ada-glow:   rgba(6,182,212,0.55);
  --ada-text:   #E2E8F0;
  --ada-dim:    #7C8AA5;
}

/* ---- Launcher (arc reactor) ---- */
#ada-launcher {
  position: fixed; right: 24px; bottom: 24px;
  width: 62px; height: 62px; border-radius: 50%;
  border: none; cursor: pointer; z-index: 350;
  background: radial-gradient(circle at 50% 50%, #bdf3ff 0%, var(--ada-cyan) 24%, var(--ada-indigo) 62%, #1e1b4b 100%);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.12), 0 0 24px var(--ada-glow), 0 8px 28px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
#ada-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 0 0 2px rgba(255,255,255,0.18), 0 0 36px var(--ada-glow), 0 12px 34px rgba(0,0,0,0.5); }
#ada-launcher::before {
  content: ""; position: absolute; inset: 9px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.75);
  box-shadow: inset 0 0 12px rgba(255,255,255,0.6);
}
#ada-launcher::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px solid var(--ada-cyan); opacity: .6;
  animation: ada-ring 2.6s ease-out infinite;
}
@keyframes ada-ring {
  0%   { transform: scale(.85); opacity: .7; }
  70%  { opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
#ada-launcher .ada-core {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px #fff, 0 0 20px var(--ada-cyan);
  animation: ada-pulse 2.2s ease-in-out infinite; position: relative; z-index: 1;
}
#ada-launcher .ada-core-mark {
  width: 30px; height: 30px; position: relative; z-index: 1;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.55));
  animation: ada-pulse 2.6s ease-in-out infinite;
}
@keyframes ada-pulse { 0%,100%{ opacity: 1; transform: scale(1);} 50%{ opacity:.55; transform: scale(.82);} }
#ada-launcher .ada-badge {
  position: absolute; top: -4px; right: -4px; background: var(--ada-indigo); color:#fff;
  font: 700 10px/1 'Outfit',sans-serif; padding: 4px 6px; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4); letter-spacing:.5px;
}
#ada-launcher.ada-hidden { transform: scale(0); opacity: 0; pointer-events: none; }

/* ---- Panel ---- */
#ada-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 360;
  width: min(384px, calc(100vw - 32px));
  height: min(580px, calc(100vh - 110px));
  background: linear-gradient(160deg, rgba(17,26,46,0.96), rgba(8,12,24,0.98));
  border: 1px solid var(--ada-line);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(6,182,212,0.12), 0 0 40px rgba(6,182,212,0.18), 0 24px 60px rgba(0,0,0,0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  transform: translateY(24px) scale(.96); opacity: 0; pointer-events: none;
  transform-origin: bottom right;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .24s ease;
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--ada-text);
}
#ada-panel.ada-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

/* faint HUD grid + scanline */
#ada-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(56,189,248,0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(56,189,248,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
}
.ada-scan {
  position: absolute; left: 0; right: 0; height: 60px; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(6,182,212,0.12), transparent);
  animation: ada-scanmove 4.5s linear infinite; opacity: .6;
}
@keyframes ada-scanmove { 0%{ top:-60px;} 100%{ top: 100%; } }

/* ---- Header ---- */
.ada-header {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border-bottom: 1px solid var(--ada-line); position: relative; z-index: 3;
  background: rgba(8,12,24,0.5);
}
.ada-id {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: radial-gradient(circle, #bdf3ff 0%, var(--ada-cyan) 30%, var(--ada-indigo) 70%, #1e1b4b 100%);
  box-shadow: 0 0 12px var(--ada-glow); display:flex; align-items:center; justify-content:center;
}
.ada-id .ada-id-mark { width: 21px; height: 21px; display:block; filter: drop-shadow(0 0 3px rgba(255,255,255,0.5)); }
.ada-meta { flex: 1; min-width: 0; }
.ada-name { font-family:'Outfit',sans-serif; font-weight: 800; font-size: 15px; letter-spacing:.3px; color:#fff; }
.ada-name small { font-weight:500; color: var(--ada-dim); font-family:'Outfit',sans-serif; letter-spacing:0; }
.ada-status { font-size: 11px; color: #34d399; display:flex; align-items:center; gap:5px; margin-top:1px; }
.ada-status .ada-dot { width:6px; height:6px; border-radius:50%; background:#34d399; box-shadow:0 0 6px #34d399; animation: ada-blink 1.6s ease-in-out infinite; }
@keyframes ada-blink { 0%,100%{opacity:1;} 50%{opacity:.35;} }
.ada-ctrl { background: transparent; border: 1px solid var(--ada-line); color: var(--ada-dim);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height:1;
  display:flex; align-items:center; justify-content:center; transition: all .15s; }
.ada-ctrl:hover { color:#fff; border-color: var(--ada-cyan); box-shadow: 0 0 10px rgba(6,182,212,0.3); }

/* ---- Log ---- */
.ada-log { flex: 1; overflow-y: auto; padding: 16px 14px 6px; position: relative; z-index: 3;
  display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.ada-log::-webkit-scrollbar { width: 6px; }
.ada-log::-webkit-scrollbar-thumb { background: rgba(6,182,212,0.3); border-radius: 3px; }

.ada-msg { max-width: 86%; font-size: 13.5px; line-height: 1.55; }
.ada-msg.bot {
  align-self: flex-start; background: rgba(56,189,248,0.07); border: 1px solid var(--ada-line);
  border-left: 2px solid var(--ada-cyan); padding: 10px 12px; border-radius: 4px 12px 12px 12px;
  color: var(--ada-text);
}
.ada-msg.user {
  align-self: flex-end; background: linear-gradient(135deg, var(--ada-indigo), #4338CA);
  color:#fff; padding: 9px 13px; border-radius: 12px 12px 4px 12px; box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}
.ada-msg b, .ada-msg strong { color: #fff; }
.ada-msg a { color: #7dd3fc; text-decoration: underline; }
.ada-caret { display:inline-block; width:7px; background: var(--ada-cyan); margin-left:2px;
  animation: ada-caret 1s steps(1) infinite; }
@keyframes ada-caret { 0%,50%{opacity:1;} 51%,100%{opacity:0;} }

/* ---- Quick replies ---- */
.ada-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 14px 12px; position: relative; z-index: 3; }
.ada-chip {
  font: 600 12px/1 'Outfit',sans-serif; color: #bfe9ff; cursor: pointer;
  background: rgba(6,182,212,0.10); border: 1px solid var(--ada-line);
  padding: 8px 12px; border-radius: 100px; transition: all .15s;
}
.ada-chip:hover { background: rgba(6,182,212,0.22); border-color: var(--ada-cyan); color:#fff;
  box-shadow: 0 0 12px rgba(6,182,212,0.35); transform: translateY(-1px); }
.ada-chip.alt { color:#c7d2fe; background: rgba(79,70,229,0.12); border-color: rgba(99,102,241,0.4); }

/* ---- Input ---- */
.ada-input-row { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--ada-line);
  position: relative; z-index: 3; background: rgba(8,12,24,0.5); }
.ada-input-row input {
  flex: 1; background: rgba(255,255,255,0.04); border: 1px solid var(--ada-line); color: var(--ada-text);
  border-radius: 10px; padding: 10px 12px; font: 400 13px 'Outfit',sans-serif; outline: none; transition: border-color .15s, box-shadow .15s;
}
.ada-input-row input::placeholder { color: var(--ada-dim); }
.ada-input-row input:focus { border-color: var(--ada-cyan); box-shadow: 0 0 0 3px rgba(6,182,212,0.15); }
.ada-send { flex-shrink:0; width: 40px; border:none; border-radius: 10px; cursor:pointer; color:#fff;
  background: linear-gradient(135deg, var(--ada-indigo), var(--ada-cyan)); font-size:15px;
  box-shadow: 0 4px 14px rgba(6,182,212,0.35); transition: transform .12s; }
.ada-send:hover { transform: translateY(-1px); }

/* ---- Boot overlay ---- */
.ada-boot { position:absolute; inset:0; z-index: 5; background: rgba(6,9,18,0.97);
  display:flex; flex-direction:column; justify-content:center; padding: 26px;
  font: 500 12.5px/1.7 'Consolas','SF Mono',monospace; color: var(--ada-cyan); }
.ada-boot .ln { opacity: 0; white-space: pre; }
.ada-boot .ln.show { opacity: 1; }
.ada-boot .ln .ok { color:#34d399; }
.ada-boot .reactor { width: 64px; height: 64px; margin: 0 auto 18px; border-radius:50%;
  background: radial-gradient(circle, #bdf3ff, var(--ada-cyan) 40%, var(--ada-indigo) 75%, #1e1b4b);
  box-shadow: 0 0 30px var(--ada-glow); animation: ada-boot-spin 1.2s linear infinite, ada-pulse 1.6s ease-in-out infinite; }
@keyframes ada-boot-spin { to { transform: rotate(360deg); } }
.ada-boot.ada-done { opacity:0; pointer-events:none; transition: opacity .4s ease; }

/* ---- Tour highlight on page sections ---- */
.ada-spot { position: relative; z-index: 5;
  outline: 2px solid var(--ada-cyan); outline-offset: 6px; border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(8,12,24,0.55), 0 0 30px rgba(6,182,212,0.5);
  transition: box-shadow .3s ease, outline-color .3s ease; }

/* keep launcher clear of the back-to-top button */
.back-to-top { right: auto !important; left: 24px !important; bottom: 24px !important; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  #ada-launcher::after, #ada-launcher .ada-core, .ada-id::after, .ada-status .ada-dot,
  .ada-scan, .ada-boot .reactor { animation: none !important; }
}

/* ---- Small screens ---- */
@media (max-width: 480px) {
  #ada-panel { right: 8px; left: 8px; width: auto; height: min(76vh, 560px); bottom: 16px; }
  #ada-launcher { right: 16px; bottom: 16px; }
  .back-to-top { left: 16px !important; bottom: 16px !important; }
}
