/* ============================= */
/* RESET BÁSICO */
/* ============================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", sans-serif;
}

/* ============================= */
/* VARIABLES DE COLOR */
/* ============================= */

:root {
    --primary-blue: #0b4fa3;
    --primary-blue-dark: #083b7a;
    --accent-red: #d62828;
    --white: #ffffff;
    --light-gray: #f2f2f2;
}

/* ============================= */
/* CONTENEDOR GENERAL */
/* ============================= */

.chat {
    width: 100%;
    height: 100vh;
    position: relative;
    background: var(--primary-blue);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================= */
/* OVERLAY AZUL (para imagen futura) */
/* ============================= */

.chat::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(11, 79, 163, 0.95) 0%,
        rgba(8, 59, 122, 0.95) 100%
    );
    z-index: 1;
}

/* ============================= */
/* HEADER */
/* ============================= */

.chat__header {
    position: relative;
    z-index: 2;
    padding-top: 20px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.chat__logo {
    width: 420px;
    max-width: 60%;
}
.chat__subtitle{
    color:#fff;
}

/* ============================= */
/* PANTALLA INICIAL */
/* ============================= */

.chat__intro {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================= */
/* INPUT GROUP */
/* ============================= */

.chat__input-group {
    width: 90%;
    max-width: 750px;
    background: var(--white);
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 8px 10px 8px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.chat__input-group:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

/* ============================= */
/* INPUT */
/* ============================= */

.chat__input {
    flex: 1;
    border: none !important;
    outline: none;
    font-size: 18px;
    color: #333;
    background: transparent;
}

.chat__input::placeholder {
    color: #8a8a8a;
    font-weight: 400;
}

/* Estado bloqueado del input */
.chat__input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Grupo bloqueado */
.chat__input-group--disabled {
    opacity: 0.7;
    pointer-events: none;
}

/* ============================= */
/* BOTÓN */
/* ============================= */

.chat__button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

/* Flecha */
.chat__button::after {
    content: "↑";
    color: var(--white);
    font-size: 18px;
    font-weight: bold;
}

.chat__button:hover {
    background: var(--accent-red);
    transform: scale(1.05);
}
/* ============================= */
/* ESTADO DESHABILITADO */
/* ============================= */

.chat__button:disabled {
    background: rgba(11, 79, 163, 0.4); /* azul opaco */
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Evitar hover cuando esté deshabilitado */
.chat__button:disabled:hover {
    background: rgba(11, 79, 163, 0.4);
    transform: none;
}

/* ============================= */
/* ESTADO OCULTO (para transición) */
/* ============================= */

.chat__body {
    display: none;
}

/* ============================= */
/* ANIMACIÓN DESVANECER */
/* ============================= */

.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s ease;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}




/* ============================= */
/* BODY DEL CHAT (CUADRO BLANCO) */
/* ============================= */

.chat__body {
    position: relative;
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
}

/* Caja blanca */
.chat__window {
    width: 100%;
    max-width: 900px;
    height: 65vh;
    background: #f4f4f4;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* Contenedor de mensajes */
.chat__messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================= */
/* BURBUJAS */
/* ============================= */

.chat__message {
    max-width: 65%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
}

/* Usuario (derecha) */
.chat__message--user {
    align-self: flex-end;
    background: var(--primary-blue);
    color: white;
    border-top-right-radius: 6px;
}

/* Bot (izquierda) */
.chat__message--bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border-top-left-radius: 6px;
}
.chat__message--bot ul, .chat__message--bot ol{
    padding-left: 2rem;
}

/* ============================= */
/* LOADER */
/* ============================= */

.chat__message--loading {
    align-self: flex-start;
    background: #e9edf3;
    color: #1c3d6e;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Punto animado */
.loading-dot {
    width: 10px;
    height: 10px;
    background: var(--primary-blue);
    border-radius: 50%;
    animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* ============================= */
/* INPUT INFERIOR */
/* ============================= */

.chat__input-area {
    margin-top: 20px;
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: center;
}

@media(max-width:650px){
    .chat__message{
        max-width: 100%;
    }
    .chat__header{
        padding-top: 40px;
    }
}