/* RAF-19: Voice Recording - Simplified Inline Approach */

/* ==============================================
   VOICE RECORDER BUTTON
   ============================================== */

/* Voice Recorder Button - GREEN THEME */
.voice-record-btn {
  width: 30px;
  height: 38px;
  border: none;
  background: transparent;
  color: #4BC451;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
  padding: 0;
}

.voice-record-btn:hover {
  background: rgba(75, 196, 81, 0.1);
  color: #3da842;
}

.voice-record-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Recording State - Red Pulsing */
.voice-record-btn.recording {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.voice-record-btn.recording:hover {
  background: rgba(220, 53, 69, 0.15);
}

.voice-record-btn.recording::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: rgba(220, 53, 69, 0.3);
  animation: recordPulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

/* Pulse Animation */
@keyframes recordPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.3;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
}

/* ==============================================
   RECORDING TIMER (INLINE)
   ============================================== */

/* Recording Timer Container - GREEN THEME */
.voice-recording-timer {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(75, 196, 81, 0.08);
  border-radius: 8px;
  color: #4BC451;
  font-size: 14px;
  font-weight: 500;
  animation: fadeIn 0.2s ease;
}

.voice-recording-timer.active {
  display: flex;
}

/* Recording Dot - GREEN */
.voice-recording-dot {
  width: 8px;
  height: 8px;
  background: #4BC451;
  border-radius: 50%;
  animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.9);
  }
}

/* Timer Text */
.voice-recording-time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* Delete Button (During Recording) - Clean Style */
.voice-delete-btn {
  background: transparent;
  border: none;
  color: #1f2937;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.voice-delete-btn:hover {
  opacity: 1;
  background: #f3f4f6;
  color: #000;
}

.voice-delete-btn svg {
  width: 16px;
  height: 16px;
}

/* ==============================================
   PERMISSION REQUEST (INLINE)
   ============================================== */

/* Permission Message */
.voice-permission-message {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 8px;
  color: #3b82f6;
  font-size: 13px;
  animation: fadeIn 0.2s ease;
}

.voice-permission-message.active {
  display: flex;
}

.voice-permission-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Error Message */
.voice-error-message {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(220, 53, 69, 0.05);
  border-radius: 8px;
  color: #dc3545;
  font-size: 13px;
  animation: fadeIn 0.2s ease;
}

.voice-error-message.active {
  display: flex;
}

/* ==============================================
   ANIMATIONS
   ============================================== */

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

/* ==============================================
   RESPONSIVE - MOBILE
   ============================================== */

@media (max-width: 768px) {
  .voice-record-btn {
    width: 30px;
    height: 38px;
  }
  
  .voice-record-btn svg {
    width: 22px;
    height: 22px;
  }
  
  .voice-recording-timer {
    font-size: 13px;
    padding: 6px 10px;
  }
  
  .voice-recording-dot {
    width: 6px;
    height: 6px;
  }
}

/* ==============================================
   DARK MODE
   ============================================== */

@media (prefers-color-scheme: dark) {
  .voice-record-btn {
    color: #9ca3af;
  }
  
  .voice-record-btn:hover {
    background: rgba(156, 163, 175, 0.1);
    color: #d1d5db;
  }
  
  .voice-recording-timer {
    background: rgba(220, 53, 69, 0.1);
    color: #ef4444;
  }
  
  .voice-permission-message {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
  }
  
  .voice-error-message {
    background: rgba(220, 53, 69, 0.1);
    color: #ef4444;
  }
  
  .voice-delete-btn {
    color: #d1d5db;
  }
  
  .voice-delete-btn:hover {
    color: #fff;
    background: #374151;
  }
}

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

/* Focus Styles */
.voice-record-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.voice-delete-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .voice-record-btn.recording::after,
  .voice-recording-dot,
  .voice-recording-timer,
  .voice-permission-message,
  .voice-error-message {
    animation: none;
  }
}

