/* Estilos Isolados para o Chatbot Flutuante */

/* Botão Flutuante */
#chatbot-toggle-button-site {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #00ffcc; /* Verde fluorescente do site */
    color: #1a1f36; /* Azul escuro do site */
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chatbot-toggle-button-site:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 255, 204, 0.4);
}

#chatbot-toggle-button-site svg {
    width: 30px;
    height: 30px;
}

/* Container do Chat (Aplicar a classe .chatbot-section-site ao container principal) */
.chatbot-section-site {
    font-family: 'Poppins', sans-serif; /* Usar fonte do site */
    position: fixed;
    bottom: 100px; /* Acima do botão toggle */
    right: 25px;
    width: 96%;
    max-width: 540px;
    height: 80vh;
    max-height: 600px;
    background-color: #1f273e; /* Fundo azul escuro */
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
    border: 1px solid #2a324d;
    display: none; /* Começa oculto */
}

.chatbot-section-site.visible {
    display: flex; /* Mostrar quando visível */
    opacity: 1;
    top: 50% !important;
    left: 50% !important;
    bottom: auto !important;
    right: auto !important;
    transform: translate(-50%, -50%) scale(1) !important;
    z-index: 500 !important; /* Menor que o menu mobile */
}

/* Cabeçalho do Chat */
.chatbot-section-site .chat-header-site {
    background-color: #1a1f36; /* Azul mais escuro para header */
    color: #d1d9e6;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a324d;
}

.chatbot-section-site .chat-header-site h2 {
    margin: 0;
    font-size: 1.1em;
    color: #d1d9e6; 
    text-align: left; 
    font-weight: 600;
}

.chatbot-section-site #chatbot-close-button-site {
    background: none;
    border: none;
    color: #a9b3c1;
    font-size: 1.8em;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.3s ease;
}

.chatbot-section-site #chatbot-close-button-site:hover {
    color: #00ffcc;
}

/* Caixa de Mensagens */
.chatbot-section-site .chat-box-site {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #1f273e; /* Mesmo fundo do container */
    display: flex;
    flex-direction: column;
}

/* Scrollbar personalizada */
.chatbot-section-site .chat-box-site::-webkit-scrollbar {
    width: 6px;
}

.chatbot-section-site .chat-box-site::-webkit-scrollbar-track {
    background: #1a1f36;
    border-radius: 3px;
}

.chatbot-section-site .chat-box-site::-webkit-scrollbar-thumb {
    background-color: #2a324d;
    border-radius: 3px;
}

.chatbot-section-site .chat-box-site::-webkit-scrollbar-thumb:hover {
    background-color: #3a435a;
}

.chatbot-section-site .message-site {
    margin-bottom: 22px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 85%;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInMessageChat 0.5s ease forwards;
    font-size: 0.95rem; /* Ajuste tamanho da fonte */
}

@keyframes fadeInMessageChat {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-section-site .message-site.user {
    background-color: #00ffcc; /* Verde fluorescente para usuário */
    color: #1a1f36; /* Texto escuro */
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.chatbot-section-site .message-site.bot {
    background-color: #2a324d; /* Azul card para bot */
    color: #d1d9e6; /* Texto claro */
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.chatbot-section-site .message-site.typing {
    font-style: italic;
    color: #a9b3c1;
    background-color: transparent;
    padding: 5px 15px;
}

/* Input do Chat */
.chatbot-section-site .chat-input-site {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid #2a324d;
    background-color: #1a1f36; /* Fundo do input */
}

.chatbot-section-site #user-input-site {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #2a324d;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 0.95em;
    background-color: #1f273e; /* Fundo do campo */
    color: #d1d9e6;
    transition: border-color 0.3s ease;
}

.chatbot-section-site #user-input-site:focus {
    outline: none;
    border-color: #00ffcc;
}

.chatbot-section-site #send-button-site {
    padding: 10px 18px;
    background-color: #00ffcc; /* Verde fluorescente */
    color: #1a1f36; /* Texto escuro */
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.chatbot-section-site #send-button-site:hover {
    background-color: #00e6b8; /* Tom mais escuro */
    transform: scale(1.05);
}

/* === RESPONSIVIDADE MELHORADA DO CHATBOT === */

/* Tablets e telas médias */
@media (max-width: 768px) {
    .chatbot-section-site {
        bottom: 90px;
        right: 20px;
        left: 20px;
        width: calc(100% - 40px);
        max-width: none;
        max-height: 70vh;
        border-radius: 12px;
    }
    
    #chatbot-toggle-button-site {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    #chatbot-toggle-button-site svg {
        width: 28px;
        height: 28px;
    }
    
    .options-container-site {
        max-width: 95%;
    }
    
    .option-button-site {
        padding: 10px 16px;
        font-size: 0.95em;
        min-height: 44px; /* Touch target mínimo */
    }
}

