/* ═══════════════════════════════════════════════════════════════
   NEXUS VOICE AI — JARVIS SYSTEM STYLES
   ═══════════════════════════════════════════════════════════════ */

/* ─── FLOATING VOICE TRIGGER BUTTON ─── */
.voice-trigger-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,245,255,0.15), rgba(123,47,255,0.15));
  border: 1.5px solid rgba(0,245,255,0.5);
  backdrop-filter: blur(20px);
  cursor: pointer;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 20px rgba(0,245,255,0.2), 0 8px 32px rgba(0,0,0,0.4);
}
.voice-trigger-fab:hover {
  transform: scale(1.12);
  border-color: #00f5ff;
  box-shadow: 0 0 40px rgba(0,245,255,0.4), 0 8px 32px rgba(0,0,0,0.5);
}
.voice-trigger-fab.listening {
  border-color: #00f5ff;
  background: linear-gradient(135deg, rgba(0,245,255,0.25), rgba(0,128,255,0.2));
  animation: fabPulse 1.2s ease-in-out infinite;
}
.voice-trigger-fab.speaking {
  border-color: #7b2fff;
  background: linear-gradient(135deg, rgba(123,47,255,0.25), rgba(0,128,255,0.2));
  animation: fabPulse 0.8s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,245,255,0.3), 0 8px 32px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 50px rgba(0,245,255,0.6), 0 0 80px rgba(0,245,255,0.2), 0 8px 32px rgba(0,0,0,0.4); }
}
.fab-icon { color: #00f5ff; transition: all 0.3s; }
.fab-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(0,245,255,0.2);
  animation: fabRing 2s linear infinite;
}
.fab-ring-2 {
  inset: -14px;
  border-color: rgba(123,47,255,0.15);
  animation-duration: 3s;
  animation-direction: reverse;
}
@keyframes fabRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.fab-tooltip {
  position: absolute;
  right: 76px;
  background: rgba(0,0,0,0.85);
  border: 1px solid rgba(0,245,255,0.3);
  color: #00f5ff;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(10px);
}
.voice-trigger-fab:hover .fab-tooltip { opacity: 1; }

/* ─── VOICE OVERLAY PANEL ─── */
.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.voice-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.voice-panel {
  width: 680px;
  max-width: 95vw;
  background: rgba(2,4,12,0.95);
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 24px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0,245,255,0.1), 0 40px 80px rgba(0,0,0,0.6);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.voice-overlay.active .voice-panel {
  transform: scale(1) translateY(0);
}

/* Scanline overlay */
.voice-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,245,255,0.015) 2px,
    rgba(0,245,255,0.015) 4px
  );
  pointer-events: none;
  border-radius: 24px;
}

/* Corner decorations */
.voice-panel::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00f5ff, transparent);
  opacity: 0.6;
}

/* ─── PANEL HEADER ─── */
.vp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.vp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vp-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,245,255,0.2), rgba(123,47,255,0.2));
  border: 1px solid rgba(0,245,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #00f5ff;
  position: relative;
}
.vp-logo::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(0,245,255,0.2);
  animation: fabRing 3s linear infinite;
}
.vp-title-group h3 {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: 0.05em;
}
.vp-title-group span {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: rgba(0,245,255,0.6);
  letter-spacing: 0.15em;
}
.vp-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 18px;
  line-height: 1;
}
.vp-close:hover {
  background: rgba(255,45,120,0.15);
  border-color: rgba(255,45,120,0.4);
  color: #ff2d78;
}

/* ─── RADAR / ORB SECTION ─── */
.vp-orb-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
  position: relative;
}

.voice-radar-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 16px;
}

#voice-radar-canvas {
  position: absolute;
  inset: 0;
}

