/* ==================== AVATAR/CHATBOT DE SUPORTE ==================== */

/* Botão Flutuante do Chatbot */
.chatbot-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(99,102,241,0.4);
    z-index: 999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(99,102,241,0.5);
}
.chatbot-fab.ativo {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 30px rgba(239,68,68,0.4);
}
.chatbot-fab.ativo i::before {
    content: "\f00d";
}
.chatbot-fab .chatbot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid white;
}

/* Painel do Chatbot */
.chatbot-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s ease;
}
.chatbot-panel.aberto {
    display: flex;
}
@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header do Chatbot */
.chatbot-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.chatbot-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    position: relative;
}
.chatbot-header-avatar::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #4f46e5;
}
.chatbot-header-info h3 {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}
.chatbot-header-info span {
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
}

/* Corpo do Chat */
.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Mensagens */
.chat-msg {
    display: flex;
    gap: 8px;
    max-width: 90%;
    animation: msgFade 0.3s ease;
}
@keyframes msgFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg.bot {
    align-self: flex-start;
}
.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.chat-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.chat-msg.bot .chat-msg-avatar {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}
.chat-msg.user .chat-msg-avatar {
    background: #e2e8f0;
    color: #64748b;
}
.chat-msg-content {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
}
.chat-msg.bot .chat-msg-content {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-msg-content {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Sugestões de FAQ */
.chat-sugestoes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.chat-sugestao-btn {
    padding: 6px 12px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #6366f1;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.chat-sugestao-btn:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

/* Categorias de FAQ */
.chat-categorias {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}
.chat-categoria-btn {
    padding: 10px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.78rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
}
.chat-categoria-btn:hover {
    background: #f0f0ff;
    border-color: #6366f1;
    color: #6366f1;
}
.chat-categoria-btn i {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: #6366f1;
}

/* Indicador de digitação */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #f1f5f9;
    border-radius: 16px;
    width: fit-content;
}
.chat-typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Badge FAQ */
.chat-badge-faq {
    display: inline-block;
    padding: 2px 8px;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.chat-badge-ia {
    display: inline-block;
    padding: 2px 8px;
    background: #ede9fe;
    color: #7c3aed;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Input do Chat */
.chatbot-input {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
}
.chatbot-input input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    outline: none;
}
.chatbot-input input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.chatbot-input button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}
.chatbot-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

/* Responsivo */
@media (max-width: 480px) {
    .chatbot-panel {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 80px;
        max-height: 65vh;
    }
    .chatbot-fab {
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
        font-size: 20px;
    }
}
