/* Style général pour la fenêtre de chat */
.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    min-height: 400px;
    max-height: 600px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    z-index: 1000;
}
@media (max-width: 768px) {
    .chat-window {
        width: 90%;
        bottom: 10px;
        right: 5%;
        border-radius: 30px;
    }
}

/* En-tête du sondage */

.room-survey-block,
.survey-results-container {
    max-height: 60vh; /* Ne dépasse pas l'écran */
    overflow-y: auto; /* Active le scroll si besoin */
    box-sizing: border-box;
}




.room-survey-block {
    background-color: #ffffff;
    border: 1px solid #ddd;
    padding: 20px;
    margin-top: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}


.room-survey-block h4 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
}
.room-survey-block p {
    margin-bottom: 10px;
    color: #555;
}
.survey-question {
    margin-bottom: 20px;
}
.survey-question p {
    margin-bottom: 5px;
    font-weight: bold;
    color: #222;
}
.survey-question label {
    display: block;
    margin-bottom: 5px;
    cursor: pointer;
}
.room-survey-block button[type="submit"] {
    background-color: #007BFF;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}
.room-survey-block button[type="submit"]:hover {
    background-color: #0056b3;
}
.chart-container canvas {
    min-height: 200px;
    border: 1px solid #ccc;
}
.survey-message {
    margin-top: 10px;
    font-size: 14px;
    font-weight: bold;
    color: green;
    text-align: center;
}
#survey_results_[id],
.survey-results-container {
    margin-top: 25px;
    background-color: #fafafa;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    max-height: 60vh; /* Limite à 60% de la hauteur visible */
    overflow-y: auto;
}

.survey-results-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
    text-align: center;
}

.chart-container {
    width: 100%;
    max-height: 50vh;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
}

.chart-container canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 300px; /* Tu peux ajuster */
    display: block;
}


/* En-tête du chat */
.chat-header {
    background-color: #007bff;
    color: white;
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

/* Contenu des messages */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    scroll-behavior: smooth; /* Ajoute un défilement fluide */
    padding: 10px;
    height: auto; /* S'assure que le conteneur s'ajuste au contenu */
}

