/* Aplica la tipografía Poppins */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f4f4;
}

/* Contenedor principal */
.chat-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 800px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Área de mensajes */
.chat-box {
    flex-grow: 1;
    padding: 20px;
    background-color: #f9f9f9;
    overflow-y: auto;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    color: #333;
}

/* Contenedor de inputs y botones */
.input-container {
    display: flex;
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #ddd;
    align-items: center;
    gap: 10px;
    position: relative;
}

.input-container input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
}

/* Botón de enviar */
#sendButton {
    padding: 10px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendButton i {
    font-size: 16px;
}

#sendButton:hover {
    background-color: #0056b3;
}

/* Botón de emojis */
#emojiButton {
    background-color: #1257cd;
    border: none;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

#emojiButton i {
    font-size: 20px;
    line-height: 1;
}

#emojiButton:hover {
    background-color: #0a45a0;
}

/* Mensajes */
.chat-box div {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
    background-color: #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.chat-box div strong {
    font-weight: 600;
    color: #007bff;
    margin-right: 10px;
}

.chat-box div .message-text {
    font-size: 14px;
    color: #333;
    word-wrap: break-word;
    max-width: 80%;
}

.chat-box div .time-ago {
    font-size: 12px;
    color: #888;
    margin-left: auto;
    align-self: flex-start;
}

/* Emojis */
.emoji-container {
    display: none;
    position: absolute;
    bottom: 60px;
    right: 20px;
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.emoji-container .emoji {
    font-size: 20px;
    margin: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-block;
}

.emoji-container .emoji:hover {
    background-color: #f0f0f0;
}

/* Responsive para móviles */
@media screen and (max-width: 600px) {
    .input-container {
        flex-direction: column;
        align-items: stretch;
    }

    .input-container input {
        width: 100%;
        margin-bottom: 10px;
    }

    #sendButton,
    #emojiButton {
        width: 100%;
    }

    .chat-box div {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-box div .time-ago {
        align-self: flex-end;
        margin-top: 5px;
    }

    .emoji-container {
        right: 10px;
        left: 10px;
        width: auto;
    }

    /* Ocultar botón de emojis en móvil */
    #emojiButton {
        display: none !important;
    }
    
    /* Mostrar texto "Enviar" junto al ícono en móvil */
    #sendButton span {
        display: inline-block;
        margin-left: 5px;
    }
}

/* Estilos para PC (pantallas grandes) */
@media screen and (min-width: 601px) {
    /* Mostrar botón de emojis en PC */
    #emojiButton {
        display: flex !important;
    }
    
    /* Ocultar texto "Enviar" en PC */
    #sendButton span {
        display: none;
    }
}