/*
 * IMMGO — Écrans de la messagerie et des notifications : conversations, fil de messages, bulles, pièces jointes
 * Auteur : Jacks Ngalangala
 */

/* ─── Page d'une conversation : fil à gauche, participants à droite (préfixe me-) ─── */
.me-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--e-6);
  align-items: start;
}
.me-conversation {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--hauteur-entete) - 2 * var(--e-8));
  min-height: 420px;
  overflow: hidden;
}
.me-tete {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--e-4) var(--e-6);
  border-bottom: 1px solid var(--trait);
}
.me-sujet {
  font-size: var(--taille-grand);
  font-weight: var(--graisse-titre);
}
.me-fil {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--e-3);
  padding: var(--e-6);
  background: var(--surface-douce);
}
.me-jour {
  display: flex;
  justify-content: center;
  margin: var(--e-2) 0;
}
.me-jour span {
  padding: var(--e-1) var(--e-3);
  border-radius: var(--r-pilule);
  background: var(--neutre-pale);
  font-size: var(--taille-legende);
  color: var(--texte-second);
}
.me-ligne {
  display: flex;
  align-items: flex-end;
  gap: var(--e-2);
  max-width: 78%;
}
.me-moi {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.me-bulle {
  display: flex;
  flex-direction: column;
  gap: var(--e-1);
  padding: var(--e-3) var(--e-4);
  border-radius: var(--r-grand) var(--r-grand) var(--r-grand) var(--e-1);
  background: var(--surface);
  border: 1px solid var(--trait);
  box-shadow: var(--ombre-1);
}
.me-moi .me-bulle {
  border-radius: var(--r-grand) var(--r-grand) var(--e-1) var(--r-grand);
  background: var(--or-pale);
  border-color: var(--or-trait);
}
.me-retire {
  font-style: italic;
  color: var(--texte-faible);
}
.me-auteur {
  font-size: var(--taille-petit);
  font-weight: var(--graisse-forte);
  color: var(--or-texte);
}
.me-texte {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.me-heure {
  align-self: flex-end;
  font-size: var(--taille-legende);
  color: var(--texte-faible);
}
.me-pieces {
  display: flex;
  flex-direction: column;
  gap: var(--e-1);
}
.me-piece,
.me-jointe {
  display: flex;
  align-items: center;
  gap: var(--e-2);
  min-height: 40px;
  padding: var(--e-1) var(--e-3);
  border: 1px solid var(--trait);
  border-radius: var(--r-petit);
  background: var(--surface);
  font: inherit;
  font-size: var(--taille-petit);
  color: var(--texte);
  text-align: left;
  cursor: pointer;
}
.me-piece svg,
.me-jointe svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--or-texte);
}
.me-piece-nom {
  min-width: 0;
  overflow-wrap: anywhere;
}
.me-piece-taille {
  margin-left: auto;
  color: var(--texte-faible);
}
.me-composer {
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
  padding: var(--e-3) var(--e-4);
  border-top: 1px solid var(--trait);
  background: var(--surface);
}
.me-jointes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-2);
}
.me-jointes:empty {
  display: none;
}
.me-jointe {
  cursor: default;
  padding-right: var(--e-1);
}
.me-barre {
  display: flex;
  align-items: flex-end;
  gap: var(--e-2);
}
.me-saisie {
  flex: 1;
  min-height: 48px;
  max-height: 160px;
  field-sizing: content;
  padding: var(--e-3) var(--e-4);
  border: 1px solid var(--trait-fort);
  border-radius: var(--r-moyen);
  background: var(--surface);
  font: inherit;
  color: var(--texte);
  resize: none;
}
.me-saisie:focus {
  outline: none;
  border-color: var(--or);
  box-shadow: var(--anneau);
}

@media (max-width: 1023px) {
  .me-page {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 599px) {
  .me-conversation {
    height: calc(100dvh - var(--hauteur-entete) - var(--hauteur-onglets-mobile) - var(--e-12));
    min-height: 360px;
  }
  .me-fil {
    padding: var(--e-4);
  }
  .me-tete {
    padding: var(--e-3) var(--e-4);
  }
  .me-ligne {
    max-width: 92%;
  }
}