/* Mobile - experiência quase full screen */
@media (max-width: 480px) {
    .chatbot-section-site {
        position: fixed;
        top: 80px; /* Altura do header */
        bottom: 80px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        height: calc(100vh - 160px);
        max-width: none;
        max-height: none;
        border-radius: 16px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    }
    
    #chatbot-toggle-button-site {
        bottom: 15px;
        right: 15px;
        width: 52px;
        height: 52px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    }
    
    #chatbot-toggle-button-site svg {
        width: 26px;
        height: 26px;
    }
    
    /* Header do chat maior */
    .chatbot-section-site .header-site {
        padding: 16px 20px;
        min-height: 60px;
    }
    
    .chatbot-section-site .header-site h2 {
        font-size: 1.2rem;
    }
    
    /* Área de mensagens com mais espaço */
    .chatbot-section-site .messages-area-site {
        padding: 16px;
        flex: 1;
    }
    
    /* Mensagens maiores para touch */
    .chatbot-section-site .message-site {
        padding: 12px 16px;
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 12px;
        max-width: 85%;
    }
    
    /* Input area mais acessível */
    .chatbot-section-site .input-area-site {
        padding: 16px;
        gap: 12px;
    }
    
    .chatbot-section-site .input-area-site input {
        padding: 14px 16px;
        font-size: 16px; /* Evita zoom no iOS */
        border-radius: 24px;
        min-height: 48px;
    }
    
    .chatbot-section-site .input-area-site button {
        padding: 12px 16px;
        min-width: 48px;
        min-height: 48px;
        border-radius: 24px;
    }
    
    /* Botões de opção maiores para touch */
    .options-container-site {
        margin: 12px 16px;
        max-width: calc(100% - 32px);
        gap: 10px;
    }
    
    .option-button-site {
        padding: 12px 18px;
        font-size: 15px;
        min-height: 48px;
        border-radius: 24px;
        touch-action: manipulation; /* Melhora responsividade touch */
    }
    
    /* Loading indicator melhor em mobile */
    .chatbot-section-site .typing-indicator-site {
        padding: 12px 16px;
        margin: 8px 16px;
    }
}

/* Mobile pequeno - ajustes para telas muito pequenas */
@media (max-width: 360px) {
    .chatbot-section-site {
        top: 70px;
        bottom: 70px;
        left: 5px;
        right: 5px;
        width: calc(100% - 10px);
        height: calc(100vh - 140px);
        border-radius: 12px;
    }
    
    #chatbot-toggle-button-site {
        width: 48px;
        height: 48px;
        bottom: 12px;
        right: 12px;
    }
    
    #chatbot-toggle-button-site svg {
        width: 24px;
        height: 24px;
    }
    
    .chatbot-section-site .header-site {
        padding: 12px 16px;
        min-height: 52px;
    }
    
    .chatbot-section-site .header-site h2 {
        font-size: 1.1rem;
    }
    
    .chatbot-section-site .messages-area-site {
        padding: 12px;
    }
    
    .chatbot-section-site .message-site {
        padding: 10px 14px;
        font-size: 14px;
        max-width: 90%;
    }
    
    .chatbot-section-site .input-area-site {
        padding: 12px;
    }
    
    .chatbot-section-site .input-area-site input {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .chatbot-section-site .input-area-site button {
        padding: 10px 12px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .options-container-site {
        margin: 10px 12px;
        max-width: calc(100% - 24px);
    }
    
    .option-button-site {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 44px;
    }
}

/* Landscape mobile - ajustes para modo paisagem */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    .chatbot-section-site {
        top: 60px;
        bottom: 60px;
        height: calc(100vh - 120px);
    }
    
    .chatbot-section-site .header-site {
        padding: 12px 16px;
        min-height: 48px;
    }
    
    .chatbot-section-site .header-site h2 {
        font-size: 1rem;
    }
    
    .chatbot-section-site .message-site {
        padding: 8px 12px;
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .chatbot-section-site .input-area-site {
        padding: 12px;
    }
    
    .options-container-site {
        margin: 8px 12px;
    }
    
    .option-button-site {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 40px;
    }
}

/* NOVO: Estilos para os Botões de Opção */
.chatbot-section-site .options-container-site {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Espaçamento entre os botões */
    align-self: flex-start; /* Alinha o container junto com as mensagens do bot */
    margin-top: 8px;
    margin-left: 10px;
    max-width: 90%;
}

.chatbot-section-site .option-button-site {
    background-color: #2a324d;
    color: #00ffcc;
    border: 1px solid #00ffcc;
    border-radius: 20px;
    padding: 8px 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.chatbot-section-site .option-button-site:hover {
    background-color: #00ffcc;
    color: #1a1f36;
}

.chatbot-section-site .option-button-site.disabled {
    background-color: #2a324d;
    color: #6a738b;
    border-color: #6a738b;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Correção para menu mobile na página do chatbot */
.chatbot-page-body .main-nav {
    z-index: 9999 !important;
}

.chatbot-page-body .mobile-menu-toggle {
    z-index: 10000 !important;
}