/* ==========================================================================
   Assistente de IA Flutuante
   ========================================================================== */

/* Botão flutuante no canto inferior direito */
.assistente-fab {
    position: fixed !important;
    bottom: 24px;
    right: 24px;
    z-index: 1200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Overlay escuro quando painel está aberto */
.assistente-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1250;
    animation: fadeIn 0.2s ease;
}

/* Painel lateral deslizante */
.assistente-painel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 100vw;
    height: 100vh;
    background: var(--mud-palette-surface);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1300;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.assistente-painel.aberto {
    right: 0;
}

/* Cabeçalho do painel */
.assistente-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-primary);
    color: white;
}

.assistente-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.assistente-header .mud-icon-button {
    color: white !important;
}

/* Chips de contexto (obra, RDO) */
.assistente-contexto {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    background: var(--mud-palette-background-grey);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.assistente-contexto:empty {
    display: none;
}

/* Área de mensagens */
.assistente-mensagens {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Mensagem de boas-vindas */
.assistente-bemvindo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
}

.assistente-sugestoes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    width: 100%;
}

.assistente-sugestoes .mud-button {
    font-size: 0.75rem;
    text-transform: none;
    justify-content: flex-start;
    text-align: left;
}

/* Bolha de mensagem */
.assistente-msg {
    display: flex;
    gap: 8px;
    max-width: 95%;
}

.assistente-msg.usuario {
    flex-direction: row-reverse;
    margin-left: auto;
}

.assistente-msg.assistente {
    margin-right: auto;
}

.assistente-msg-icon {
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--mud-palette-primary);
}

.assistente-msg-conteudo {
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.4;
}

.assistente-msg.usuario .assistente-msg-conteudo {
    background: var(--mud-palette-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.assistente-msg.assistente .assistente-msg-conteudo {
    background: var(--mud-palette-background-grey);
    border-bottom-left-radius: 4px;
}

.assistente-msg-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

/* Campo de input */
.assistente-input {
    padding: 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.assistente-input .mud-input-control {
    margin: 0;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile */
@media (max-width: 480px) {
    .assistente-fab {
        bottom: 16px;
        right: 16px;
    }

    .assistente-painel {
        width: 100vw;
        right: -100vw;
    }
}