.voice-core-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(100,240,255,0.9), rgba(0,128,255,0.6), rgba(123,47,255,0.4));
  border: 1.5px solid rgba(0,245,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0,245,255,0.3), inset 0 0 20px rgba(0,245,255,0.1);
  transition: all 0.3s ease;
}
.voice-core-orb.listening {
  box-shadow: 0 0 50px rgba(0,245,255,0.6), 0 0 100px rgba(0,245,255,0.2), inset 0 0 30px rgba(0,245,255,0.2);
  animation: orbBreath 1s ease-in-out infinite;
}
.voice-core-orb.speaking {
  box-shadow: 0 0 50px rgba(123,47,255,0.6), 0 0 100px rgba(123,47,255,0.2), inset 0 0 30px rgba(123,47,255,0.2);
  animation: orbBreath 0.6s ease-in-out infinite;
}
@keyframes orbBreath {
  0%, 100% { transform: translate(-50%,-50%) scale(1); }
  50% { transform: translate(-50%,-50%) scale(1.08); }
}
.orb-inner-icon { color: #fff; opacity: 0.9; }

/* ─── STATUS DISPLAY ─── */
.vp-status {
  text-align: center;
  margin-bottom: 4px;
}
.vp-status-text {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0,245,255,0.7);
  transition: color 0.3s;
}
.vp-status-text.listening { color: #00f5ff; }
.vp-status-text.speaking { color: #7b2fff; }
.vp-status-text.processing { color: #ffd700; }

/* ─── WAVEFORM ─── */
.vp-waveform {
  width: 100%;
  height: 48px;
  margin-bottom: 20px;
  position: relative;
}
#voice-waveform-canvas {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* ─── TRANSCRIPT DISPLAY ─── */
.vp-transcript {
  background: rgba(0,245,255,0.04);
  border: 1px solid rgba(0,245,255,0.1);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.vp-transcript::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #00f5ff, #7b2fff);
  border-radius: 3px 0 0 3px;
}
.transcript-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: rgba(0,245,255,0.5);
  letter-spacing: 0.15em;
  white-space: nowrap;
}
.transcript-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  flex: 1;
  font-style: italic;
  transition: all 0.3s;
}
.transcript-text.active { color: #fff; font-style: normal; }

/* ─── NEXUS RESPONSE ─── */
.vp-response {
  background: rgba(123,47,255,0.06);
  border: 1px solid rgba(123,47,255,0.15);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  min-height: 52px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.vp-response::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #7b2fff, #0080ff);
  border-radius: 3px 0 0 3px;
}
.response-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.response-content { flex: 1; }
.response-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: rgba(123,47,255,0.7);
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 4px;
}
.response-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
}
.response-text .typing-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #7b2fff;
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.7s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ─── WAKE WORDS ─── */
.vp-wake-words {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.wake-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.wake-word {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0,245,255,0.08);
  border: 1px solid rgba(0,245,255,0.2);
  color: rgba(0,245,255,0.7);
  letter-spacing: 0.05em;
  transition: all 0.2s;
}
.wake-word.triggered {
  background: rgba(0,245,255,0.2);
  border-color: #00f5ff;
  color: #00f5ff;
  box-shadow: 0 0 12px rgba(0,245,255,0.3);
}

/* ─── COMMAND SHORTCUTS ─── */
.vp-commands {
  margin-bottom: 20px;
}
.vp-commands-title {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.15em;
  margin-bottom: 10px;
}
.cmd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cmd-chip {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cmd-chip:hover {
  background: rgba(0,245,255,0.08);
  border-color: rgba(0,245,255,0.3);
  color: rgba(0,245,255,0.8);
  transform: translateY(-1px);
}
.cmd-chip.active {
  background: rgba(0,245,255,0.12);
  border-color: rgba(0,245,255,0.4);
  color: #00f5ff;
}

/* ─── BOTTOM CONTROLS ─── */
.vp-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vp-mic-btn {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,245,255,0.15), rgba(0,128,255,0.1));
  border: 1px solid rgba(0,245,255,0.3);
  color: #00f5ff;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
}
.vp-mic-btn:hover {
  background: linear-gradient(135deg, rgba(0,245,255,0.25), rgba(0,128,255,0.2));
  border-color: #00f5ff;
  box-shadow: 0 0 20px rgba(0,245,255,0.2);
}
.vp-mic-btn.active {
  background: linear-gradient(135deg, rgba(0,245,255,0.3), rgba(0,128,255,0.25));
  border-color: #00f5ff;
  box-shadow: 0 0 30px rgba(0,245,255,0.3);
  animation: micGlow 1s ease-in-out infinite;
}
@keyframes micGlow {
  0%,100% { box-shadow: 0 0 20px rgba(0,245,255,0.3); }
  50% { box-shadow: 0 0 40px rgba(0,245,255,0.5); }
}
.vp-type-btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.vp-type-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
}

