/* Estilos para o Widget de Chat Woubi */

/* Estilos Globais e Variáveis de Cor */
:root {
    --woubi-blue: #003ffc;
    --woubi-light-blue: #2962ff;
    --woubi-bg: #F9FAFB;
    --woubi-border: #E5E7EB;
    --woubi-text-primary: #1F2937;
    --woubi-text-secondary: #6B7280;
    --woubi-white: #FFFFFF;
}

#woubi-chat-container { 
    font-family: 'Nunito', sans-serif; 
    box-sizing: border-box; 
}

#woubi-chat-container *, 
#woubi-chat-container *::before, 
#woubi-chat-container *::after { 
    box-sizing: inherit; 
}

/* Botão Flutuante (Fechado) */
#woubi-chat-button {
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    z-index: 9998; 
    display: flex;
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--woubi-light-blue), var(--woubi-blue));
    color: var(--woubi-white); 
    border: none; 
    border-radius: 9999px; 
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-size: 16px; 
    font-weight: 700; 
    transition: all 0.3s ease-in-out;
}

#woubi-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#woubi-chat-button svg { 
    width: 24px; 
    height: 24px; 
}

/* Janela do Chat (Aberto) */
#woubi-chat-window {
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    z-index: 9999;
    width: 380px; 
    max-width: calc(100vw - 40px); 
    height: 600px; 
    max-height: calc(100vh - 40px);
    background: var(--woubi-white); 
    border-radius: 20px; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    transform-origin: bottom right;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

#woubi-chat-window.hidden, 
#woubi-chat-button.hidden {
    transform: scale(0.95); 
    opacity: 0; 
    pointer-events: none; 
    visibility: hidden;
}

/* Cabeçalho do Chat */
.chat-header {
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 16px 20px;
    background-color: var(--woubi-white); 
    border-bottom: 1px solid var(--woubi-border); 
    flex-shrink: 0;
}

.chat-header h3 { 
    margin: 0; 
    font-size: 20px; 
    font-weight: 700; 
    color: var(--woubi-text-primary); 
}

#close-chat-button { 
    background: none; 
    border: none; 
    cursor: pointer; 
    color: var(--woubi-text-secondary); 
    font-size: 24px; 
    padding: 5px; 
    line-height: 1; 
}

/* Área de Mensagens */
#chat-messages { 
    flex-grow: 1; 
    padding: 20px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

.message { 
    max-width: 80%; 
    padding: 12px 16px; 
    border-radius: 18px; 
    word-wrap: break-word; 
    line-height: 1.5; 
}

.ai-message { 
    background: var(--woubi-bg); 
    color: var(--woubi-text-primary); 
    align-self: flex-start; 
    border-top-left-radius: 4px; 
}

.user-message { 
    background: var(--woubi-blue); 
    color: var(--woubi-white); 
    align-self: flex-end; 
    border-top-right-radius: 4px; 
}

.typing-indicator { 
    align-self: flex-start; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    padding: 12px 16px; 
}

.typing-indicator span { 
    width: 8px; 
    height: 8px; 
    background-color: var(--woubi-text-secondary); 
    border-radius: 50%; 
    animation: bounce 1.4s infinite ease-in-out both; 
}
.typing-indicator span:nth-child(2) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(3) { animation-delay: -0.16s; }

@keyframes bounce { 
    0%, 80%, 100% { transform: scale(0); } 
    40% { transform: scale(1.0); } 
}

/* Área de Input */
.chat-input-area { 
    display: flex; 
    align-items: center; 
    padding: 10px 20px; 
    border-top: 1px solid var(--woubi-border); 
}

#user-input { 
    flex-grow: 1; 
    border: none; 
    background: transparent; 
    padding: 10px; 
    font-size: 16px; 
    color: var(--woubi-text-primary); 
    resize: none; 
    max-height: 100px; 
}

#user-input:focus { 
    outline: none; 
}

#send-message-button { 
    background: var(--woubi-blue); 
    border: none; 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    transition: background-color 0.2s; 
}

#send-message-button:hover { 
    background: var(--woubi-light-blue); 
}

#send-message-button svg { 
    width: 20px; 
    height: 20px; 
    color: var(--woubi-white); 
}

/* Rodapé */
.chat-footer { 
    padding: 10px; 
    text-align: center; 
    font-size: 12px; 
    color: var(--woubi-text-secondary); 
    background-color: var(--woubi-bg); 
}
