/* === JARVIS OS — HOLOGRAPHIC VISUAL SYSTEM === */

:root {
  --jarvis-cyan: #00d4ff;
  --jarvis-blue: #0088ff;
  --jarvis-bg: #0a0e17;
  --jarvis-panel: rgba(0, 20, 40, 0.85);
  --jarvis-text: #e0f0ff;
  --jarvis-warn: #ff6b35;
  --jarvis-success: #00ff88;
}

/* === PARTICLE GRID BACKGROUND === */
.jarvis-particle-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* === ARC REACTOR (HUD) === */
.jarvis-arcreactor {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.jarvis-arcreactor-core {
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, var(--jarvis-cyan) 0%, rgba(0, 212, 255, 0.4) 50%, transparent 70%);
  border-radius: 50%;
  animation: arc-reactor-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 12px var(--jarvis-cyan), 0 0 24px rgba(0, 212, 255, 0.3);
}
.jarvis-arcreactor-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.25);
  animation: arc-reactor-rotate 4s linear infinite;
}
.jarvis-arcreactor-ring-1 {
  width: 28px;
  height: 28px;
  animation-duration: 6s;
}
.jarvis-arcreactor-ring-2 {
  width: 36px;
  height: 36px;
  animation-duration: 9s;
  animation-direction: reverse;
}
@keyframes arc-reactor-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.3); opacity: 0.5; }
}
@keyframes arc-reactor-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === HOLOGRAPHIC PANELS === */
.jarvis-holo-panel {
  background: var(--jarvis-panel);
  border: 1px solid rgba(0, 212, 255, 0.3);
  box-shadow:
    0 0 20px rgba(0, 212, 255, 0.1),
    inset 0 0 30px rgba(0, 212, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 8px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.8);
}
.jarvis-holo-panel.materialize {
  animation: holo-materialize 0.3s ease-out forwards;
}
@keyframes holo-materialize {
  0% { opacity: 0; transform: scale(0.8) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Scanline overlay */
.jarvis-holo-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 212, 255, 0.015) 2px,
    rgba(0, 212, 255, 0.015) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* Corner accents */
.jarvis-holo-panel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.5), transparent);
}

/* Panel type variants */
.jarvis-holo-panel.goal {
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.15), inset 0 0 30px rgba(0, 212, 255, 0.05);
}
.jarvis-holo-panel.options {
  border-color: rgba(0, 136, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 136, 255, 0.12), inset 0 0 25px rgba(0, 136, 255, 0.04);
}
.jarvis-holo-panel.analysis {
  border-color: rgba(0, 255, 136, 0.35);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.1), inset 0 0 25px rgba(0, 255, 136, 0.03);
}
.jarvis-holo-panel.recommendation {
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: 0 0 25px rgba(255, 107, 53, 0.15), inset 0 0 30px rgba(255, 107, 53, 0.05);
  animation: holo-materialize 0.3s ease-out forwards, holo-glow-pulse 2s ease-in-out infinite 0.3s;
}
@keyframes holo-glow-pulse {
  0%, 100% { box-shadow: 0 0 25px rgba(255, 107, 53, 0.15), inset 0 0 30px rgba(255, 107, 53, 0.05); }
  50% { box-shadow: 0 0 35px rgba(255, 107, 53, 0.25), inset 0 0 40px rgba(255, 107, 53, 0.08); }
}

/* Panel header */
.jarvis-holo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.jarvis-holo-header-icon {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}
.jarvis-holo-header-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jarvis-cyan);
}

/* Panel body */
.jarvis-holo-body {
  font-size: 0.82rem;
  color: var(--jarvis-text);
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

/* Typewriter effect */
.jarvis-text-typewriter {
  overflow: hidden;
  white-space: pre-wrap;
}
.jarvis-text-typewriter.typing::after {
  content: '|';
  animation: typewriter-cursor 0.6s step-end infinite;
  color: var(--jarvis-cyan);
}
@keyframes typewriter-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* === WORKING STATE (ACTION MODE) === */
.jarvis-working {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.jarvis-working-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--jarvis-cyan);
  border-right-color: rgba(0, 212, 255, 0.3);
  border-bottom-color: rgba(0, 212, 255, 0.15);
  border-left-color: rgba(0, 212, 255, 0.08);
  animation: working-spin 1.2s linear infinite;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
  position: relative;
}
.jarvis-working-ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.1);
}
@keyframes working-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.jarvis-working-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jarvis-cyan);
  animation: working-blink 1.5s ease-in-out infinite;
}
@keyframes working-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Step nodes */
.jarvis-node-card {
  background: rgba(0, 20, 40, 0.7);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--jarvis-text);
  animation: node-slide-in 0.3s ease-out forwards;
  opacity: 0;
}
@keyframes node-slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
.jarvis-node-card-step {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jarvis-cyan);
  box-shadow: 0 0 6px var(--jarvis-cyan);
  flex-shrink: 0;
}
.jarvis-node-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 280px;
}

