/* style.css */
* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: url("https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png");
}

.chat-box::-webkit-scrollbar {
    width: 4px;
}

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

.login-container, .chat-container {
    width: 100%;
    max-width: 300px;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-container form input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.login-container span{
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

button {
    padding: 12px;
    background-color:cornflowerblue; /* Couleur verte WhatsApp */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: royalblue;
}

.chat-container {
    width: 90%;
    max-width: 500px;
    background-color: #ffffff;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    justify-content: space-between; /* Espace entre les éléments */
    align-items: center; /* Aligner verticalement */
    padding: 5px;
}

.header-left {
    flex: 1; /* Permet à ce div d'occuper l'espace restant */
}

.header-right {
    /* Si tu veux aligner le bouton de déconnexion à droite */
    text-align: right;
}

.chat-header h1 {
    font-size: 20px;
    font-weight: 700;
}

.chat-header h2 {
    font-size: 15px;
    font-weight: 500;
    color: #777;
    margin-bottom: 0;
}

.chat-box {
    height: 350px;
    overflow-y: auto;
    background-color: #e5ddd5; /* Fond beige pâle */
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input {
    display: flex;
    align-items: center; /* Alignement vertical des éléments */
    position: relative;
    padding: 10px 0;
}

.chat-input input {
    width: 100%;
    padding: 12px 10px;  /* Espacement pour l'icône à gauche */
    font-size: 16px;
    border-radius: 30px;
    border: 1px solid #ccc;
    outline: none;
}

.chat-input input:focus {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

#btn_icon {
    background: none;
    border: none;
    color: gray;
    font-size: 20px;
    cursor: pointer;
    padding: 0 10px;}

#btn_icon:hover {
    color: grey;
}

#btn_send {
    background: none;
    border: none;
    color: cornflowerblue;
    cursor: pointer;
    padding: 0 10px;
    vertical-align: middle;
}

#btn_send:hover {
    color: royalblue;
}

.message {
    padding: 10px;
    border-radius: 15px;
    font-size: 14px;
    max-width: 70%;
    word-wrap: break-word;
}

.message-info {
    font-size: 10px;
    color: gainsboro;
    text-align: center;
    margin-top: 5px;
}

.message-bubble {
    max-width: 60%;
    padding: 0 10px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.25;
    position: relative;
    word-wrap: break-word;
    clear: both;
}

.message-bubble.other {
    background-color: ghostwhite;
    color: black;
    align-self: flex-start;
    text-align: left;
    border-bottom-left-radius: 0;
    float: left;
}

.message-bubble.own {
    background-color: cornflowerblue;
    color: white;
    align-self: flex-end;
    text-align: right;
    border-bottom-right-radius: 0;
    float: right;
}

ul#userListContent {
    margin: 5px 0;
}

li::marker {
    color: lawngreen;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        height: 100vh;
        background-size: cover;
        background-position: center;
        padding: 0;
    }

    .chat-header {
        margin: 0 10px;
    }

    .chat-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
        padding: 0 0 65px 0;
        max-width: 100%;
    }

    .chat-box {
        height: calc(100vh - 200px);
        padding: 5px;
        font-size: 16px;
        background: url("https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png");
        margin: 0;
        border-radius: 0;
    }

    .chat-header h1 {
        font-size: 18px;
    }

    .chat-header h2 {
        font-size: 14px;
    }

    .chat-input {
        flex-direction: row;
        gap: 5px;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100vw;
        padding: 10px;
        background: #fff;
        border-top: 1px solid #ddd;
    }

    .chat-input input {
        font-size: 16px;
        padding: 12px;
        border-radius: 30px;
        width: 100%;
    }

    #btn_send {
        font-size: 20px;
        padding-left: 5px;
    }

    .message-bubble {
        font-size: 16px;
        padding: 5px;
        max-width: 80%;
    }

    .message-bubble.own {
        margin-right: 5px;
    }

    .message-bubble.other {
        margin-left: 5px;
    }
}
