/* ============================================================
   CHAT HARMONYE — panneau de la colonne droite
   Posé par chat.js après le bloc de connexion de .container-sidebar-right,
   dans une carte Cassiopeia pour se fondre dans « Login Form » et « Divers ».
   Charte : fond #e7ebf0, texte #303943, accent #0072ff (charte.css).
   ============================================================ */

.harmonye-chat {
  --chat-fond: #e7ebf0;
  --chat-texte: #303943;
  --chat-accent: #0072ff;
  --chat-ombre-s: rgba(163, 177, 198, 0.6);
  --chat-ombre-c: rgba(255, 255, 255, 0.9);
  font-family: 'Poppins', sans-serif;
}

.harmonye-chat .card-body {
  padding: 0.75rem;
}

/* ---- Choix du salon ---- */
.harmonye-chat__salons {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem 0;
}

.harmonye-chat__salon {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: var(--chat-fond);
  box-shadow: inset 1px 1px 3px var(--chat-ombre-s);
  color: #5b6470;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.harmonye-chat__salon:hover {
  color: var(--chat-texte);
}

.harmonye-chat__salon--actif {
  background: linear-gradient(135deg, #0072ff, #00b3ff);
  color: #ffffff;
  box-shadow: 2px 2px 5px var(--chat-ombre-s);
}

.harmonye-chat__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 0.3em;
  border-radius: 999px;
  background: #b42318;
  color: #ffffff;
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1;
}

.harmonye-chat__badge[hidden] {
  display: none;
}

.harmonye-chat__options {
  display: flex;
  justify-content: flex-end;
  padding: 0.15rem 0.75rem 0;
}

.harmonye-chat__notifications {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--chat-muet);
  font-size: 0.76rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.harmonye-chat__notifications:hover,
.harmonye-chat__notifications--actif {
  color: var(--chat-texte);
}

.harmonye-chat__notifications:disabled {
  cursor: default;
  opacity: 0.65;
  text-decoration: none;
}

.harmonye-chat__salon--prive {
  margin-left: auto;
}

.harmonye-chat__salon[hidden] {
  display: none;
}

.harmonye-chat__salon:focus-visible {
  outline: 2px solid var(--chat-accent);
  outline-offset: 1px;
}

/* ---- Bandeau « qui est connecté » ---- */
.harmonye-chat__connectes {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #5b6470;
}

.harmonye-chat__pastille {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: #35c759;
  box-shadow: 0 0 0 3px rgba(53, 199, 89, 0.18);
}

.harmonye-chat__connectes--vide .harmonye-chat__pastille {
  background: #b3bcc8;
  box-shadow: none;
}

.harmonye-chat__noms {
  font-weight: 600;
  color: var(--chat-texte);
  overflow-wrap: anywhere;
}

.harmonye-chat__connectes--invites .harmonye-chat__noms {
  font-weight: 500;
  color: #5b6470;
}

/* ---- Modération ---- */
.harmonye-chat__moderer {
  width: 100%;
  margin: 0 0 0.55rem;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: #dfe5ec;
  color: #5b6470;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.harmonye-chat__moderer:hover {
  color: var(--chat-texte);
}

.harmonye-chat__signalements {
  max-height: 250px;
  margin: 0 0 0.6rem;
  padding: 0.55rem;
  overflow-y: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 2px 2px 5px var(--chat-ombre-s);
}

.harmonye-chat__signalements-titre {
  margin: 0 0 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--chat-texte);
}

.harmonye-chat__bannissements-titre {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid #e2e7ed;
}

.harmonye-chat__duree {
  width: 100%;
  margin: 0 0 0.45rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid #d3dae3;
  border-radius: 6px;
  background: #ffffff;
  color: var(--chat-texte);
  font-family: inherit;
  font-size: 0.72rem;
}

.harmonye-chat__signalement-item {
  padding: 0.45rem 0;
  border-top: 1px solid #e2e7ed;
}

.harmonye-chat__signalement-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.harmonye-chat__signalement-tete {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #c0392b;
}

.harmonye-chat__signalement-meta,
.harmonye-chat__signalement-extrait,
.harmonye-chat__signalement-detail,
.harmonye-chat__signalements-vide {
  margin: 0.15rem 0 0;
  font-size: 0.69rem;
  line-height: 1.35;
  color: #5b6470;
  overflow-wrap: anywhere;
}

.harmonye-chat__signalement-extrait {
  color: var(--chat-texte);
}

.harmonye-chat__signalement-detail {
  font-style: italic;
}

.harmonye-chat__signalement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

/* ---- Fil des messages ---- */
.harmonye-chat__fil {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 280px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 2px 2px 5px var(--chat-ombre-s),
              inset -2px -2px 5px var(--chat-ombre-c);
  scrollbar-width: thin;
}

.harmonye-chat__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--chat-texte);
}

.harmonye-chat__entete {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.68rem;
  color: #7b848f;
}

.harmonye-chat__auteur {
  font-weight: 600;
  color: var(--chat-accent);
}

.harmonye-chat__item--moi .harmonye-chat__auteur {
  color: var(--chat-texte);
}

