/* ========================================================= */
/* ESTILOS PARA O PANDAMIKE.IA                               */
/* ========================================================= */

body {
    font-family: Arial, sans-serif;
}

/* Janela do bot */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 420px;
    height: 550px;
    max-height: 80vh;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    visibility: hidden;
    transition: all 0.3s ease-out;
    z-index: 2004;
}

.chatbot-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

/* Cabeçalho do Chat */
.chat-header {
    background-color: #233f93;
    color: #ffffff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header h4 {
    font-size: 1.1rem;
    margin: 0;
}

.close-chat-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
}

/* Área das Mensagens */
.chat-messages {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bot-message-wrapper {
    display: flex;
    align-items: flex-start;
    max-width: 90%;
    transition: transform 0.5s ease-in-out;
}

.bot-avatar-wrapper {
    flex-shrink: 0;
    margin-right: 10px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.chat-messages .bot-message-wrapper:last-of-type .bot-avatar-wrapper {
    opacity: 1;
    transform: scale(1);
}

.bot-message-wrapper.shifted {
    transform: translateX(-50px);
}

.user-message-wrapper {
    display: flex;
    align-items: flex-start;
    max-width: 90%;
    align-self: flex-end;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFEE00;
    display: block;
}

.bot-message-content,
.user-message-content {
    position: relative;
    padding: 12px 18px;
    border-radius: 18px;
    word-wrap: break-word;
}

.bot-message-content {
    background-color: #f1f0f0;
    color: #333;
    border-top-left-radius: 4px;
}

.user-message-content {
    background-color: #233f93;
    color: #ffffff;
    border-top-right-radius: 4px;
}

.chat-action-btn {
    display: block;
    text-decoration: none;
    padding: 10px 15px;
    margin-top: 10px;
    background-color: #25d366;
    color: #ffffff;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    transition: opacity 0.2s;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
}

.chat-action-btn:hover {
    opacity: 0.9;
}

.typing-indicator .bot-message-content {
    padding: 15px 18px;
}

.typing-indicator .bot-avatar-wrapper {
    animation: pulse-avatar 1.5s infinite ease-in-out;
}

.dot-pulse {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot-pulse::before,
.dot-pulse::after,
.dot-pulse div {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #ccc;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

.dot-pulse::before {
    animation-delay: -0.32s;
}

.dot-pulse div {
    animation-delay: -0.16s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

@keyframes pulse-avatar {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

/* Área de Input */
.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background-color: #ffffff;
    flex-shrink: 0;
}

#chat-form {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex-grow: 1;
    border: 2px solid #ddd;
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #233f93;
}

#chat-form button {
    background-color: #233f93;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

#chat-form button:hover {
    background-color: #1c327a;
}

/* ======================================================== */
/* ESTILOS PARA OS BOTÕES FLUTUANTES (WhatsApp e Chatbot)   */
/* ======================================================== */
.fab-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    display: flex;
    gap: 15px;
    transition: transform 0.3s ease, opacity 0.2s ease, visibility 0.3s;
}

.fab-container.chat-is-open {
    transform: scale(0);
    opacity: 0;
    visibility: hidden;
}

.fab-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    animation: pulse-attention 2s infinite;
    padding: 0;
    /* CORREÇÃO: Removido padding que poderia interferir */
}

.fab-icon:hover {
    transform: scale(1.1);
    animation-play-state: paused;
}

.whatsapp-fab {
    background-color: #25D366;
}

.chat-fab {
    background-color: #0056b3;
}

/* CORREÇÃO PARA A IMAGEM DO PANDA */
.chat-fab img {
    width: 100%;
    /* A imagem ocupa toda a largura do botão */
    height: 100%;
    /* A imagem ocupa toda a altura do botão */
    object-fit: cover;
    /* Garante que a imagem cubra o espaço sem distorcer */
    border-radius: 50%;
    /* Mantém a forma circular */
}

@keyframes pulse-attention {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.3);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* Media Queries */
@media (max-width: 920px) {
    .chatbot-container {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }
}

#chat-messages>img {
    display: none !important;
}