/* Importación de fuente */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600&display=swap');

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background: transparent !important;
}

    text-align: center;
    color: #333;
}
header {
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #140F38 !important;
}

header p {
    font-size: 1.2rem;
    color: #444;
}

/* Chat Icon */
.chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #140F38;
    border-radius: 50%;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

.chat-icon img {
    width: 50%;
    height: 50%;
    filter: invert(1);
}

.chat-icon:hover {
    transform: scale(1.1);
}

/* Chatbox */
.chatbox {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbox.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Chatbox Header */
.chat-header {
    background-color: #140F38 !important;
    color: white;
    padding: 10px 15px;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px 12px 0 0;
}

.chat-header h2 {
    font-size: 1rem;
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.chat-header img.chat-logo {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease-in-out;
}

.close-btn:hover {
    transform: scale(1.1);
}

/* Mensajes */
/* Mejora del interlineado y espaciado */
.messages {
    max-height: 280px;
    overflow-y: auto;
    padding: 15px;
    background-color: #F0F0FF;
    border-bottom: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Espaciado uniforme entre mensajes */
}

/* Ajuste del interlineado en los mensajes */
.messages p {
    margin: 8px 0; /* Mayor espacio entre párrafos */
    line-height: 1.5; /* Mejora la legibilidad */
}

/* Ajuste en los mensajes de usuario */
.user-message, .bot-message {
    padding: 10px;
    border-radius: 8px;
    font-size: 1rem; /* Ajuste de tamaño */
    max-width: 80%;
    word-wrap: break-word;
}

/* Espaciado uniforme para mensajes de usuario */
.user-message {
    align-self: flex-start;
    background: #1C1450;
    color: white;
    text-align: left;
    margin-bottom: 10px;
}

/* Espaciado uniforme para mensajes del bot */
/* Estilo para los mensajes del bot */
/* Ajuste en los mensajes del chatbot */
.bot-message {
    background: #FFFFFF !important; /* Fondo blanco */
    color: #000000 !important; /* Texto negro */
    padding: 10px; /* Más espacio interno */
    border-radius: 8px;
    max-width: 80%;
    text-align: left; /* Mantener alineado a la izquierda */
    word-wrap: break-word;
    font-size: 1rem;
    border: 1px solid #CCC;
    line-height: 1.0; /* Mayor interlineado */
}


/* Input */
input#userInput {
    width: calc(100% - 20px);
    height: 35px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px;
    margin: 10px;
    font-family: 'Encode Sans', sans-serif;
    font-size: 0.9rem;
}

input#userInput:disabled {
    background: #E0E0E0;
    color: #888;
}

/* Botones */
.option-btn {
    background-color: #140F38 !important;
    color: white;
    font-size: 0.85rem;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: block;
    width: 80%;
    margin: 6px auto;
    text-align: center;
}

.option-btn:hover {
    background-color: #1C1450;
}

/* Botón de reinicio */
.reset-btn {
    background-color: #E6E6FA;
    color: #333;
    font-size: 0.85rem;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: block;
    width: 80%;
    margin: 8px auto;
    text-align: center;
}

.reset-btn:hover {
    background-color: #D0D0F0;
}

/* Botón de enviar */
.send-btn {
    background-color: #140F38 !important;
    color: white;
    padding: 10px;
    border: none;
    width: calc(100% - 20px);
    margin: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.send-btn:hover {
    background-color: #1C1450;
}

.bot-message {
    white-space: pre-line; /* Permite saltos de línea y respeta formato */
}

/* Si los asteriscos no desaparecen, intenta esto */
.bot-message::before,
.bot-message::after {
    content: "";
}

.bot-message strong {
    display: inline; /* Asegurar que no haga salto de línea */
}

/* Cursos */
.curso-lista {
    text-align: left;
    background: #A9A3D2;
    padding: 8px;
    border-radius: 6px;
    margin: 8px 0;
    font-size: 0.9rem;
}

.curso-lista a {
    color: #140F38;
    font-weight: 600;
    text-decoration: none;
}

.curso-lista a:hover {
    text-decoration: underline;
}

/* 📱 Ajustes para móviles */
@media screen and (max-width: 768px) {
    .chatbox {
        width: 90%;
        bottom: 70px;
        right: 5%;
        border-radius: 15px;
    }

    .messages {
        max-height: 45vh;
        overflow-y: auto;
        font-size: 0.9rem;
        padding: 10px;
    }

    input#userInput {
        width: calc(100% - 20px);
        height: 35px;
        font-size: 0.9rem;
    }

    .send-btn, .reset-btn {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px;
    }
}

/* Ajuste de enlaces */
.bot-message a {
    color: #140F38;
    text-decoration: underline;
}

.bot-message a:hover {
    color: #1C1450;
}