.harmonye-chat__texte {
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 1px 1px 3px var(--chat-ombre-s);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.harmonye-chat__item--moi .harmonye-chat__texte {
  background: rgba(0, 114, 255, 0.1);
}

.harmonye-chat__item--masque .harmonye-chat__texte {
  opacity: 0.65;
  border-left: 3px solid #e0a800;
}

.harmonye-chat__item--supprime .harmonye-chat__texte {
  opacity: 0.55;
  border-left: 3px solid #c0392b;
  text-decoration: line-through;
}

.harmonye-chat__etat {
  margin-left: auto;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: #f0d58a;
  color: #6b4e00;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
}

.harmonye-chat__item--supprime .harmonye-chat__etat {
  background: #f2b8b2;
  color: #7a1f16;
}

.harmonye-chat__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.1rem;
}

.harmonye-chat__action {
  width: auto !important;
  padding: 0.16rem 0.45rem;
  border: 0;
  border-radius: 999px;
  background: #e7ebf0;
  color: #5b6470;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
}

.harmonye-chat__action:hover {
  color: var(--chat-texte);
}

.harmonye-chat__action--danger {
  color: #a3271b;
  background: #f7dfdc;
}

.harmonye-chat__action--fort {
  background: linear-gradient(135deg, #0072ff, #00b3ff);
  color: #ffffff;
}

.harmonye-chat__signalements-compte {
  font-size: 0.63rem;
  font-weight: 700;
  color: #a3271b;
}

.harmonye-chat__vide {
  margin: 0;
  font-size: 0.78rem;
  color: #7b848f;
  text-align: center;
}

/* ---- Formulaire ---- */
.harmonye-chat__form {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.harmonye-chat__champ,
.harmonye-chat__pseudo {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--chat-fond);
  box-shadow: inset 2px 2px 4px var(--chat-ombre-s),
              inset -2px -2px 4px var(--chat-ombre-c);
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--chat-texte);
}

.harmonye-chat__champ:focus,
.harmonye-chat__pseudo:focus {
  outline: 2px solid var(--chat-accent);
  outline-offset: 1px;
}

.harmonye-chat__envoi,
.harmonye-chat__valider {
  flex: 0 0 auto;
  padding: 0.4rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0072ff, #00b3ff);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 2px 2px 5px var(--chat-ombre-s);
}

.harmonye-chat__envoi:hover,
.harmonye-chat__valider:hover {
  filter: brightness(1.07);
}

.harmonye-chat__envoi[disabled] {
  opacity: 0.55;
  cursor: default;
}

/* La colonne droite impose width:100% !important à tous ses boutons submit
   (user-extended.css). Dans le chat, cela écrase l'input à 30 px et étire
   « Envoyer » sur toute la ligne. On rétablit ici la largeur naturelle et la
   forme ronde du chat, sans toucher au formulaire de connexion. */
.harmonye-chat button.harmonye-chat__envoi,
.harmonye-chat button.harmonye-chat__valider {
  width: auto !important;
  min-width: 0;
  padding: 0.4rem 0.8rem !important;
  border-radius: 999px !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 2px 2px 5px var(--chat-ombre-s) !important;
}

/* ---- Entrée dans le chat (prénom) ---- */
.harmonye-chat__entree {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.harmonye-chat__entree p {
  margin: 0;
  font-size: 0.78rem;
  color: #5b6470;
}

.harmonye-chat__groupe {
  display: flex;
  gap: 0.35rem;
}

.harmonye-chat__statut {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: #c0392b;
}

.harmonye-chat__statut--succes {
  color: #1e7a3c;
}

/* ---- Boîte de signalement ---- */
.harmonye-chat__signalement {
  margin-top: 0.5rem;
  padding: 0.55rem;
  border-radius: 10px;
  background: #f7f0dc;
  box-shadow: inset 2px 2px 4px var(--chat-ombre-s);
}

.harmonye-chat__signalement form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.harmonye-chat__signalement-titre {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--chat-texte);
}

.harmonye-chat__motif,
.harmonye-chat__detail {
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  border: 1px solid #d9cfb6;
  border-radius: 6px;
  background: #ffffff;
  color: var(--chat-texte);
  font-family: inherit;
  font-size: 0.74rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 991.98px) {
  .harmonye-chat__fil {
    min-height: 220px;
    max-height: 320px;
  }
}

/* ============================================================
   Ouverture depuis le menu Divers (28/11/2026)
   Sur téléphone, la colonne de droite arrive après tout le contenu :
   le lien « Chat » ajouté en fin de menu Divers ouvre donc le panneau
   en surcouche. Sur grand écran, rien ne change : le panneau reste
   dans la colonne et le bouton Fermer n'est jamais affiché.
   ============================================================ */
.harmonye-chat__fermer {
  display: none;
}

@media (max-width: 991.98px) {
  .harmonye-chat__voile {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(15, 23, 42, .5);
  }

  .harmonye-chat--surcouche {
    position: fixed;
    z-index: 151;
    top: 12vh;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 30px rgba(15, 23, 42, .35);
    overflow: hidden;
  }

  .harmonye-chat--surcouche .harmonye-chat__fermer {
    display: inline-flex;
    position: absolute;
    top: .5rem;
    right: .6rem;
    z-index: 1;
    padding: .3em .75em;
    border: 1px solid rgba(48, 57, 67, .25);
    border-radius: 999px;
    background: #fff;
    color: var(--chat-texte);
    font-family: inherit;
    font-size: .74rem;
    font-weight: 600;
    cursor: pointer;
  }

  .harmonye-chat--surcouche .card-header {
    padding-right: 6.5em; /* place pour le bouton Fermer */
  }

  .harmonye-chat--surcouche .harmonye-chat__fil {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
}

@media print {
  .harmonye-chat {
    display: none !important;
  }
}
