/* Palette AI - Voice Interface Styles (Phase 7) */

/* ============================================================================
   VOICE BUTTON STATES
   ============================================================================ */

#voiceBtn {
    position: relative;
    transition: all 200ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Idle state (default) */
#voiceBtn.idle {
    color: var(--text-secondary);
}

#voiceBtn.idle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Listening state (recording) - MORE PRONOUNCED */
#voiceBtn.listening {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2); /* Increased from 0.1 to 0.2 */
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3); /* Added glow */
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
    }
    50% {
        transform: scale(1.15); /* Increased from 1.1 to 1.15 */
        opacity: 0.9;
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.1); /* Pulsing glow */
    }
}

/* Processing state */
#voiceBtn.processing {
    color: var(--accent-primary);
    animation: voiceRotate 1s linear infinite;
}

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

/* Error state */
#voiceBtn.error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================================================
   TRANSCRIPTION OVERLAY
   ============================================================================ */

.voice-transcription-overlay {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 999;
    max-width: 500px;
    min-width: 300px;
    animation: slideUpFade 200ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

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

.voice-transcription-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
}

.voice-listening-icon {
    animation: voicePulse 1.5s ease-in-out infinite;
}

.voice-transcription-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 12px;
    min-height: 20px;
}

.voice-transcription-interim {
    opacity: 0.6;
    font-style: italic;
}

.voice-transcription-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.voice-action-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
}

.voice-action-btn.primary {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.voice-action-btn.primary:hover {
    background: var(--accent-hover);
}

.voice-action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.voice-action-btn.secondary:hover {
    background: var(--bg-hover);
}

/* ============================================================================
   SPEAKING INDICATOR
   ============================================================================ */

.speaking-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    font-size: 11px;
    color: #3b82f6;
    font-weight: 500;
    animation: fadeIn 200ms ease;
}

.speaking-icon {
    animation: speakingPulse 0.8s ease-in-out infinite;
}

@keyframes speakingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.speaking-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

.speaking-control-btn {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 14px;
    border-radius: 3px;
    transition: all 150ms ease;
}

.speaking-control-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* ============================================================================
   WAVEFORM VISUALIZATION
   ============================================================================ */

.voice-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 24px;
    margin: 8px 0;
}

.voice-waveform-bar {
    width: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: waveformPulse 1s ease-in-out infinite;
}

.voice-waveform-bar:nth-child(1) { animation-delay: 0s; }
.voice-waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.voice-waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.voice-waveform-bar:nth-child(4) { animation-delay: 0.3s; }
.voice-waveform-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes waveformPulse {
    0%, 100% { height: 8px; }
    50% { height: 20px; }
}

/* ============================================================================
   VOICE SETTINGS IN SETTINGS PANEL
   ============================================================================ */

.voice-settings-section {
    padding-top: 8px;
    border-top: 1px solid var(--border-primary);
}

.voice-test-btn {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 150ms ease;
}

.voice-test-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

/* ============================================================================
   BROWSER COMPATIBILITY WARNING
   ============================================================================ */

.voice-compatibility-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 6px;
    margin-bottom: 12px;
}

.voice-compatibility-warning-icon {
    color: #f59e0b;
    font-size: 18px;
    flex-shrink: 0;
}

.voice-compatibility-warning-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================================================================
   MOBILE OPTIMIZATIONS
   ============================================================================ */

@media (max-width: 768px) {
    .voice-transcription-overlay {
        bottom: 70px;
        left: 12px;
        right: 12px;
        max-width: none;
        transform: none;
    }
    
    @keyframes slideUpFade {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    #voiceBtn {
        font-size: 18px;
        padding: 6px;
    }
}

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