/* Pied de page */
.chat-footer {
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* Zone de texte */
.chat-footer textarea {
    width: 100%;
    height: 60px;
    resize: none;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Boutons dans le pied de page */
.chat-footer button {
    padding: 8px 12px;
    font-size: 14px;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.chat-footer button:hover {
    background-color: #0056b3;
}

/* Section des smileys */
.smiley-section {
    margin-top: 10px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-height: 150px;
    overflow-y: auto;
}

.smiley-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.smiley-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: transform 0.3s;
}

.smiley-icon:hover {
    transform: scale(1.2);
}

.smiley-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.smiley-btn:hover {
    background-color: #0056b3;
}

.send-btn {
    display: inline-flex;
    align-items: center;
    width: 100px;
    justify-content: center;
    background-color: #007bff;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.2s;
}

.send-btn span {
    margin-right: 10px; /* Espace entre le texte et l'icône */
}

.send-btn i.arrow-icon {
    font-size: 18px;
    font-weight: bold;
    display: inline-block;
    transform: translateY(1px); /* Légèrement centré */
}

.send-btn:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.send-btn:active {
    background-color: #003f7f;
    transform: scale(0.95);
}

textarea {
    width: 100%;
    max-height: 150px; /* Limite la hauteur maximale */
    overflow-y: auto; /* Active le défilement si nécessaire */
    box-sizing: border-box; /* Inclut le padding dans la largeur */
    resize: none; /* Désactive le redimensionnement manuel */
}

.typing-indicator {
    padding: 5px 10px;
    font-size: 14px;
    font-style: italic;
    color: #888;
    background-color: #f9f9f9;
    border-top: 1px solid #ccc;
    display: none; /* Caché par défaut */
    margin-top: auto; /* Pousse les messages vers le haut */
    animation: fadeIn 0.3s ease-in-out;
}
    

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.chat-block {
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-width: 300px;
    margin: 0 auto;
}

.chat-block h3 {
    text-align: center;
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: box-shadow 0.2s;
}

.friend-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.friend-name {
    font-size: 16px;
    color: #555;
    font-weight: bold;
}

.friend-actions a {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.friend-actions {
    display: flex;
    gap: 10px; /* Assure un espace entre les boutons */
}

.friend-actions a {
    display: inline-block;
}

.friend-actions a:hover {
    background-color: #ccc;
}

.chat-btn {
    background-color: #4caf50;
    color: white;
}

.remove-btn {
    background-color: #f44336;
    color: white;
}

.block-btn {
    background-color: #ff9800;
    color: white;
}

.friends-management {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.friends-management ul {
    list-style-type: none;
    padding: 0;
}
.friends-management li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}
.friends-management li:last-child {
    border-bottom: none;
}
.friend-name {
    font-weight: bold;
    color: #555;
}
.friend-actions a {
    margin-left: 10px;
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
}
.friend-actions a.remove-btn {
    background-color: #f44336;
}
.friend-actions a.block-btn {
    background-color: #ff9800;
}
.friend-actions a:hover {
    opacity: 0.8;
}
form {
    margin-bottom: 20px;
}
button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
button:hover {
    background-color: #0056b3;
}
.unblock-btn {
    background-color: #4caf50;
    color: #fff;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.unblock-btn:hover {
    background-color: #45a049;
}

#online_friends_list li {
    margin: 0; /* Évite les marges inutiles */
    padding: 0; /* Évite les espacements */
    list-style-type: none; /* Supprime les points ou puces */
}

#online_friends_list li a {
    text-decoration: none; /* Supprime le soulignement */
    color: #007BFF; /* Couleur de lien par défaut */
    cursor: pointer; /* Change le curseur sur hover */
}

#online_friends_list li a:hover {
    text-decoration: underline; /* Ajoute un soulignement au survol */
}


.ban-info {

    font-style: italic;
    display: block;
    margin-top: 5px;
}

.ban-info.permanent {
    font-size: 14px;
    color: red !important;
    font-weight: bold;
}

.ban-info.temporary {
    font-size: 14px;
    color: orange;
}


/*Ici commence le CSS pour les Salons Public */

/* Conteneur principal */
.room-chat-container {
display: flex;
    flex-direction: row;
    min-height: 100vh; /* Au lieu de height fixe */
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
    overflow-y: auto; /* Permet de scroller si besoin */
}

/* Liste des salons */
/* Conteneur principal */
.room-list-container {
  width: 100%;
  max-width: 600px;       /* ou toute autre valeur souhaitée */
  margin: 0 auto;
  padding: 0 1rem;        /* un peu de marge intérieure */
  box-sizing: border-box;
}

/* Titre */
.room-list-container h3 {
  margin-bottom: 12px;
  font-size: 20px;
  text-align: center;
}

/* Champ de recherche */
#room-search {
  width: 200px;
  padding: 8px 12px;
  margin-bottom: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

/* Grille de cartes */
.room-grid {
  display: grid;
  grid-gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

/* Carte salon */
.room-card {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
}
.room-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Icône */
.room-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: #007bff;
}

/* Nom du salon */
.room-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  text-align: center;
  word-break: break-word;
}

@media (max-width: 600px) {
  .room-grid {
    grid-template-columns: 1fr !important;
  }
}


