header {
    height: 50px;
    background-color: grey;
}

body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
}

h1 {
    text-align: center;
    margin-bottom: 0;
    position: absolute;
    top: 0%; /* Modifier cette valeur */
    left: 0;
    right: 0;
    transform: translateY(-50%); /* Ajouter cette ligne */
}



p {
    text-align: center;
    margin-top: 90px; /* Ajouter cette ligne */
    margin-bottom: 30px;
}
.share-chat-link {
    font-size: 0.8em;
    margin-left: 0.5em;
    text-decoration: none;
    color: #007BFF;
}


.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px); /* Modifier cette valeur */
}


.messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 16px;
    margin-bottom: 0;
}

form {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
}

input[type="text"] {
    flex-grow: 1;
    margin-right: 16px;
    font-size: 16px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #cccccc;
    box-sizing: border-box;
}

input[type="submit"] {
    font-size: 16px;
    padding: 8px 16px;
    background-color: #007BFF;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.messages-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    overflow-y: scroll;
    padding: 0 16px;
    margin-bottom: 0px;
}

.messages {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 40px;
}

form {
    margin-bottom: 1em;
}
.delete-chat-link {
    font-size: 0.8em;
    margin-left: 0.5em;
    text-decoration: none;
    color: red;
}
.message-bubble {
    background-color: #007BFF;
    color: #ffffff;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.4;
    max-width: 70%;
    word-wrap: break-word;
    margin-left: 5px; /* Ajouté */
}

.message-bubble.user {
    background-color: #A8E6CF;
    color: #000; /* Ajouté */
}

.timestamp {
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

/* Ajouté */
.message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 12px;
}

.message-wrapper .username {
    font-weight: bold;
}
    /* Ajout d'une marge en haut pour les écrans à faible largeur */
@media screen and (max-width: 600px) {
    header, {
        height: 50px;
        margin-top: 3rem;
    }
    h1 {
        height: 50px;
        margin-top: 1.5rem;
        font-size: x-large;
    }
}

    /* Responsive design for mobile devices */
    @media screen and (max-width: 768px) {

    header {
        font-size: 1.2rem;
        padding: 0.5em;
    }

    header h1 {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5em;
    }

    .delete-chat-link,
    .share-chat-link {
        font-size: 0.9rem;
    }

    .chat-container {
        display: flex;
        flex-direction: column;
        height: 100vh;
    }

    .messages-container {
        flex-grow: 1;
        overflow-y: auto;
        padding: 1em;
        margin-bottom: 2em; /* Ajoutez cette ligne pour ajouter une marge en bas */
    }

    .chat-form {
        display: flex;
        flex-wrap: wrap;
        padding: 0.5em;
        position: fixed; /* Ajoutez cette ligne pour fixer le formulaire au bas de l'écran */
        bottom: 0; /* Ajoutez cette ligne pour fixer le formulaire au bas de l'écran */
        left: 0; /* Ajoutez cette ligne pour fixer le formulaire à gauche */
        right: 0; /* Ajoutez cette ligne pour fixer le formulaire à droite */
        background-color: white; /* Ajoutez cette ligne pour ajouter un fond blanc au formulaire */
    }

    .chat-form input[type="text"] {
        flex-grow: 1;
        margin-right: 0.5em;
    }

    .chat-form input[type="submit"] {
        width: 100%;
        margin-top: 0.5em;
    }
    /* Espacement en bas pour les messages */
    .messages-container::after {
    content: "";
    display: block;
    height: 100px;
    }

}
