/* General layout */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #e5ddd5;
}

.container {
    display: flex;
    width: 100%;
    height: 100vh;
    flex-direction: row;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Sidebar de chats */
.sidebar {
    width: 30%;
    background-color: #f0f0f0;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);  /* Sombra */
}

.sidebar h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #075e54;
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.chat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-list li {
    margin-bottom: 15px;
}

.chat-list li a {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;  /* Animación en hover */
}

.chat-list li a:hover {
    transform: scale(1.02);
}

.chat {
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

/* Ajustar el tamaño de los emojis para que coincidan con el texto */
img.emoji {
    width: 1em;
    height: 1em;
    vertical-align: -0.1em; /* Alinearlos correctamente con el texto */
}


.chat:hover {
    background-color: #ebebeb;
}

.chat strong {
    display: block;
    color: #075e54;
    font-size: 16px;
    margin-bottom: 5px;
}

/* Ventana de mensajes */
.chat-window {
    width: 70%;
    background-color: #e5ddd5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 20px;
}

.messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.05);
}

.message {
    margin-bottom: 15px;
    max-width: 60%;
    word-wrap: break-word;
    animation: slideIn 0.3s ease; /* Animación de entrada */
}

.message p {
    margin: 0;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra para las burbujas */
}

.message small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #555;
}

/* Estilo de los mensajes: enviados y recibidos */
.message.sent p {
    background-color: #fff;
    color: #000;
    text-align: right;
    border: 1px solid #ddd;
}

.message.received p {
    background-color: #dcf8c6;
    color: #000;
    text-align: left;
    margin-left: auto;
}

/* Footer para enviar mensajes */
.chat-footer {
    background-color: white;
    padding: 10px;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}

.chat-footer input[type="text"] {
    width: 85%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 30px;
    margin-right: 10px;
    font-size: 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-footer input[type="text"]:focus {
    outline: none;
    border-color: #128c7e;
}

.chat-footer button {
    padding: 10px 20px;
    background-color: #075e54;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-footer button:hover {
    background-color: #128c7e;
}

/* Scrollbar styling */
.sidebar, .messages {
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar, .messages::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb, .messages::-webkit-scrollbar-thumb {
    background-color: #bbb;
    border-radius: 10px;
}

/* Animación de entrada para los mensajes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos Responsivos */

/* Pantallas pequeñas (dispositivos móviles) */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding: 10px;
    }

    .chat-window {
        width: 100%;
        height: 60%;
        padding: 10px;
    }

    .message {
        max-width: 100%;  /* Asegurar que las burbujas ocupen más espacio en pantallas pequeñas */
    }

    .chat-footer input[type="text"] {
        width: 80%;
    }

    .chat-footer button {
        width: 50px;
        height: 50px;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Pantallas medianas (tablets) */
@media (max-width: 1024px) {
    .sidebar {
        width: 40%;
    }

    .chat-window {
        width: 60%;
    }

    .chat-footer input[type="text"] {
        width: 85%;
    }

    .message {
        max-width: 80%;  /* Ajustar la burbuja de mensajes */
    }
}