/* ─── TYPE INPUT MODE ─── */
.vp-type-input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  display: none;
}
.vp-type-input-row.visible { display: flex; }
.vp-type-input {
  flex: 1;
  height: 44px;
  background: rgba(0,245,255,0.05);
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 10px;
  padding: 0 16px;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.vp-type-input:focus { border-color: rgba(0,245,255,0.5); }
.vp-type-input::placeholder { color: rgba(255,255,255,0.25); }
.vp-type-send {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00f5ff, #0080ff);
  border: none;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.vp-type-send:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(0,245,255,0.4); }

/* ─── HISTORY LOG ─── */
.vp-history {
  margin-top: 16px;
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,245,255,0.2) transparent;
}
.history-item {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
}
.history-item:last-child { border-bottom: none; }
.history-role {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 1px;
}
.history-role.user {
  background: rgba(0,245,255,0.1);
  color: rgba(0,245,255,0.7);
}
.history-role.nexus {
  background: rgba(123,47,255,0.1);
  color: rgba(123,47,255,0.7);
}
.history-text { color: rgba(255,255,255,0.5); line-height: 1.4; }

/* ─── MODE BADGES ─── */
.vp-mode-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mode-badge {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.5;
}
.mode-badge:hover { opacity: 0.8; }
.mode-badge.active { opacity: 1; }
.mode-badge.productivity { border-color: rgba(0,245,255,0.4); color: #00f5ff; }
.mode-badge.productivity.active { background: rgba(0,245,255,0.1); }
.mode-badge.gaming { border-color: rgba(255,107,53,0.4); color: #ff6b35; }
.mode-badge.gaming.active { background: rgba(255,107,53,0.1); }
.mode-badge.creator { border-color: rgba(123,47,255,0.4); color: #7b2fff; }
.mode-badge.creator.active { background: rgba(123,47,255,0.1); }
.mode-badge.study { border-color: rgba(255,215,0,0.4); color: #ffd700; }
.mode-badge.study.active { background: rgba(255,215,0,0.1); }

/* ─── PERMISSION NOTICE ─── */
.vp-permission-notice {
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: rgba(255,215,0,0.7);
}
.vp-permission-notice svg { flex-shrink: 0; color: #ffd700; }

/* ─── STARTUP SEQUENCE ─── */
.nexus-startup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.nexus-startup-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.startup-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(100,240,255,0.9), rgba(0,128,255,0.6), rgba(123,47,255,0.3));
  border: 2px solid rgba(0,245,255,0.6);
  box-shadow: 0 0 60px rgba(0,245,255,0.4), 0 0 120px rgba(0,245,255,0.1);
  animation: startupOrb 1.5s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
}
@keyframes startupOrb {
  0%,100% { box-shadow: 0 0 60px rgba(0,245,255,0.4), 0 0 120px rgba(0,245,255,0.1); }
  50% { box-shadow: 0 0 100px rgba(0,245,255,0.7), 0 0 200px rgba(0,245,255,0.2); }
}
.startup-text {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: rgba(0,245,255,0.8);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
}
.startup-diag {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  text-align: center;
  line-height: 1.8;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 720px) {
  .voice-panel { padding: 24px 20px; }
  .voice-radar-container { width: 160px; height: 160px; }
  .voice-trigger-fab { bottom: 80px; right: 20px; }
}