/* ==========================================================
   ASSISTENTE - BALÃO FLUTUANTE E CHAT
   ========================================================== */

/* Balão flutuante */
.assistant-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    background: var(--primary-gradient);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.assistant-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

.assistant-bubble i {
    font-size: 28px;
    color: white;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Janela do chat */
.assistant-chat {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 360px;
    max-height: 500px;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 9998;
    animation: slideUp 0.3s ease;
}

.assistant-chat.open {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cabeçalho do chat */
.assistant-header {
    padding: 16px 20px;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

.assistant-header .close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
}

.assistant-header .close-btn:hover {
    opacity: 1;
}

/* Área de mensagens */
.assistant-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    max-height: 380px;
    background: var(--bg-input);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assistant-messages .message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.assistant-messages .message.user {
    background: var(--primary-gradient);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.assistant-messages .message.bot {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.assistant-messages .message.bot .typing-indicator {
    display: inline-block;
    animation: typingDot 1.4s infinite;
}

@keyframes typingDot {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0; }
}

/* Input do chat */
.assistant-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background: var(--bg-card);
}

.assistant-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s;
}

.assistant-input-area input:focus {
    border-color: var(--primary-start);
}

.assistant-input-area button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.assistant-input-area button:hover {
    transform: scale(1.05);
}

/* Responsividade */
@media (max-width: 480px) {
    .assistant-chat {
        width: 90%;
        right: 5%;
        bottom: 90px;
        max-height: 450px;
    }
}