/* Voice Recording UI Styles */

/* Recording overlay */
.voice-recording-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.voice-recording-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Recording container */
.voice-recording-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  min-width: 350px;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.voice-recording-overlay.active .voice-recording-container {
  transform: scale(1);
}

/* Recording indicator */
.recording-indicator {
  width: 120px;
  height: 120px;
  margin: 0 auto 30px;
  position: relative;
}

.recording-dot {
  width: 40px;
  height: 40px;
  background: #ff3b3b;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.7);
  animation: recording-pulse 2s infinite;
}

@keyframes recording-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.7);
  }
  70% {
    box-shadow: 0 0 0 40px rgba(255, 59, 59, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0);
  }
}

/* Waveform animation */
.waveform {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  height: 60px;
  margin-bottom: 20px;
}

.wave-bar {
  width: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  animation: wave-animation 1s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; height: 20px; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; height: 30px; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; height: 25px; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; height: 35px; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; height: 30px; }
.wave-bar:nth-child(6) { animation-delay: 0.5s; height: 25px; }
.wave-bar:nth-child(7) { animation-delay: 0.6s; height: 20px; }

@keyframes wave-animation {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(2);
  }
}

/* Recording text */
.recording-text {
  color: white;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
}

.recording-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  margin-bottom: 30px;
}

/* Timer */
.recording-timer {
  background: rgba(0, 0, 0, 0.3);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 30px;
  min-width: 80px;
}

/* Stop button */
.stop-recording-btn {
  background: white;
  color: #667eea;
  border: none;
  padding: 15px 40px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.stop-recording-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Processing state */
.voice-processing {
  text-align: center;
  padding: 20px;
}

.processing-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.processing-text {
  color: #667eea;
  font-size: 16px;
  font-weight: 500;
}

/* Voice response */
.voice-response {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  margin: 10px 0;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.voice-response-text {
  margin-bottom: 10px;
}

.voice-response-audio {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-play-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
}

.voice-play-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Long press indicator */
.long-press-indicator {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 3px solid #667eea;
  border-radius: 50%;
  opacity: 1;
  transform: scale(1);
  pointer-events: none;
  /* Circular progress animation over 2 seconds */
  clip-path: inset(0 0 0 0);
  animation: long-press-fill 2s linear forwards;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

.long-press-indicator.active {
  opacity: 1;
  transform: scale(1.1);
  border-color: #4CAF50;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.7);
  animation: long-press-pulse 0.5s ease-out;
}

@keyframes long-press-fill {
  0% {
    border-color: #667eea;
    box-shadow: 0 0 4px rgba(102, 126, 234, 0.3);
  }
  50% {
    border-color: #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
  }
  100% {
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.7);
  }
}

@keyframes long-press-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  100% {
    box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
  }
}

/* Tooltip hint for long-press */
.long-press-hint {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}

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

/* Assistant mic button enhancement */
.assistant-mic {
  position: relative;
  overflow: visible;
  /* Larger touch target on mobile */
  min-width: 44px;
  min-height: 44px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.assistant-mic.recording {
  background: linear-gradient(135deg, #ff3b3b 0%, #ff6b6b 100%) !important;
  animation: mic-recording 1s ease-in-out infinite;
}

@keyframes mic-recording {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Mic permission prompt */
.mic-permission-prompt {
  background: #fff3cd;
  color: #856404;
  padding: 15px;
  border-radius: 8px;
  margin: 10px 0;
  border: 1px solid #ffeeba;
  text-align: center;
}

.mic-permission-prompt i {
  font-size: 24px;
  margin-bottom: 10px;
  display: block;
}

/* Error state */
.voice-error {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 8px;
  margin: 10px 0;
  border: 1px solid #f5c6cb;
}

/* Success animation */
.voice-success {
  background: #d4edda;
  color: #155724;
  padding: 15px;
  border-radius: 8px;
  margin: 10px 0;
  border: 1px solid #c3e6cb;
  animation: success-bounce 0.5s ease;
}

@keyframes success-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}