/**
 * Estilos para o componente de gravação de áudio
 * Design moderno e responsivo
 */

/* Container principal */
.audio-input-section {
  margin: 1.5rem 0;
}

/* Toggle de modo de entrada */
.input-mode-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  flex-wrap: wrap;
}

.input-mode-option {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  padding: 1rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.input-mode-option:active {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.input-mode-option input[type="radio"] {
  margin-right: 0.75rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.input-mode-option input[type="radio"]:checked + span {
  font-weight: 600;
  color: #007bff;
}

.input-mode-option span {
  font-size: 1rem;
  color: #333;
  transition: all 0.3s ease;
}

/* Containers de entrada */
.text-input-container,
.audio-input-container {
  animation: fadeIn 0.3s ease;
}

/* Estilos para campos com erro */
.form__input.error,
input.error,
select.error,
textarea.error {
  border-color: #e74c3c !important;
  background-color: #fff5f5 !important;
}

.form__input.error:focus,
input.error:focus,
select.error:focus,
textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

/* Label dos campos do formulário na seção de áudio */
.text-input-container .form__group {
  margin-bottom: 0;
}

.text-input-container .form__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.text-input-container .form__input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.text-input-container .form__input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.text-input-container .form__input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.6;
}

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

/* Gravador de áudio */
.audio-recorder {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 2rem;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Status do gravador */
.audio-recorder-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.status-icon {
  font-size: 3rem;
  animation: pulse 2s ease-in-out infinite;
}

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

.status-text {
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
}

.status-timer {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Montserrat', monospace;
  letter-spacing: 2px;
}

/* Controles de áudio */
.audio-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.btn-audio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn-audio:active {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-audio .icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* Botões específicos */
.btn-record {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border-color: transparent;
}

.btn-record:active {
  background: linear-gradient(135deg, #c0392b, #a93226);
}

.btn-pause {
  background: linear-gradient(135deg, #f39c12, #d68910);
  border-color: transparent;
}

.btn-resume {
  background: linear-gradient(135deg, #27ae60, #229954);
  border-color: transparent;
}

.btn-stop {
  background: linear-gradient(135deg, #3498db, #2980b9);
  border-color: transparent;
}

.btn-cancel {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  border-color: transparent;
}

/* Preview do áudio */
.audio-preview {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  color: #333;
}

.audio-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.audio-preview-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #667eea;
}

.btn-audio-delete {
  padding: 0.5rem 1rem;
  background: #e74c3c;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.btn-audio-delete:active {
  background: #c0392b;
  transform: scale(1.1);
}

/* Player de áudio */
.audio-player {
  width: 100%;
  margin-bottom: 1rem;
  border-radius: 6px;
  outline: none;
}

/* Container de transcrição */
.transcription-container {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #667eea;
}

.transcription-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.transcription-status .spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.transcription-status .text {
  color: #666;
  font-weight: 500;
}

.transcription-status .error-icon {
  font-size: 1.5rem;
}

.btn-retry {
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-retry:active {
  background: #5568d3;
}

/* Resultado da transcrição */
.transcription-result {
  padding: 1rem;
  background: white;
  border-radius: 6px;
}

.transcription-result h4 {
  margin: 1rem 0 0.5rem 0;
  color: #667eea;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transcription-result h4:first-child {
  margin-top: 0;
}

.transcription-result p {
  margin: 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  line-height: 1.6;
  color: #333;
}

.transcription-full {
  font-size: 0.95rem;
  color: #666;
  border-left: 3px solid #e0e0e0;
}

.transcription-summary {
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  border-left: 3px solid #667eea;
}

/* Ajuda */
.audio-help {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  backdrop-filter: blur(10px);
}

.audio-help p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.audio-help strong {
  color: white;
}

/* Mensagem de não suportado */
.audio-not-supported {
  padding: 2rem;
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 8px;
  text-align: center;
}

.audio-not-supported p {
  margin: 0.5rem 0;
  color: #856404;
}

/* Mensagens do formulário */
.form-message {
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  opacity: 1;
  transition: opacity 0.3s ease;
  animation: slideDown 0.3s ease;
}

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

.form-message--success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message--error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.form-message--warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.form-message--info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Responsividade */
@media (max-width: 768px) {
  .audio-recorder {
    padding: 1.5rem 1rem;
  }

  .input-mode-toggle {
    flex-direction: column;
    gap: 0.5rem;
  }

  .input-mode-option {
    min-width: 100%;
  }

  .audio-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn-audio {
    width: 100%;
    justify-content: center;
  }

  .status-icon {
    font-size: 2rem;
  }

  .status-text {
    font-size: 1rem;
  }

  .status-timer {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .audio-recorder-status {
    padding: 1rem;
  }

  .btn-audio {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .transcription-result h4 {
    font-size: 0.85rem;
  }

  .transcription-result p {
    font-size: 0.9rem;
    padding: 0.75rem;
  }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
  .status-icon,
  .btn-audio,
  .form-message,
  .text-input-container,
  .audio-input-container {
    animation: none;
  }

  .btn-audio:active {
    transform: none;
  }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
  .input-mode-toggle {
    background: #2c3e50;
  }

  .input-mode-option {
    background: #34495e;
    border-color: #4a5f7f;
    color: #ecf0f1;
  }

  .input-mode-option span {
    color: #ecf0f1;
  }

  .audio-preview {
    background: rgba(52, 73, 94, 0.95);
    color: #ecf0f1;
  }

  .transcription-container {
    background: #2c3e50;
  }

  .transcription-status {
    background: #34495e;
  }

  .transcription-status .text {
    color: #bdc3c7;
  }

  .transcription-result {
    background: #34495e;
  }

  .transcription-result p {
    background: #2c3e50;
    color: #ecf0f1;
  }

  .audio-not-supported {
    background: #8b6f47;
    border-color: #c9a86a;
  }

  .audio-not-supported p {
    color: #f8f9fa;
  }
}

