/*
 * Estilos do SmartFit Sales Assistant (Versão Corrigida)
 */

:root {
    --whatsapp-green: #25D366;
    --whatsapp-dark: #075E54;
    --whatsapp-light: #DCF8C6;
    --whatsapp-gray: #ECE5DD;
    --whatsapp-blue: #34B7F1;
    --whatsapp-icon: #128C7E;
    --text-dark: #333333;
    --text-light: #757575;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Estilos para o modo de página completa */
.sfsa-full-page-chat {
    background: linear-gradient(135deg, var(--whatsapp-dark) 0%, #128C7E 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Container do Chat */
.sfsa-chat-container {
    width: 100%;
    max-width: 500px;
    height: 90vh;
    background-color: var(--whatsapp-gray);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px var(--shadow);
    display: flex; /* Adicionado para layout flexível */
    flex-direction: column; /* Coloca os elementos em coluna */
}

/* Header */
.sfsa-chat-header {
    background-color: var(--whatsapp-dark);
    color: var(--white);
    padding: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    min-height: 60px; /* Garante altura mínima */
}

/* Messages Area */
.sfsa-chat-messages {
    flex-grow: 1; /* Ocupa todo o espaço restante */
    padding: 10px;
    overflow-y: auto;
    background-image: url('data:image/svg+xml;utf8,<svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="%23ECE5DD"/><path d="M 0 50 L 50 0 L 100 50 L 50 100 Z" fill-opacity="0.05" fill="%23075E54"/></svg>');
    /* Padrão de fundo simulando WhatsApp */
}

/* Message Bubble Wrapper (Para alinhamento) */
.sfsa-message-wrapper {
    display: flex;
    margin-bottom: 8px;
    max-width: 90%;
}

.sfsa-bot-wrapper {
    justify-content: flex-start;
}

.sfsa-user-wrapper {
    justify-content: flex-end;
    margin-left: auto;
}

/* Message Bubble */
.sfsa-message {
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 100%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 1px 2px var(--shadow);
    position: relative;
}

.sfsa-bot-message {
    background-color: var(--white);
    color: var(--text-dark);
    border-bottom-left-radius: 5px; /* Ponta do balão */
}

.sfsa-user-message {
    background-color: var(--whatsapp-light);
    color: var(--text-dark);
    border-bottom-right-radius: 5px; /* Ponta do balão */
}

/* Mídia e Produto */
.sfsa-media-message img,
.sfsa-media-message video,
.sfsa-media-message audio,
.sfsa-product-card img {
    border-radius: 6px;
    margin-bottom: 5px;
}

.sfsa-product-card {
    padding: 0;
    text-align: center;
    overflow: hidden;
}

.sfsa-product-card h3 {
    font-size: 16px;
    margin: 5px 0;
    color: var(--whatsapp-dark);
}

.sfsa-product-card p {
    font-size: 12px;
    margin: 0 0 5px 0;
    color: var(--text-light);
}

.sfsa-product-price {
    display: block;
    font-weight: bold;
    color: var(--whatsapp-icon);
    margin-bottom: 10px;
}

.sfsa-product-link {
    display: block;
    background-color: var(--whatsapp-green);
    color: var(--white);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 0 0 6px 6px;
    transition: background-color 0.3s;
}

/* Input Area */
.sfsa-chat-input-area {
    padding: 10px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

.sfsa-message-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    resize: none;
    max-height: 80px;
    overflow-y: auto;
    transition: all 0.2s;
}

.sfsa-message-input:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.sfsa-send-button {
    background-color: var(--whatsapp-green);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.sfsa-send-button:hover:not(:disabled) {
    background-color: #1da851;
}

.sfsa-send-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Opções de Botão (Nova Área) */
.sfsa-options-area {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #e0e0e0;
}

.sfsa-option-button, .sfsa-link-button {
    text-align: center;
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--whatsapp-dark);
    background-color: var(--white);
    color: var(--whatsapp-dark);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.sfsa-option-button:hover, .sfsa-link-button:hover {
    background-color: var(--whatsapp-dark);
    color: var(--white);
}

/* Typing Indicator */
.sfsa-typing-indicator {
    display: flex;
    align-self: flex-start;
    gap: 4px;
    padding: 8px 12px;
    background-color: var(--white);
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px var(--shadow);
}
/* Estilos para os pontos (dots) */
.sfsa-typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-light);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.sfsa-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}
.sfsa-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}