/**
 * ASSISTENTE IA - VOICE CSS v1.0.0
 *
 * Stili per pulsante microfono e icona speaker.
 * Scritti in modo da NON conflittare con assistente-ia.css.
 * Tutti gli stili scoped dentro #assistente-ia-popup.
 */

/* ═══════════════════════════════════════════════════════════════
   PULSANTE MICROFONO
   ═══════════════════════════════════════════════════════════════ */

#assistente-ia-popup .assia-voice-mic-btn {
    /* Reset completo ereditato */
    all: unset !important;
    box-sizing: border-box !important;

    /* Dimensioni pari al pulsante invio */
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;

    /* Layout */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Stile base */
    border-radius: 12px !important;
    background: #f1f5f9 !important;
    border: 2px solid #e2e8f0 !important;
    color: #64748b !important;
    font-size: 0 !important;
    cursor: pointer !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

#assistente-ia-popup .assia-voice-mic-btn:hover {
    background: #e2e8f0 !important;
    color: #374151 !important;
}

/* ── Stato: ascolto attivo (rosso pulsante) ── */
#assistente-ia-popup .assia-voice-mic-ascolto {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #dc2626 !important;
    animation: assia-voice-pulse 1.2s ease-in-out infinite !important;
}

/* ── Stato: errore ── */
#assistente-ia-popup .assia-voice-mic-errore {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    color: #b45309 !important;
}

/* Animazione pulsazione per stato ascolto */
@keyframes assia-voice-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ═══════════════════════════════════════════════════════════════
   PULSANTE SPEAKER (su ogni messaggio IA)
   ═══════════════════════════════════════════════════════════════ */

#assistente-ia-popup .assia-voice-speaker-btn {
    all: unset !important;
    box-sizing: border-box !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 44px !important;
    height: 44px !important;
    margin-left: 6px !important;
    vertical-align: middle !important;

    border-radius: 50% !important;
    background: #f1f5f9 !important;
    color: #64748b !important;
    font-size: 0 !important;
    cursor: pointer !important;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease !important;
    flex-shrink: 0 !important;
}

#assistente-ia-popup .assia-voice-speaker-btn:hover {
    color: #3b82f6 !important;
    background: #dbeafe !important;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.2) !important;
}

/* ── Stato: disabilitato (limite sessione raggiunto) ── */
#assistente-ia-popup .assia-voice-speaker-btn.assia-voice-speaker-disabled,
#assistente-ia-popup .assia-voice-speaker-btn:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ── Stato: caricamento ── */
#assistente-ia-popup .assia-voice-speaker-loading {
    color: #3b82f6 !important;
    animation: assia-voice-spin 1s linear infinite !important;
}

/* ── Stato: in riproduzione ── */
#assistente-ia-popup .assia-voice-speaker-playing {
    color: #3b82f6 !important;
}

@keyframes assia-voice-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — mobile
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
    #assistente-ia-popup .assia-voice-mic-btn {
        flex: 0 0 40px !important;
        width: 40px !important;
        height: 40px !important;
    }
    #assistente-ia-popup .assia-voice-speaker-btn {
        width: 40px !important;
        height: 40px !important;
    }
}
