/* ============================ */
/* WRAPPER PRINCIPAL */
/* ============================ */
#chat-wrapper {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* ============================ */
/* HEADER */
/* ============================ */
.chat-header {
    background: #4E5DFF;
    color: white;
    padding: 18px 22px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

/* ============================ */
/* MENSAGENS */
/* ============================ */
.chat-messages {
    height: 500px;
    background: #f8f9ff;
    overflow-y: auto;
    padding: 20px;
}

/* BOLHAS */
.chat-bubble-user {
    background: #4E5DFF;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin: 10px 0;
    margin-left: auto;
    max-width: 80%;
    animation: bubbleIn .25s ease-in;
}

.chat-bubble-bot {
    background: #e8e8e8;
    color: #333;
    padding: 12px 16px;
    border-radius: 12px;
    margin: 10px 0;
    margin-right: auto;
    max-width: 80%;
    animation: bubbleIn .25s ease-in;
}

@keyframes bubbleIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ============================ */
/* INDICADOR DIGITANDO */
/* ============================ */
.typing-indicator {
    padding: 10px 20px;
    display: none;
    gap: 6px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #4E5DFF;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: .15s; }
.typing-indicator span:nth-child(3) { animation-delay: .30s; }

@keyframes typing {
    0%, 80%, 100% { opacity: .3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}

/* ============================ */
/* ÁREA INPUT */
/* ============================ */
.chat-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #ddd;
    background: white;
}

#chat-input {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-size: 17px;
}

/* BOTÃO DESKTOP */
#chat-send.desktop-only {
    margin-left: 8px;
    border-radius: 12px;
    padding: 12px 24px;
    background: #4E5DFF;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
}

/* BOTÃO MOBILE (oculto por padrão) */
#chat-send-mobile.mobile-only {
    display: none;
}

/* ============================ */
/* RESPONSIVO */
/* ============================ */
@media (max-width: 576px) {

    #chat-wrapper {
        border-radius: 0 !important;
    }

    .chat-messages {
        height: 420px;
    }

    /* botão desktop some */
    #chat-send.desktop-only {
        display: none !important;
    }

    /* botão redondo aparece */
    #chat-send-mobile.mobile-only {
        display: flex !important;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: #4E5DFF;
        color: white;
        border: none;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        font-weight: bold;
        margin-left: 10px;
    }
}
