/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* --- General Body Styles --- */
body {
    font-family: 'Inter', sans-serif;
    background: #e9eff5; /* Un fondo gris azulado muy suave */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    color: #333;
}

/* --- Main Chat Container --- */
#chat-container {
    width: 100%;
    max-width: 700px;
    height: 90vh; /* Un poco más alto */
    max-height: 800px;
    background-color: #ffffff;
    border-radius: 20px; /* Bordes más redondeados */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dfe6ed;
}

/* --- Header Section --- */
.header {
    background: linear-gradient(135deg, #007BFF, #0056b3); /* Gradiente sutil */
    color: white;
    padding: 20px 25px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px; /* Espacio entre el ícono y el texto */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
}
.header::before {
    content: '💈'; /* Emoji como "avatar" */
    font-size: 2.5em;
    line-height: 1;
}
.header-text h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}
.header-text p {
    margin: 2px 0 0;
    font-size: 0.85em;
    opacity: 0.9;
}

/* --- Chat Messages Box --- */
#chat-box {
    flex-grow: 1;
    padding: 30px 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #f9fafb; /* Color de fondo ligeramente distinto */
}

/* --- Message Bubbles --- */
.user-message, .bot-message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 22px;
    line-height: 1.5;
    opacity: 0; /* Para animación de entrada */
    transform: translateY(10px);
    animation: fadeIn 0.3s forwards;
}
.user-message p, .bot-message p {
    margin: 0;
    white-space: pre-wrap; /* Respeta saltos de línea y espacios */
}

.user-message {
    background-color: #007BFF;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px; /* Detalle de estilo "cola" */
}

.bot-message {
    background-color: #E5E7EB; /* Un gris más claro y moderno */
    color: #1F2937;
    align-self: flex-start;
    border-bottom-left-radius: 6px; /* Detalle de estilo "cola" */
}
.bot-message.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* --- Input Form Section --- */
#chat-form {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    border-top: 1px solid #dfe6ed;
    background-color: #ffffff;
}

#user-input {
    flex-grow: 1;
    padding: 14px 20px;
    border: 1px solid #ccc;
    border-radius: 25px;
    margin-right: 15px;
    font-size: 1rem;
    background-color: #f9fafb;
    transition: all 0.2s ease-in-out;
}
#user-input:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

#chat-form button {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 50%; /* Botón completamente redondo */
    cursor: pointer;
    font-size: 1.5em; /* Aumenta el tamaño del ícono */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s, transform 0.1s;
}
#chat-form button:hover {
    background-color: #0056b3;
}
#chat-form button:active {
    transform: scale(0.95);
}
/* Usaremos un SVG como ícono de enviar para mayor calidad */
#chat-form button::before {
    content: '➤';
    font-size: 0.7em;
    transform: translateX(1px);
}

/* --- Scrollbar Styling (Opcional, pero mejora el aspecto) --- */
#chat-box::-webkit-scrollbar {
    width: 8px;
}
#chat-box::-webkit-scrollbar-track {
    background: transparent;
}
#chat-box::-webkit-scrollbar-thumb {
    background-color: #cdd2d8;
    border-radius: 20px;
    border: 2px solid #f9fafb;
}

/* --- Animation for message appearance --- */
@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}