/* ==========================================
   CONTENEDOR DEL CHAT
========================================== */

.chat-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;

    background: #ffffff;

    border: 1px solid #e6e8ef;
    border-radius: 16px;

    overflow: hidden;

    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);

    display: flex;
    flex-direction: column;
}


/* ==========================================
   CABECERA
========================================== */

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 16px 20px;

    background: #1a1f71;
    color: #ffffff;
}


.chat-header-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.15);

    border-radius: 50%;

    font-size: 23px;
}


.chat-header h5 {
    font-weight: 600;
}


.chat-header small {
    opacity: 0.85;
}


.chat-status {
    display: inline-block;

    width: 8px;
    height: 8px;

    margin-right: 5px;

    background: #22c55e;

    border-radius: 50%;
}


/* ==========================================
   ÁREA DE MENSAJES
========================================== */

.chat-log {
    height: 500px;

    padding: 20px;

    overflow-y: auto;

    background: #f6f7fb;

    display: flex;
    flex-direction: column;

    gap: 15px;
}


/* Scroll */

.chat-log::-webkit-scrollbar {
    width: 6px;
}

.chat-log::-webkit-scrollbar-thumb {
    background: #cfd3df;
    border-radius: 10px;
}


/* ==========================================
   MENSAJE GENERAL
========================================== */

.message {
    display: flex;

    gap: 10px;

    max-width: 80%;
}


/* ==========================================
   AVATAR
========================================== */

.message-avatar {
    width: 34px;
    height: 34px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 18px;
}


/* ==========================================
   BOT
========================================== */

.bot-message {
    align-self: flex-start;
}


.bot-message .message-avatar {
    background: #e8eaff;
    color: #1a1f71;
}


.bot-message .message-bubble {
    background: #ffffff;

    color: #333333;

    border: 1px solid #e4e6ed;

    border-radius: 4px 16px 16px 16px;

    padding: 11px 15px;

    line-height: 1.5;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}


/* ==========================================
   USUARIO
========================================== */

.user-message {
    align-self: flex-end;

    flex-direction: row-reverse;
}


.user-message .message-avatar {
    background: #1a1f71;
    color: #ffffff;
}


.user-message .message-bubble {
    background: #1a1f71;

    color: #ffffff;

    border-radius: 16px 4px 16px 16px;

    padding: 11px 15px;

    line-height: 1.5;
}


/* ==========================================
   CONTENIDO
========================================== */

.message-content {
    display: flex;

    flex-direction: column;

    gap: 4px;
}


.message-time {
    font-size: 11px;

    color: #8a8f9f;
}


/* ==========================================
   IMÁGENES DEL BOT
========================================== */

.bot-message img {
    max-width: 100%;

    border-radius: 10px;

    margin-top: 5px;
}


/* ==========================================
   INPUT
========================================== */

.chat-input-container {
    padding: 14px 16px;

    background: #ffffff;

    border-top: 1px solid #e6e8ef;
}


.chat-form {
    display: flex;

    align-items: center;

    gap: 10px;
}


.chat-input {
    flex: 1;

    height: 46px;

    border: 1px solid #dfe2ea;

    border-radius: 24px;

    padding: 0 18px;

    font-size: 15px;

    outline: none;

    transition: 0.2s;
}


.chat-input:focus {
    border-color: #1a1f71;

    box-shadow: 0 0 0 3px rgba(26, 31, 113, 0.08);
}


.chat-send-button {
    width: 46px;
    height: 46px;

    border: none;

    border-radius: 50%;

    background: #1a1f71;

    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 21px;

    cursor: pointer;

    transition: 0.2s;
}


.chat-send-button:hover {
    transform: scale(1.05);
}


.chat-send-button:disabled {
    opacity: 0.6;

    cursor: not-allowed;

    transform: none;
}


/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 576px) {

    .chat-container {
        border-radius: 12px;
    }


    .chat-log {
        height: 450px;

        padding: 15px;
    }


    .message {
        max-width: 90%;
    }


    .chat-header {
        padding: 14px 15px;
    }


    .chat-input-container {
        padding: 10px;
    }

}