/* Styles pour la reconnaissance vocale */

.voice-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.voice-input-container textarea,
.voice-input-container input[type="text"] {
    flex: 1;
    margin-bottom: 0;
}

.voice-btn {
    min-width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid #007bff;
    background: white;
    color: #007bff;
}

.voice-btn:hover {
    background: #007bff;
    color: white;
    transform: scale(1.1);
}

.voice-btn.recording {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.voice-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    z-index: 10000;
    display: none;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.voice-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.voice-animation i {
    font-size: 2rem;
    animation: voice-pulse 1s infinite;
}

.voice-animation span {
    font-size: 1.1rem;
    font-weight: 500;
}

@keyframes voice-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.interim-result {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-style: italic;
    z-index: 9999;
    display: none;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.voice-error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 10001;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease;
}

.voice-unsupported-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.3s ease;
}

.voice-unsupported-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.voice-unsupported-content h4 {
    color: #495057;
    margin-bottom: 15px;
}

.voice-unsupported-content p {
    color: #6c757d;
    margin-bottom: 20px;
}

.alternatives {
    text-align: left;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.alternatives h5 {
    color: #495057;
    margin-bottom: 10px;
}

.alternatives ul {
    margin: 0;
    padding-left: 20px;
}

.alternatives li {
    margin-bottom: 8px;
    color: #6c757d;
}

.alternatives strong {
    color: #495057;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-actions .btn {
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-actions .btn-primary {
    background: #007bff;
    color: white;
}

.modal-actions .btn-primary:hover {
    background: #0056b3;
}

.modal-actions .btn-outline-primary {
    background: transparent;
    color: #007bff;
    border: 2px solid #007bff;
}

.modal-actions .btn-outline-primary:hover {
    background: #007bff;
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .voice-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .voice-btn {
        align-self: center;
        margin-top: 10px;
    }
    
    .voice-indicator {
        padding: 15px 20px;
        max-width: 90%;
    }
    
    .interim-result {
        max-width: 95%;
        padding: 8px 15px;
    }
}

/* Intégration avec les styles existants d'AidAnnot */
.annotation-form .voice-input-container {
    margin-bottom: 0;
}

.annotation-form .voice-btn {
    height: 45px;
    min-width: 45px;
}

/* Animation pour les champs avec reconnaissance vocale active */
.voice-input-container.active textarea,
.voice-input-container.active input[type="text"] {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Support pour les thèmes sombres */
@media (prefers-color-scheme: dark) {
    .voice-btn {
        background: #343a40;
        border-color: #007bff;
        color: #007bff;
    }
    
    .voice-btn:hover {
        background: #007bff;
        color: white;
    }
}