:root {
    --primary-color: #78C236; /* Verde característico Herbalife */
    --primary-dark: #64A32D;
    --bg-color: #F0F2F5; /* Fondo suave tipo WhatsApp Web */
    --chat-bg: #E4EFE7;
    --msg-bot-bg: #FFFFFF;
    --msg-user-bg: #DCF8C6; /* Verde claro para respuestas del usuario */
    --text-main: #1C1E21;
    --text-muted: #65676B;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Contenedor del Chat */
.chat-container {
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background-color: var(--chat-bg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Sólo en vista de PC mostrar redondos y pareados como un teléfono */
@media(min-width: 450px) {
    .chat-container {
        height: 90vh;
        border-radius: 20px;
    }
}

/* Cabecera superior */
.chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.avatar-container {
    position: relative;
}

.avatar {
    width: 45px;
    height: 45px;
    background-color: white;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    background-color: #4CAF50;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
}

.header-info h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-info p {
    font-size: 0.8rem;
    opacity: 0.95;
    margin-top: 2px;
}

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

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-wrap;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-msg {
    align-self: flex-start;
    background-color: var(--msg-bot-bg);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.user-msg {
    align-self: flex-end;
    background-color: var(--msg-user-bg);
    color: var(--text-main);
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Indicador de que está escribiendo... */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background-color: var(--msg-bot-bg);
    border-radius: 15px;
    width: fit-content;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: none;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #90949C;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Área para escribir abajo */
.chat-input-area {
    background-color: white;
    padding: 12px 20px;
    border-top: 1px solid #ddd;
}

#chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

#user-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

#user-input:disabled {
     background-color: #f5f5f5;
}

#user-input:focus {
    border-color: var(--primary-color);
}

#send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

#send-btn:hover {
    background-color: var(--primary-dark);
}

#send-btn svg {
    width: 20px;
    height: 20px;
}

#send-btn:disabled {
   background-color: #ccc;
   cursor: not-allowed;
}

/* Botón de llamado a la acción (WhatsApp) */
.cta-button {
    display: inline-block;
    background-color: #25D366; /* Verde de WhatsApp */
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 10px;
    text-align: center;
    width: 100%;
}
.cta-button:hover {
    background-color: #1DA851;
}

/* Botones de Preguntas Frecuentes (FAQ) */
.faq-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: #E8F5E9;
    color: var(--text-main);
    border: 1px solid var(--primary-color);
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    font-family: inherit;
}
.faq-btn:hover {
    background: #C8E6C9;
}
.faq-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f0f0f0;
    border-color: #ccc;
    color: #888;
}
.faq-btn.primary-btn {
    background: var(--primary-color);
    color: white;
    text-align: center;
    border: none;
    font-weight: 600;
    margin-top: 15px;
}
.faq-btn.primary-btn:hover {
    background: var(--primary-dark);
}
