/* Contenido del archivo style.css */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-image: url('../img/Fondo_sistemas.jpg');    
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

@keyframes slideInFromBottom {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.chat-container {
    width: 1000px;
    max-width: 95%;
    height: 100vh;
    background-image: url('../img/ghe.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 20px 5px rgba(0, 178, 255, 0.7);
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(100%);
}

.chat-container.is-visible {
    animation: slideInFromBottom 0.8s ease-out forwards;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    height: 0;
}

.user-message, .bot-message {
    padding: 8px 12px;
    border-radius: 15px;
    margin-bottom: 10px;
    max-width: 70%;
    line-height: 1.4;
}

.user-message {
    align-self: flex-end;
    background-color: #dcf8c6;
}

.bot-message {
    align-self: flex-start;
    background-color: #e5e5ea;
    white-space: pre-wrap;
}

/* --- Estilo para los links dentro del bot --- */
.bot-message .message-content a {
    color: #0056b3; /* Un azul más oscuro que resalta */
    text-decoration: underline;
    font-weight: 600; /* Un poco más grueso */
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background-color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

#messageInput {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
}

#sendBtn {
    margin-left: 10px;
    padding: 10px 15px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 20px;
    cursor: pointer;
}

@media (min-width: 768px) and (max-width: 1024px) {
    body{
        height: 100vh;
    }
    .chat-container {
        width: 95%;
        height: 95%;
        border-radius: 10px;
    }
}

@media (max-width: 768px) {
    body{
        height: 100vh;
    }
    .chat-container {
        width: 95%;
        height: 95%;
        border-radius: 10px;
    }
}

.typing-indicator {
    padding: 12px 15px;
    width: fit-content; /* La burbuja se ajusta al tamaño de los puntos */
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #8e8e93; /* Color de los puntos */
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: blink 1.4s infinite both; /* Aplica la animación */
}

/* Retraso en la animación para cada punto */
.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}
.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Define la animación "blink" */
@keyframes blink {
    0% {
        opacity: 0.2;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0.2;
    }
}

/* 1. Contenedor para el texto (párrafo) dentro de la burbuja */
.message-content {
    white-space: pre-wrap; /* Aquí es donde van los saltos de línea */
    margin: 0;
    padding: 0;
    word-wrap: break-word; /* Asegura que el texto no se salga */
}

/* 2. Clase para el texto (párrafo) CUANDO está cortado */
.message-content.truncated {
    max-height: 200px; /* Altura máxima (puedes ajustar este valor) */
    overflow: hidden;
    position: relative;
    /* Efecto opcional para que el corte no sea tan brusco */
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

/* 3. Clase para el texto (párrafo) CUANDO está expandido */
.message-content.expanded {
    max-height: none; /* Sin límite de altura */
    -webkit-mask-image: none;
    mask-image: none;
}

/* 4. Estilo del botón "Leer más..." */
.read-more-btn {
    display: block;
    text-align: right;
    padding-top: 5px;
    font-weight: bold;
    color: #007bff; /* Azul similar al de tu botón de enviar */
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9em;
    background-color: transparent;
    border: none;
    width: 100%; /* Ocupa el ancho para alinear el texto a la derecha */
}

.bot-message .message-content a[href*="wa.me"] {
    color: #075e54; /* Color verde de WhatsApp */
    font-weight: bold;
    text-decoration: underline;
}

/* --- Estilo para los links de Email --- */
.bot-message .message-content a[href*="mailto:"] {
    color: #c71610; /* Un color rojo/naranja */
    font-weight: bold;
    text-decoration: underline;
}