/* style.css */
:root {
    --primary-blue: #0d6efd; /* Azul de Nexa */
    --background-light: #ffffff;
    --background-grey: #f0f2f5;
    --text-dark: #1a1a1a;
    --text-light: #ffffff;
    --font-family: 'Space Grotesk', sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--background-grey);
}

.page-content {
    padding: 40px;
    color: var(--text-dark);
}

/* --- Botón para abrir el Chat --- */
#chat-open-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-blue);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 999;
}

#chat-open-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* --- Contenedor del Chat Popup --- */
#chat-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 370px;
    height: 60vh;
    max-height: 500px;
    background-color: var(--background-light);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
    transform-origin: bottom right;
    z-index: 1000;
}

#chat-container.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

/* --- Cabecera --- */
#header {
    background-color: var(--primary-blue);
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}
#header h2 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
}
#chat-close-button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
}

/* --- Mensajes --- */
#chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
}
.user-message {
    background-color: var(--primary-blue);
    color: var(--text-light);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.gemini-message {
    background-color: var(--background-grey);
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.error-message {
    background-color: #ff4d4f;
    color: white;
    align-self: center;
    text-align: center;
    font-weight: bold;
}

/* --- Área de Input --- */
#chat-input-area {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
}
#pdf-upload {
    width: 32px; /* Oculta el texto del input */
    cursor: pointer;
}
#user-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    margin: 0 10px;
    font-size: 1em;
    font-family: var(--font-family);
}
#user-input:disabled {
    background-color: #f1f1f1;
}
#send-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
#send-button:disabled {
    color: #a0c7ff;
    cursor: not-allowed;
}