/* === WAVEFORM INDICATOR === */
.jarvis-waveform {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 20px;
  padding: 0 4px;
}
.jarvis-waveform-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--jarvis-cyan);
  height: 4px;
  animation: wave-bounce 0.4s ease-in-out infinite alternate;
  opacity: 0.6;
}
.jarvis-waveform-bar:nth-child(1) { animation-duration: 0.35s; }
.jarvis-waveform-bar:nth-child(2) { animation-duration: 0.45s; }
.jarvis-waveform-bar:nth-child(3) { animation-duration: 0.38s; }
.jarvis-waveform-bar:nth-child(4) { animation-duration: 0.5s; }
.jarvis-waveform-bar:nth-child(5) { animation-duration: 0.32s; }
.jarvis-waveform-bar:nth-child(6) { animation-duration: 0.42s; }
.jarvis-waveform-bar:nth-child(7) { animation-duration: 0.48s; }
.jarvis-waveform-bar:nth-child(8) { animation-duration: 0.36s; }
.jarvis-waveform-bar:nth-child(9) { animation-duration: 0.44s; }
.jarvis-waveform-bar:nth-child(10) { animation-duration: 0.38s; }
.jarvis-waveform-bar:nth-child(11) { animation-duration: 0.52s; }
.jarvis-waveform-bar:nth-child(12) { animation-duration: 0.34s; }
@keyframes wave-bounce {
  from { height: 4px; opacity: 0.5; }
  to { height: 18px; opacity: 1; }
}

/* === MIC BUTTON === */
.jarvis-btn-mic {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  color: var(--fg-muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.jarvis-btn-mic:hover {
  background: rgba(0, 212, 255, 0.15);
  color: var(--jarvis-cyan);
  border-color: rgba(0, 212, 255, 0.5);
}
.jarvis-btn-mic.active {
  background: rgba(0, 212, 255, 0.2);
  color: var(--jarvis-cyan);
  border-color: var(--jarvis-cyan);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
  animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 212, 255, 0.3); }
  50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.5); }
}
.jarvis-btn-mic svg { display: block; }

/* === PRESENTATION AREA === */
.jarvis-presentation {
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease-out;
  flex-shrink: 0;
  position: relative;
}
.jarvis-presentation.active {
  height: 220px;
}
.jarvis-presentation-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 8px 0;
}
.jarvis-presentation-inner::-webkit-scrollbar { width: 3px; }
.jarvis-presentation-inner::-webkit-scrollbar-track { background: transparent; }
.jarvis-presentation-inner::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.15); border-radius: 2px; }

/* Presentation mode standard response */
.jarvis-response-standard {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.jarvis-response-text {
  flex: 1;
}
.jarvis-response-visual {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Data card rotation */
.jarvis-data-card {
  width: 70px;
  height: 70px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  background: rgba(0, 20, 40, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  animation: data-card-rotate 6s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.1);
}
@keyframes data-card-rotate {
  0%, 100% { transform: rotateY(0deg) scale(1); }
  25% { transform: rotateY(5deg) scale(1.02); }
  50% { transform: rotateY(0deg) scale(1); }
  75% { transform: rotateY(-5deg) scale(1.02); }
}
.jarvis-data-card-icon {
  width: 24px;
  height: 24px;
  color: var(--jarvis-cyan);
  opacity: 0.7;
}
.jarvis-data-card-label {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--jarvis-cyan);
  opacity: 0.8;
}

/* === VOICE SELECT === */
.jarvis-voice-select {
  background: rgba(0, 20, 40, 0.7);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--jarvis-text);
  cursor: pointer;
  outline: none;
}
.jarvis-voice-select:focus {
  border-color: rgba(0, 212, 255, 0.5);
}
.jarvis-voice-select option {
  background: var(--jarvis-bg);
  color: var(--jarvis-text);
}

/* === ERROR STATE === */
.jarvis-error-flash {
  animation: error-shake 0.4s ease-out;
}
@keyframes error-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* === ORBITING DOTS (THINKING) === */
.jarvis-thinking-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 8px;
}
.jarvis-thinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jarvis-cyan);
  animation: thinking-orbit 1.2s ease-in-out infinite;
  box-shadow: 0 0 6px var(--jarvis-cyan);
}
.jarvis-thinking-dot:nth-child(1) { animation-delay: 0s; }
.jarvis-thinking-dot:nth-child(2) { animation-delay: 0.15s; }
.jarvis-thinking-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes thinking-orbit {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-6px); opacity: 1; }
}

/* === HUD LOGO === */
.ws-hud-logo.jarvis-mode {
  color: var(--jarvis-cyan);
}
.ws-hud-logo.jarvis-mode svg path,
.ws-hud-logo.jarvis-mode svg circle {
  stroke: var(--jarvis-cyan);
}
.ws-hud-logo.jarvis-mode svg circle:last-child {
  fill: var(--jarvis-cyan);
}