/* Message si pas de salon */
.no-rooms {
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Section principale (chat + utilisateurs en ligne) */
.room-online-users-list { display: none; }
#room-chat_section {
    flex: 4;
    display: flex;
    flex-direction: row; /* Garder les utilisateurs en ligne à droite */
    gap: 10px;
    padding: 10px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Conteneur du chat */
#room-chat_room_container {
    flex: 3; /* Chat prend 75% */
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

.room-chat-room-messages {
    flex: 1; /* Permet à la zone des messages de prendre tout l'espace disponible */
    overflow-y: auto; /* Ajoute le défilement vertical si nécessaire */
    height: calc(50vh - 100px); /* Définit une hauteur relative à la fenêtre */
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #f9f9f9;
}

/* Entrées utilisateur */
.room-chat-input-container {
    display: flex;
    flex-direction: column; /* Place les éléments verticalement */
    gap: 10px;
    position: relative;
}

.room-chat-input-container textarea {
    width: calc(100% - 10px); /* Prend toute la largeur moins les marges */
    min-height: 70px; /* Hauteur minimale */
    max-height: 150px; /* Hauteur maximale */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 8px;
    resize: none; /* Désactive le redimensionnement manuel */
}

/* Conteneur des actions (boutons Smileys et Envoyer) */
.room-chat-actions {
    display: flex;
    justify-content: flex-start; /* Aligner les boutons à gauche */
    gap: 10px; /* Espacement entre les boutons */
}

/* Bouton des smileys */
.smiley-btn {
    padding: 5px 10px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.smiley-btn:hover {
    background-color: #e6e6e6;
}

/* Bouton Envoyer */
.room-send-btn {
    padding: 5px 15px;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
}

.room-send-btn:hover {
    background-color: #0056b3;
}

/* Conteneur des smileys */
.room-smiley-section {
    display: none; /* Caché par défaut */
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 300px; /* Limite la largeur */
    max-height: 150px; /* Limite la hauteur */
    overflow-y: auto; /* Ajoute une barre de défilement si nécessaire */
}

/* Grille des smileys */
.room-smiley-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 colonnes */
    gap: 5px;
}

/* Icônes smiley */
.room-smiley-icon {
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: transform 0.2s;
}

.room-smiley-icon:hover {
    transform: scale(1.2); /* Zoom au survol */
}

/* Liste des utilisateurs */
.room-online-users-container {
    flex: 1; /* Liste des utilisateurs prend 25% */
    display: flex;
    flex-direction: column;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    padding: 10px;
    overflow-y: auto;
}

/* Liste des utilisateurs en ligne */
.room-online-users-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Responsive - Écrans moyens */
@media screen and (max-width: 768px) {
    .room-chat-container {
        flex-direction: column; /* Passe en colonne */
        height: auto;
    }

    #room-room_list_container,
    #room-chat_section {
        flex: none;
        width: 100%;
        height: auto;
    }

    .room-chat-room-messages {
        height: auto;
        max-height: 50vh;
    }

    .room-chat-actions {
        flex-direction: column; /* Boutons empilés */
        gap: 5px;
    }
}

@media screen and (max-width: 768px) {
  /* 1) Le conteneur principal de chat passe en colonne */
  #room-chat_section {
    display: flex;
    flex-direction: column;
  }
  /* 2) La zone de chat prend tout l’espace */
  #room-chat_room_container {
    order: 1;
    width: 100%;
  }
  /* 3) La liste des utilisateurs passe **en dessous**, prend 100% */
  .room-online-users-container {
    order: 2;
    width: 100%;
    display: block !important;    /* forcer l’affichage si elle était cachée */
    margin-top: 1rem;             /* un peu d’espace au-dessus */
  }
}

input[type="file"] {
    margin-top: 5px;
}

.room-message-user {
    font-weight: bold;
    color: #007bff; /* Bleu */
    cursor: pointer;
}

.room-message-user:hover {
    text-decoration: underline;
}

.no-users {
    color: #999;
    font-style: italic;
    text-align: center;
    margin-top: 10px;
}

/* Effet de chargement style squelette */
.user-loading-placeholder {
    height: 18px;
    width: 60%;
    margin: 8px auto;
    border-radius: 4px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loadingPlaceholder 1.4s ease infinite;
}

@keyframes loadingPlaceholder {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/*Style CSS à ajouter dans ton template (par exemple dans le fichier CSS du chat ou en <style>) */

.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}

.profile-modal {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    width: 320px;
    max-width: 90%;
    margin: 100px auto;
    position: relative;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
}



