/* Voice Input Styling for Scaleify */
/* Professional voice button with animations and states */

/* ============================================
   VOICE BUTTON BASE STYLES
   ============================================ */

/* Landing page voice icon button */
.voice-icon-btn {
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  order: 2 !important;
  margin-left: 4px;
  padding: 0;
}

.voice-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: rgba(255, 255, 255, 0.6);
  transition: stroke 0.2s ease;
}

.voice-icon-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

.voice-icon-btn:hover svg {
  stroke: rgba(255, 255, 255, 0.9);
}

/* Builder page voice icon button */
.chat-voice-icon-btn {
  background-color: transparent;
  color: #8B949E;
  border: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  order: 2 !important;
  margin-left: 4px;
  padding: 0;
}

.chat-voice-icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: #8B949E;
  transition: stroke 0.2s ease;
}

.chat-voice-icon-btn:hover {
  color: #E6EDF3;
}

.chat-voice-icon-btn:hover svg {
  stroke: #E6EDF3;
}

/* ============================================
   MICROPHONE ICON
   ============================================ */

.mic-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.2s ease;
}

.voice-button .mic-icon {
  width: 20px;
  height: 20px;
}

/* ============================================
   RECORDING STATE (ACTIVE/LISTENING)
   ============================================ */

.voice-icon-btn.recording,
.chat-voice-icon-btn.recording {
  color: #2F81F7;
  animation: pulse-glow 1.5s ease-in-out infinite;
}

.voice-icon-btn.recording svg,
.chat-voice-icon-btn.recording svg {
  stroke: #2F81F7;
}

.voice-icon-btn.recording:hover,
.chat-voice-icon-btn.recording:hover {
  color: #1a6fd1;
}

.voice-icon-btn.recording:hover svg,
.chat-voice-icon-btn.recording:hover svg {
  stroke: #1a6fd1;
}

/* Pulse animation for recording state */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(47, 129, 247, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(47, 129, 247, 0);
    transform: scale(1.02);
  }
}

/* Microphone icon animation during recording */
.recording .mic-icon {
  animation: mic-pulse 1s ease-in-out infinite;
}

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

/* ============================================
   PROCESSING STATE
   ============================================ */

.voice-icon-btn.processing,
.chat-voice-icon-btn.processing {
  color: #2F81F7;
  cursor: wait;
  animation: pulse-glow 1.5s ease-in-out infinite;
}

.voice-icon-btn.processing svg,
.chat-voice-icon-btn.processing svg {
  stroke: #2F81F7;
}

.processing .mic-icon {
  animation: spin 1s linear infinite;
}

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

/* ============================================
   ERROR STATE
   ============================================ */

.voice-icon-btn.error,
.chat-voice-icon-btn.error {
  color: #DA3633;
  animation: shake 0.5s ease-in-out;
}

.voice-icon-btn.error svg,
.chat-voice-icon-btn.error svg {
  stroke: #DA3633;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ============================================
   DISABLED STATE
   ============================================ */

.voice-icon-btn:disabled,
.chat-voice-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   RECORDING INDICATOR DOT
   ============================================ */

.recording-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: #FF4444;
  border-radius: 50%;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ============================================
   WAVEFORM VISUALIZATION (OPTIONAL)
   ============================================ */

.voice-waveform {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    #2F81F7 50%, 
    transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.recording .voice-waveform {
  opacity: 1;
  animation: waveform 1.5s ease-in-out infinite;
}

@keyframes waveform {
  0%, 100% {
    transform: scaleX(0.5);
  }
  50% {
    transform: scaleX(1);
  }
}

/* ============================================
   TOOLTIP/HINT TEXT
   ============================================ */

.voice-hint {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #21262D;
  color: #E6EDF3;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.voice-hint::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid #21262D;
}

.voice-button:hover .voice-hint,
.chat-voice-btn:hover .voice-hint {
  opacity: 1;
}

.recording .voice-hint {
  opacity: 1;
}

/* ============================================
   PERMISSION MODAL
   ============================================ */

.voice-permission-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.voice-permission-content {
  background-color: #161B22;
  border: 1px solid #30363D;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

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

.voice-permission-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.voice-permission-icon {
  width: 40px;
  height: 40px;
  background-color: #2F81F7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-permission-icon svg {
  width: 20px;
  height: 20px;
  stroke: #FFFFFF;
  fill: none;
}

.voice-permission-title {
  font-size: 18px;
  font-weight: 600;
  color: #E6EDF3;
}

.voice-permission-message {
  color: #8B949E;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.voice-permission-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.voice-permission-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-permission-btn.primary {
  background-color: #2F81F7;
  color: #FFFFFF;
}

.voice-permission-btn.primary:hover {
  background-color: #1a6fd1;
}

.voice-permission-btn.secondary {
  background-color: transparent;
  color: #8B949E;
  border: 1px solid #30363D;
}

.voice-permission-btn.secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #E6EDF3;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .voice-button {
    padding: 0 16px;
    font-size: 14px;
  }
  
  .voice-hint {
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .voice-permission-content {
    padding: 20px;
    max-width: 90%;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.voice-icon-btn:focus,
.chat-voice-icon-btn:focus,
.attach-icon-btn:focus,
.chat-attach-icon-btn:focus {
  outline: 2px solid #2F81F7;
  outline-offset: 2px;
}

.voice-icon-btn:focus:not(:focus-visible),
.chat-voice-icon-btn:focus:not(:focus-visible),
.attach-icon-btn:focus:not(:focus-visible),
.chat-attach-icon-btn:focus:not(:focus-visible) {
  outline: none;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
