/* ========================================
   SE VOICE CONTROLLER STYLES
   ======================================== */

/* Gold Mic Button - Header Style */
.mic-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.1);
  border: 2px solid #FFD700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  vertical-align: middle;
}

.mic-btn:hover {
  background: rgba(255, 215, 0, 0.25);
}

.mic-btn:active {
  transform: scale(0.95);
}

.mic-btn svg {
  width: 18px;
  height: 18px;
  fill: #FFD700;
}

.mic-btn svg path,
.mic-btn svg polygon {
  fill: #FFD700;
  stroke: #FFD700;
}

/* Mic Toggle Button - Gold Style */
.voice-toggle {
  background: rgba(255, 215, 0, 0.1);
  border: 2px solid #FFD700;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.voice-toggle:hover {
  background: rgba(255, 215, 0, 0.2);
}

.voice-toggle:active {
  transform: scale(0.95);
}

/* Default State - Gold */
.voice-toggle .mic-icon {
  fill: #FFD700 !important;
  transition: fill 0.2s ease;
}

.voice-toggle svg {
  fill: #FFD700 !important;
}

.voice-toggle svg path,
.voice-toggle svg polygon {
  fill: #FFD700 !important;
  stroke: #FFD700;
}

/* ON/Listening State - Gold */
.voice-toggle.listening .mic-icon {
  fill: #FFD700;
}

/* Hearing Speech State - Gold + Waves */
.voice-toggle.hearing .mic-icon {
  fill: #FFD700;
}

.voice-toggle.hearing .mic-waves {
  display: block !important;
  fill: #FFD700;
}

.voice-toggle.hearing .mic-icon {
  display: none;
}

.voice-toggle .mic-waves {
  display: none;
}

/* Wave Animation */
.voice-toggle.hearing .wave {
  animation: waveMove 0.5s ease-in-out infinite alternate;
}

.voice-toggle.hearing .wave-1 {
  animation-delay: 0s;
}

.voice-toggle.hearing .wave-2 {
  animation-delay: 0.25s;
}

@keyframes waveMove {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* Processing State - Spinner */
.voice-toggle.processing .mic-icon {
  fill: #FFD700;
  animation: spin 1s linear infinite;
}

/* @keyframes spin - defined in global.css */

/* Error State - Red */
.voice-toggle.error .mic-icon {
  fill: #E74C3C;
}

/* ========================================
   FIRST-TIME MODAL
   ======================================== */

.voice-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.voice-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.voice-modal {
  background: #16181C;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  border: 1px solid #2F3336;
}

.voice-modal-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.voice-modal h2 {
  color: #E7E9EA;
  font-size: 24px;
  margin-bottom: 12px;
}

.voice-modal p {
  color: #71767B;
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.voice-modal-examples {
  text-align: left;
  background: #000;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.voice-modal-examples p {
  color: #E7E9EA;
  font-size: 14px;
  margin: 8px 0;
}

.voice-modal-examples p:first-child {
  margin-top: 0;
}

.voice-modal-examples p:last-child {
  margin-bottom: 0;
}

.voice-modal-buttons {
  display: flex;
  gap: 12px;
}

.voice-modal-btn {
  flex: 1;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  border: none;
}

.voice-modal-btn.primary {
  background: #FFD700;
  color: #000;
}

.voice-modal-btn.primary:hover {
  background: #E6C200;
}

.voice-modal-btn.secondary {
  background: transparent;
  color: #E7E9EA;
  border: 1px solid #2F3336;
}

.voice-modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.voice-modal-footer {
  margin-top: 16px;
  font-size: 13px;
  color: #536471;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.voice-toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.voice-toast {
  background: #1D1F23;
  color: #E7E9EA;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid #2F3336;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

.voice-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.voice-toast.success {
  border-left: 3px solid #17BF63;
}

.voice-toast.error {
  border-left: 3px solid #E74C3C;
}

.voice-toast.info {
  border-left: 3px solid #1DA1F2;
}

/* ========================================
   HELP MODAL (Voice Commands List)
   ======================================== */

.voice-help-modal {
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.voice-help-section {
  margin-bottom: 24px;
}

.voice-help-section h3 {
  color: #FFD700;
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.voice-help-command {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #2F3336;
}

.voice-help-command:last-child {
  border-bottom: none;
}

.voice-help-phrase {
  color: #E7E9EA;
  font-family: monospace;
}

.voice-help-action {
  color: #71767B;
  font-size: 13px;
}

/* ========================================
   TRANSCRIPTION BUBBLE (Optional)
   ======================================== */

.voice-transcription {
  position: fixed;
  top: 70px;
  right: 20px;
  background: #1D1F23;
  border: 1px solid #FFD700;
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 300px;
  font-size: 14px;
  color: #E7E9EA;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.voice-transcription.active {
  opacity: 1;
  visibility: visible;
}

.voice-transcription::before {
  content: '🎤';
  margin-right: 8px;
}

/* ========================================
   MOBILE ADJUSTMENTS
   ======================================== */

@media (max-width: 767px) {
  .voice-modal {
    padding: 24px;
    margin: 16px;
  }

  .voice-modal-buttons {
    flex-direction: column;
  }

  .voice-toast-container {
    bottom: 100px; /* Above mobile nav */
    width: 90%;
    left: 5%;
    transform: none;
  }

  .voice-transcription {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  /* Ensure buttons are always visible */
  #ttsToggle, #voiceToggle,
  .mic-btn, .voice-toggle {
    flex-shrink: 0 !important;
  }
}

@media (max-width: 480px) {
  .mic-btn,
  .voice-toggle,
  #ttsToggle,
  #voiceToggle {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    min-height: 34px;
  }

  .mic-btn svg,
  .voice-toggle svg,
  #ttsToggle svg,
  #voiceToggle svg {
    width: 16px !important;
    height: 16px !important;
  }
}

@media (max-width: 375px) {
  .mic-btn,
  .voice-toggle,
  #ttsToggle,
  #voiceToggle {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px;
    min-height: 30px;
    border-width: 1.5px;
  }

  .mic-btn svg,
  .voice-toggle svg,
  #ttsToggle svg,
  #voiceToggle svg {
    width: 14px !important;
    height: 14px !important;
  }
}
