/* JARVIX AI System — Ambient Marvel Arc-Reactor Voice Companion & Pure Soundwave Aura */

/* Ensure the parent header is positioned relative so the Orb can be dead-centered */
:is(header, .top, .topbar, .price-topbar, .vu-appbar, body>header, .tools>header) {
  position: relative !important;
}

/* 1. Top-Center Orb Button — Rigidly centered across ALL pages */
.top-jarvis-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 14, 28, 0.92);
  border: 1.5px solid rgba(0, 229, 255, 0.45);
  border-radius: 999px;
  padding: 4px 14px 4px 6px;
  color: #e0f2fe;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.3), inset 0 0 10px rgba(0, 229, 255, 0.18);
  flex: none;
  z-index: 100;
  margin: 0;
}

.top-jarvis-btn:hover {
  background: rgba(12, 22, 46, 0.98);
  border-color: #38bdf8;
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.6), inset 0 0 14px rgba(56, 189, 248, 0.35);
  transform: translate(-50%, -50%) scale(1.05);
}

/* Soundwave Aura Ring behind the Orb */
.top-jarvis-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 229, 255, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Active Voice State (Live Companion) */
.top-jarvis-btn.is-active {
  border-color: #00e5ff;
  background: radial-gradient(circle, rgba(14, 28, 64, 0.96) 0%, rgba(6, 12, 26, 0.98) 100%);
  box-shadow: 0 0 34px rgba(0, 229, 255, 0.7), inset 0 0 18px rgba(0, 229, 255, 0.45);
  animation: jarvisActiveBreathing 2.4s ease-in-out infinite;
}

.top-jarvis-btn.is-active::before {
  opacity: 1;
  animation: jarvisSoundwaveAura 2s ease-out infinite;
}

/* Speaking State: Assistant is talking (deep male voice pulse) */
.top-jarvis-btn.is-speaking {
  border-color: #38bdf8;
  box-shadow: 0 0 42px rgba(56, 189, 248, 0.9), inset 0 0 22px rgba(56, 189, 248, 0.6);
  animation: jarvisSpeakingPulse 1.1s ease-in-out infinite alternate;
}

.top-jarvis-btn.is-speaking::before {
  border-color: rgba(56, 189, 248, 0.8);
  animation-duration: 1.1s;
}

/* Listening State: User is talking / Mic is active */
.top-jarvis-btn.is-listening {
  border-color: #34d399;
  box-shadow: 0 0 36px rgba(52, 211, 153, 0.8), inset 0 0 18px rgba(52, 211, 153, 0.5);
  animation: jarvisListeningRipple 1.5s ease-in-out infinite;
}

.top-jarvis-btn.is-listening::before {
  border-color: rgba(52, 211, 153, 0.8);
  animation-duration: 1.4s;
}

/* Mini Orb Components inside button */
.jarvis-mini-orb {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.jarvis-core {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 15%, #00e5ff 60%, #3b82f6 100%);
  box-shadow: 0 0 12px #00e5ff, 0 0 18px #3b82f6;
  animation: jarvisCoreGlow 2.2s ease-in-out infinite alternate;
}

.top-jarvis-btn.is-active .jarvis-core {
  background: radial-gradient(circle, #ffffff 20%, #38bdf8 65%, #a855f7 100%);
  box-shadow: 0 0 18px #00e5ff, 0 0 26px #a855f7;
}

.top-jarvis-btn.is-listening .jarvis-core {
  background: radial-gradient(circle, #ffffff 20%, #34d399 65%, #059669 100%);
  box-shadow: 0 0 18px #34d399, 0 0 24px #059669;
}

.jarvis-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px dashed rgba(0, 229, 255, 0.75);
  animation: jarvisSpin 4s linear infinite;
}

.jarvis-ring.ring-violet {
  inset: -3px;
  border-color: rgba(168, 85, 247, 0.6);
  animation: jarvisSpinRev 6s linear infinite;
}

.top-jarvis-btn.is-active .jarvis-ring {
  border-color: rgba(0, 229, 255, 0.95);
  animation-duration: 2.2s;
}

.top-jarvis-btn.is-speaking .jarvis-ring {
  animation-duration: 1.2s;
  border-color: #38bdf8;
}

.jarvis-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, #f0f9ff, #38bdf8 60%, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Animations */
@keyframes jarvisSpin {
  100% { transform: rotate(360deg); }
}
@keyframes jarvisSpinRev {
  100% { transform: rotate(-360deg); }
}
@keyframes jarvisCoreGlow {
  0% { transform: scale(0.85); opacity: 0.85; }
  100% { transform: scale(1.22); opacity: 1; filter: drop-shadow(0 0 10px #00e5ff); }
}
@keyframes jarvisActiveBreathing {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 26px rgba(0, 229, 255, 0.5); }
  50% { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 42px rgba(0, 229, 255, 0.8); }
}
@keyframes jarvisSpeakingPulse {
  0% { transform: translate(-50%, -50%) scale(1); filter: brightness(1); }
  100% { transform: translate(-50%, -50%) scale(1.09); filter: brightness(1.25); }
}
@keyframes jarvisListeningRipple {
  0% { box-shadow: 0 0 22px rgba(52, 211, 153, 0.45); }
  50% { box-shadow: 0 0 38px rgba(52, 211, 153, 0.85); }
  100% { box-shadow: 0 0 22px rgba(52, 211, 153, 0.45); }
}
@keyframes jarvisSoundwaveAura {
  0% { transform: scale(0.95); opacity: 0.85; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* Screen is 100% clean: no written text overlays or dialog popups */
.jarvis-live-pill,
dialog.jarvis-hud-dialog,
.jarvis-f1-drawer {
  display: none !important;
}

@media (max-width: 760px) {
  .top-jarvis-btn {
    padding: 3px 10px 3px 5px;
  }
  .jarvis-name {
    display: none;
  }
}



/* Spotlight pulse for highlighting elements during tour */
.jarvis-tour-spotlight {
  position: relative;
  outline: 2px solid #00e5ff !important;
  outline-offset: 4px;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.65) !important;
  transition: outline 0.3s ease, box-shadow 0.3s ease;
  animation: tourSpotlightPulse 1.5s infinite alternate ease-in-out;
}

@keyframes tourSpotlightPulse {
  0% { box-shadow: 0 0 15px rgba(0, 229, 255, 0.4); }
  100% { box-shadow: 0 0 35px rgba(0, 229, 255, 0.9), 0 0 50px rgba(139, 92, 246, 0.5); }
}

.top-jarvis-btn .jarvis-ring {
  pointer-events: none;
}
