/* ============================================
   REALTIME VOICE UI
   Styles for active call indicator, timer, and transcript
   ============================================ */

/* Active Call Indicator */
#realtimeIndicator {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  gap: 12px;
  font-family: var(--font-sans);
}

#realtimeIndicator.active {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(52, 211, 153, 0.4);
  }
  50% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
                0 0 30px rgba(52, 211, 153, 0.7);
  }
}

/* Pulsing dot */
#realtimeIndicator::before {
  content: '';
  width: 10px;
  height: 10px;
  background: #34D399;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

/* Call Timer */
#realtimeTimer {
  display: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin: 0;
  min-width: 40px;
  text-align: center;
}

/* Transcript Overlay */
#realtimeTranscript {
  display: none;
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 600px;
  width: 90%;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  z-index: 999;
  animation: slideUp 0.3s ease-out;
  min-height: 56px;
}

#realtimeTranscript:empty::before {
  content: 'Listening...';
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #realtimeIndicator {
    top: 10px;
    right: 10px;
    padding: 8px 16px;
    gap: 8px;
  }

  #realtimeIndicator::before {
    width: 8px;
    height: 8px;
  }

  #realtimeTimer {
    font-size: 12px;
    min-width: 35px;
  }

  #realtimeTranscript {
    bottom: 100px;
    width: 85%;
    padding: 12px 20px;
    font-size: 14px;
    min-height: 48px;
  }
}

/* Dark mode adjustments (if app uses dark mode toggle) */
@media (prefers-color-scheme: dark) {
  #realtimeIndicator {
    background: rgba(30, 30, 30, 0.9);
  }

  #realtimeTranscript {
    background: rgba(20, 20, 20, 0.9);
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  #realtimeIndicator {
    border: 2px solid #34D399;
  }

  #realtimeTranscript {
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #realtimeIndicator.active,
  #realtimeIndicator::before {
    animation: none;
  }

  #realtimeTranscript {
    animation: none;
  }
}

/* Voice button integration - add realtime mode indicator */
.voice-btn.realtime-active {
  background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.4);
}

.voice-btn.realtime-active:hover {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  box-shadow: 0 6px 16px rgba(52, 211, 153, 0.5);
}

/* Accessibility - ensure focus states are visible */
#realtimeIndicator:focus-within {
  outline: 2px solid #34D399;
  outline-offset: 2px;
}
