/* ===================================
   VOICE NAVIGATION - ESTILOS
   =================================== */

/* Voice Navigation Toggle Button */
.voice-nav-toggle {
    position: fixed;
    right: 1rem;
    /* Position below the accessibility toolbar (which is at top: ~5rem) */
    top: calc(1rem + 3rem + 0.5rem + 3rem + 0.5rem);
    z-index: 9998;
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    padding: 0;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-nav-toggle:hover,
.voice-nav-toggle:focus {
    transform: scale(1.05);
    background: rgba(245, 245, 245, 0.95);
}

.voice-nav-toggle:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.voice-nav-toggle.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.voice-nav-toggle.listening {
    background: #f56565;
    color: white;
    border-color: #f56565;
    animation: pulse-voice 1.5s ease-in-out infinite;
}

@keyframes pulse-voice {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 16px rgba(245, 101, 101, 0.4);
    }
}

/* Voice Navigation Overlay */
.voice-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.voice-nav-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Voice Navigation Modal */
.voice-nav-modal {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.voice-nav-modal h2 {
    margin-top: 0;
    color: #2d3748;
    font-size: 1.5rem;
}

/* Voice Microphone Icon Animation */
.voice-mic-icon {
    font-size: 4rem;
    margin: 1.5rem 0;
    display: inline-block;
}

.voice-mic-icon.listening {
    animation: mic-bounce 0.8s ease-in-out infinite;
}

@keyframes mic-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Voice Status Text */
.voice-status {
    font-size: 1.125rem;
    color: #4a5568;
    margin: 1rem 0;
    min-height: 1.5rem;
}

.voice-status.listening {
    color: #f56565;
    font-weight: 600;
}

.voice-status.success {
    color: #48bb78;
    font-weight: 600;
}

/* Voice Transcript Display */
.voice-transcript {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    min-height: 3rem;
    font-size: 1rem;
    color: #2d3748;
    font-style: italic;
}

/* Voice Commands Help */
.voice-commands-help {
    background: #edf2f7;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
    text-align: left;
}

.voice-commands-help h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #2d3748;
}

.voice-commands-help ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.voice-commands-help li {
    padding: 0.5rem 0;
    color: #4a5568;
    font-size: 0.875rem;
}

.voice-commands-help code {
    background: #cbd5e0;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Voice Control Buttons */
.voice-controls {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.voice-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-btn-primary {
    background: #667eea;
    color: white;
}

.voice-btn-primary:hover {
    background: #5a67d8;
}

.voice-btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.voice-btn-secondary:hover {
    background: #cbd5e0;
}

.voice-btn-danger {
    background: #f56565;
    color: white;
}

.voice-btn-danger:hover {
    background: #e53e3e;
}

.voice-btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Voice Navigation Help Modal */
.voice-help-section {
    margin-top: 1rem;
}

.voice-help-toggle {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.875rem;
}

.voice-help-toggle:hover {
    color: #5a67d8;
}

/* Voice Feedback Toast */
.voice-toast {
    position: fixed;
    top: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.voice-toast.show {
    opacity: 1;
    visibility: visible;
}

.voice-toast.success {
    border-left: 4px solid #48bb78;
}

.voice-toast.error {
    border-left: 4px solid #f56565;
}

.voice-toast.info {
    border-left: 4px solid #4299e1;
}

/* Dark Mode Support */
.dark-mode .voice-nav-toggle {
    background: rgba(45, 55, 72, 0.9);
    color: #e2e8f0;
    border-color: #4a5568;
}

.dark-mode .voice-nav-toggle.active {
    background: #667eea;
    color: white;
}

.dark-mode .voice-nav-modal {
    background: #2d3748;
    color: #e2e8f0;
}

.dark-mode .voice-nav-modal h2 {
    color: #e2e8f0;
}

.dark-mode .voice-status {
    color: #a0aec0;
}

.dark-mode .voice-transcript {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
}

.dark-mode .voice-commands-help {
    background: #1a202c;
}

.dark-mode .voice-commands-help h3 {
    color: #e2e8f0;
}

.dark-mode .voice-commands-help li {
    color: #a0aec0;
}

.dark-mode .voice-commands-help code {
    background: #4a5568;
    color: #e2e8f0;
}

.dark-mode .voice-btn-secondary {
    background: #4a5568;
    color: #e2e8f0;
}

.dark-mode .voice-btn-secondary:hover {
    background: #718096;
}

.dark-mode .voice-toast {
    background: #2d3748;
    color: #e2e8f0;
}

/* High Contrast Mode Support */
.high-contrast .voice-nav-toggle {
    background: #000;
    color: #fff;
    border: 3px solid #fff;
}

.high-contrast .voice-nav-toggle.listening {
    background: #ff0;
    color: #000;
    border-color: #000;
}

.high-contrast .voice-nav-modal {
    background: #000;
    color: #fff;
    border: 3px solid #fff;
}

.high-contrast .voice-transcript {
    background: #000;
    border-color: #fff;
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .voice-nav-toggle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
        right: 0.75rem;
        /* Position below accessibility button instead of at bottom
           Calculation: 0.75rem (initial margin) + 2.5rem (dark mode toggle) + 0.4rem (gap) + 2.5rem (accessibility button) + 0.5rem (gap) */
        top: calc(0.75rem + 2.5rem + 0.4rem + 2.5rem + 0.5rem);
        bottom: auto;
    }
    
    .voice-nav-modal {
        width: 95%;
        padding: 1.5rem;
    }
    
    .voice-mic-icon {
        font-size: 3rem;
    }
    
    .voice-controls {
        flex-direction: column;
    }
    
    .voice-btn {
        width: 100%;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .voice-nav-toggle,
    .voice-nav-overlay,
    .voice-toast {
        transition: none;
    }
    
    .voice-nav-toggle.listening,
    .voice-mic-icon.listening {
        animation: none;
    }
    
    @keyframes pulse-voice {
        0%, 100% {
            transform: none;
        }
    }
    
    @keyframes mic-bounce {
        0%, 100% {
            transform: none;
        }
    }
}
