/* bot-widget-integrado.css - Versão 2.0 - Layout QConcursos */

/* Variáveis de cor para fácil manutenção */
:root {
    --main-color: #2d5a4a; /* Cor principal (verde escuro) */
    --accent-color: #f4b942; /* Cor de destaque (laranja/amarelo) */
    --bot-bubble-bg: #ffffff; /* Fundo da bolha do bot */
    --user-bubble-bg: var(--main-color); /* Fundo da bolha do usuário */
    --qconcursos-border: #e6a635; /* Cor da borda/texto do botão de referência */
    --qconcursos-bg: #ffffff; /* Fundo do botão de referência */
}

/* Botão Flutuante do Chat */
#bot-widget {
    position: fixed;
    bottom: 95px;
    right: 45px;
    z-index: 1000;
    font-family: 'Open Sans', sans-serif;
}
#chat-icon {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--main-color), #4a7c59);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(45, 90, 74, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}
#chat-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(45, 90, 74, 0.5);
}
#chat-icon::before {
    content: "💬";
    font-size: 26px;
    color: white;
}
/* Efeito pulse no botão do chat */
#chat-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(45, 90, 74, 0.3);
    transform: translate(-50%, -50%) scale(1);
    animation: pulse 2.5s infinite ease-in-out;
    z-index: -1;
}
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    70% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Container Principal do Chat */
#chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: 95%;
    height: 550px;
    max-height: 85vh;
    display: none;
    flex-direction: column;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    border: 1px solid rgba(45, 90, 74, 0.1);
}

/* Cabeçalho do Chat */
.chat-header {
    background: linear-gradient(135deg, var(--main-color), #4a7c59);
    color: white;
    padding: 20px;
    text-align: center;
    font-weight: bold;
    position: relative;
    font-family: 'Montserrat', sans-serif;
}
.chat-header::after {
    content: "⚖️ Laura Assistente Virtual";
    font-size: 14px;
    font-weight: normal;
    display: block;
    margin-top: 5px;
    font-family: 'Open Sans', sans-serif;
    opacity: 0.9;
}
.close-chat {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}
.close-chat:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Área de Mensagens */
#chat-messages {
    height: 420px;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    gap: 15px;
}
#chat-messages::-webkit-scrollbar {
    width: 6px;
}
#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(45, 90, 74, 0.3);
    border-radius: 3px;
}
#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 90, 74, 0.5);
}

/* Estilo da Bolha de Mensagem */
.chat-message {
    padding: 12px 16px;
    max-width: 85%;
    word-wrap: break-word;
    animation: fadeIn 0.4s ease;
    font-family: 'Open Sans', sans-serif;
    line-height: 1.5;
    /* Novo: remove o border-radius padrão para usar os específicos */
    border-radius: 0; 
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mensagem do Bot (Laura) - Esquerda */
.chat-message.bot {
    background: var(--bot-bubble-bg);
    color: var(--main-color);
    align-self: flex-start;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    /* Novo: Estilo de bolha mais arredondado, com ponta à esquerda */
    border-radius: 20px 20px 20px 5px; 
}

/* Mensagem do Usuário - Direita (Resposta) */
.chat-message.user {
    background: var(--user-bubble-bg);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    box-shadow: 0 4px 12px rgba(45, 90, 74, 0.3);
    /* Novo: Estilo de bolha mais arredondado, com ponta à direita */
    border-radius: 20px 20px 5px 20px; 
}

/* Container das Opções (Botões) - Novo Layout QConcursos */
.chat-options {
    /* Novo: Usa flexbox para envolver e alinhar à direita */
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end; /* Alinha os botões à direita */
    gap: 10px;
    margin-top: 15px;
    /* Adiciona padding para separar os botões da bolha da mensagem */
    padding: 0 5px; 
}

/* Estilo do Botão de Opção - Novo Layout QConcursos */
.chat-option-btn {
    /* Novo: Estilo QConcursos */
    background: var(--qconcursos-bg);
    color: var(--qconcursos-border);
    border: 1px solid var(--qconcursos-border); /* Borda fina */
    padding: 10px 18px;
    border-radius: 30px; /* Mais arredondado */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05); /* Sombra mais sutil */
    
    /* Novo: Propriedades para o alinhamento escalonado */
    align-self: flex-end; /* Alinha cada botão individualmente à direita */
    max-width: 100%; /* Garante que o botão não ultrapasse o container */
    white-space: normal; /* Permite que o texto quebre linha */
    text-align: center;
}

.chat-option-btn:hover {
    /* Mantém as cores originais do hover do site do cliente */
    background: linear-gradient(135deg, var(--accent-color), #e6a635);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 185, 66, 0.4);
    border-color: var(--accent-color);
}

/* Botão de WhatsApp */
.whatsapp-btn {
    background: linear-gradient(135deg, #25d366, #128c7e) !important;
    color: white !important;
    text-decoration: none;
    display: inline-block;
    padding: 15px 25px;
    border-radius: 30px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 15px;
    font-family: 'Open Sans', sans-serif;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
.whatsapp-btn:hover {
    background: linear-gradient(135deg, #128c7e, #0d7377) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Área de Input */
.chat-input-container {
    padding: 20px;
    background: rgba(248, 249, 250, 0.9);
    border-top: 1px solid rgba(233, 236, 239, 0.7);
    display: flex;
    gap: 12px;
    align-items: center;
}
#chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    min-width: 0;
    font-family: 'Open Sans', sans-serif;
    background: white;
    transition: all 0.3s ease;
}
#chat-input:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 4px rgba(45, 90, 74, 0.15);
}
#send-btn {
    background: linear-gradient(135deg, var(--accent-color), #e6a635);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(244, 185, 66, 0.4);
}
#send-btn:hover {
    background: linear-gradient(135deg, #e6a635, #d4941f);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(244, 185, 66, 0.5);
}

/* Indicador de Digitação */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: var(--bot-bubble-bg);
    color: var(--main-color);
    border-radius: 20px 20px 20px 5px; /* Novo: Estilo de bolha do bot */
    padding: 15px 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    width: fit-content;
}
.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 3px;
    background-color: var(--main-color);
    border-radius: 50%;
    opacity: 0.4;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Media Queries para Responsividade */
@media (max-width: 768px) {
    #bot-widget {
        bottom: 20px;
        right: 20px;
    }
    #chat-container {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 15px;
        right: 15px;
        left: 15px;
        margin: auto;
        max-width: 400px;
        max-height: 600px;
    }
    #chat-messages {
        height: calc(100% - 140px);
        padding: 15px;
    }
    #chat-icon {
        width: 60px;
        height: 60px;
    }
    #chat-icon::before {
        font-size: 24px;
    }
    .chat-message {
        max-width: 90%;
        padding: 10px 14px;
        font-size: 14px;
    }
    .chat-option-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    .whatsapp-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    .chat-input-container {
        padding: 15px;
        gap: 10px;
    }
    #chat-input {
        padding: 10px 15px;
        font-size: 13px;
    }
    #send-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
}
@media (max-width: 480px) {
    #bot-widget {
        bottom: 45px;
        right: 30px;
    }
    #chat-icon {
        width: 55px;
        height: 55px;
    }
    #chat-icon::before {
        font-size: 22px;
    }
    .chat-header {
        padding: 15px;
        font-size: 14px;
    }
    .chat-header::after {
        font-size: 12px;
    }
    #chat-messages {
        padding: 12px;
    }
    .chat-message {
        max-width: 92%;
        padding: 8px 12px;
        font-size: 13px;
    }
    .chat-option-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    .whatsapp-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}
