/* chat.css */

/* Estilos generales */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f5e1; /* Fondo claro verde */
    overflow-y: auto;
}
* {
    box-sizing: border-box;
}

/* Encabezado */
header {
    padding: 0;
    text-align: center;
    height: 85px; /* Aumentamos la altura a 85px */
    display: flex;
    align-items: center;
    justify-content: center;
}
header img {
    max-width: 350px;
    height: auto; /* Mantiene la proporción de la imagen */
}
hr {
    border-top: 1px solid #a3d197; /* Verde suave */
    margin: 0;
}

/* Contenedor del chat */
.chat-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 70vh; /* Altura fija */
    padding: 10px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    margin: 10px auto 30px auto; /* Agregamos margen inferior */
    max-width: 800px;
}

/* Ventana del chat */
#chatWindow {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #eef7e5; /* Fondo verde claro */
    overflow-y: auto; /* Permitimos el scroll interno */
    border-radius: 10px;
    margin-bottom: 5px;
    resize: none; /* Evitamos el cambio de tamaño manual */
    height: calc(100% - 50px); /* Ajustamos la altura disponible */
}

/* Contenedor de entrada */
.input-container {
    display: flex;
    align-items: center;
}

textarea {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #a3d197; /* Verde suave */
    border-radius: 5px;
    font-size: 16px;
    margin-right: 10px;
    height: auto;
    min-height: 30px;
    max-height: 100px;
    resize: none;
    overflow-y: hidden;
}

button {
    background-color: #9ccd7f; /* Verde */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

button.disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

button:hover:not(.disabled) {
    background-color: #8db46f; /* Verde más oscuro */
}

/* Mensajes */
.message {
    margin-bottom: 5px;
    font-size: 16px;
    word-break: break-word;
    text-align: left;
    color: #6f8053; /* Verde grisáceo */
    line-height: 1.2;
}

.disclaimer {
    font-size: 12px;
}

.message.user {
    text-align: right;
    color: #508944; /* Verde más fuerte */
}

.message.bot {
    text-align: left;
    color: #6f8053; /* Verde grisáceo */
}

.error-message {
    color: red;
    font-weight: bold;
}

.info-message {
    color: #6f8053; /* Verde grisáceo */
    font-weight: bold;
}

/* Estilos para el mensaje predeterminado */
.message.bot p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.message.bot ul, .message.bot ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.message.bot li {
    margin-bottom: 5px;
}

.message.bot strong {
    font-weight: bold;
    color: #333;
}

.message.bot em {
    font-style: italic;
    color: #555;
}

/* Formulario de información personal */
.personal-info-form {
    max-width: 800px;
    margin: 20px auto;
}

.personal-info-form details {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0;
    height: auto;
    overflow: hidden;
}

.personal-info-form summary {
    cursor: pointer;
    padding: 10px 20px;
    background-color: #9ccd7f; /* Verde */
    color: white;
    border-radius: 10px 10px 0 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

.personal-info-form summary::after {
    content: '▼';
    font-size: 18px;
    transition: transform 0.3s;
}

.personal-info-form details[open] summary::after {
    transform: rotate(180deg);
}

.personal-info-form form {
    margin-top: 0;
    padding: 15px 20px 20px 20px;
}

.personal-info-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.personal-info-form input,
.personal-info-form select {
    margin-bottom: 15px;
    padding: 10px;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.personal-info-form button {
    width: auto;
    padding: 10px 20px;
    margin: 20px auto 0 auto;
    display: block;
    background-color: #9ccd7f; /* Verde */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.personal-info-form button:hover {
    background-color: #8db46f; /* Verde más oscuro */
}

/* Enlace "Darse de baja" */
.unsubscribe-link {
    text-align: center;
    margin-top: 5px;
}

.unsubscribe-link a {
    font-size: 12px;
    color: #cccccc;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
}

.unsubscribe-link a:hover {
    color: #333333;
    cursor: pointer;
}

/* Mensaje de límite */
.limit-message-container {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.limit-message-container p {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.limit-message-container button {
    background-color: #9ccd7f; /* Verde */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.limit-message-container button:hover {
    background-color: #8db46f; /* Verde más oscuro */
}

/* Ajuste para pantallas móviles */
@media (max-width: 768px) {
    header {
        height: 50px;
    }
    header img {
        max-width: 150px;
        height: auto; /* Mantiene la proporción de la imagen */
    }

    .main-container {
        max-width: 95vw;
        margin: 0 auto;
    }

    .personal-info-form {
        max-width: 95vw;
        margin: 10px auto;
    }

    .chat-container {
        max-width: 95vw;
        margin: 10px auto 30px auto; /* Aseguramos margen inferior */
        max-height: none; /* Permitimos que crezca en móvil */
    }

    #chatWindow {
        height: calc(100% - 50px); /* Ajustamos la altura disponible */
    }

    .personal-info-form summary {
        font-size: 16px;
        border-radius: 10px;
        margin: 0;
    }

    .personal-info-form button {
        font-size: 14px;
        padding: 8px 15px;
    }

    textarea {
        font-size: 14px;
    }

    button {
        font-size: 14px;
        padding: 8px 15px;
    }

    /* Eliminamos el borde y la sombra al abrir el desplegable */
    .personal-info-form details[open] {
        background-color: transparent;
        border: none;
        box-shadow: none;
    }

    .personal-info-form details {
        border: none;
        box-shadow: none;
    }

    .personal-info-form form {
        padding: 10px 0;
    }
}
