/* Profil = page rendue dans le floating panel (route #profile), comme la map.
   Le floating panel est positionné dans floating_panel.css ; ici = le contenu. */

/* Tout le profil scrolle (le floating panel est le cadre) */
.account-sheet__content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding-top: 30px;
  padding-bottom: 0;
}

/* Compte visité : on descend le contenu sous la navigation flottante. */
.account-sheet__content--visited {
  padding-top: 64px;
}

/* Navigation d'un compte visité : éléments posés directement en haut
   (pas de bande/header), flottant par-dessus le contenu et restant visibles
   au scroll (sticky transparent). */
.account-sheet__navbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none; /* seuls les boutons captent les clics */
}

.account-sheet__navbar[hidden] { display: none; }

.account-sheet__navbar > * { pointer-events: auto; }

.account-sheet__navback {
  /* Mêmes dimensions que le pill user (.account-sheet__mini) pour aligner
     les deux pills au même niveau vertical (avatar 34px, padding 7px). */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 18px 7px 7px;
  border: none;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: background 0.15s ease;
}

.account-sheet__navback:hover { background: #f5f5f5; }

.account-sheet__navback-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.08);
  flex: 0 0 auto;
}

.account-sheet__navback-text {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-sheet__navbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  padding: 7px 8px; /* même hauteur que le pill "Back to" (≈48px) */
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

.account-sheet__naviconbtn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #000;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.account-sheet__naviconbtn:hover { background: #f0f0f0; }

.account-sheet__naviconbtn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Bouton fermer : le "+" (New_post.svg) tourné en croix. */
.account-sheet__naviconbtn--close img {
  width: 16px;
  height: 16px;
  transform: rotate(-45deg);
}

/* Uniquement quand la galerie est vide : on passe le contenu en colonne flex
   pour pouvoir centrer verticalement l'illustration. Le layout normal
   (display block) est préservé pour ne pas rétrécir l'en-tête / les boutons. */
.account-sheet__content:has(.account-sheet__empty-state) {
  display: flex;
  flex-direction: column;
}

/* En flex column, les blocs centrés par margin:auto + max-width doivent
   être étirés sur toute la largeur pour conserver leur taille d'origine. */
.account-sheet__content:has(.account-sheet__empty-state) > .account-sheet__head,
.account-sheet__content:has(.account-sheet__empty-state) > .account-sheet__actions,
.account-sheet__content:has(.account-sheet__empty-state) > .account-sheet__bio,
.account-sheet__content:has(.account-sheet__empty-state) > .account-sheet__select {
  width: 100%;
}

.account-sheet__content::-webkit-scrollbar { display: none; }

/* Mini-header = petit floating (pill) qui descend du haut au scroll :
   photo + nom, max 200px, centré, à 16px du haut, arrondi. */
.account-sheet__mini {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 200px;
  padding: 7px 18px 7px 7px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transform: translate(-50%, calc(-100% - 16px));
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.account-sheet__mini.is-visible {
  transform: translate(-50%, 0);
}

.account-sheet__mini-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.08);
  flex: 0 0 auto;
}

.account-sheet__mini-name {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Padding porté par les composants (pas le panel) pour que la grille touche
   les bords. */
.account-sheet__head,
.account-sheet__bio,
.account-sheet__actions,
.account-sheet__select {
  padding-left: 24px;
  padding-right: 24px;
}

/* Boutons d'actions sous l'en-tête */
.account-sheet__actions {
  display: flex;
  gap: 8px;
  max-width: 70%;
  margin: 18px auto 0;
}

.account-sheet__btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: #ededed;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.account-sheet__btn:hover {
  background: #e3e3e3;
}

.account-sheet__btn--icon {
  flex: 0 0 auto;
  width: 44px;
  display: grid;
  place-items: center;
}

.account-sheet__btn--icon.is-active {
  background: #000;
}

.account-sheet__btn--icon.is-active img {
  filter: invert(1);
}

/* ── Rangée de suggestions de profils (toggle via le bouton de droite) ──────── */
.account-sheet__suggestions {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.28s ease, opacity 0.2s ease, margin 0.28s ease;
  overflow: hidden;
}

.account-sheet__suggestions.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 14px;
}

/* Le wrapper interne masque le contenu pendant le collapse (grid 0fr) */
.account-sheet__suggestions > * {
  min-height: 0;
}

.account-sheet__sugg-head {
  padding: 0 24px 10px;
  font-size: 14px;
  font-weight: 700;
  color: #000;
}

.account-sheet__sugg-status {
  padding: 8px 24px 4px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.4);
}

.account-sheet__sugg-row {
  display: flex;
  gap: 12px;
  padding: 2px 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

/* Spacers de 24px aux deux extrémités : garantit l'espace gauche/droite
   au repos ET pendant le scroll (un padding latéral est avalé en flex+scroll). */
.account-sheet__sugg-row::before,
.account-sheet__sugg-row::after {
  content: '';
  flex: 0 0 12px; /* 12px + gap 12px = 24px effectif aux extrémités */
}

.account-sheet__sugg-row::-webkit-scrollbar { display: none; }

.account-sheet__sugg-card {
  flex: 0 0 auto;
  width: 148px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border-radius: 16px;
  background: #f5f5f5;
}

.account-sheet__sugg-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.08);
}

.account-sheet__sugg-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-size: 14px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-sheet__sugg-username {
  max-width: 100%;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-sheet__sugg-follow {
  margin-top: 6px;
  width: 100%;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.account-sheet__sugg-follow:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.account-sheet__sugg-follow:active {
  transform: scale(0.97);
}

.account-sheet__sugg-follow.is-following {
  background: #ededed;
  color: rgba(0, 0, 0, 0.55);
  box-shadow: none;
}

.account-sheet__btn--icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* En-tête : grosse photo à gauche + (nom/username puis stats) à droite */
.account-sheet__head {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 60%;
  margin-left: auto;
  margin-right: auto;
}

.account-sheet__avatar {
  width: 194px;
  height: 194px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.08);
  flex: 0 0 auto;
}

.account-sheet__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Nom + username sur la même ligne */
.account-sheet__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.account-sheet__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 800;
  color: #000;
  white-space: nowrap;
}

.account-sheet__verified {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #54f9f4;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.account-sheet__username {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.45);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-sheet__bio {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.45;
  color: #000;
}

/* Stats à côté de la photo : nombre + label dessous, sans bulle */
.account-sheet__stats {
  display: flex;
  gap: 28px;
}

.account-sheet__stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.account-sheet__stat-num {
  font-size: 22px;
  font-weight: 800;
  color: #000;
  line-height: 1.1;
}

.account-sheet__stat-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.45);
}

/* Sélecteur (galerie / aimés / reposts / favoris) inspiré du profil app */
.account-sheet__select {
  margin-top: 22px;
}

.account-sheet__select-row {
  display: flex;
  align-items: center;
}

.account-sheet__tab {
  flex: 1;
  height: 42px;
  border: none;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.account-sheet__tab img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  opacity: 0.35;
  transition: opacity 0.16s ease;
}

.account-sheet__tab.is-active img {
  opacity: 1;
}

.account-sheet__select-track {
  position: relative;
  height: 2px;
}

.account-sheet__select-slider {
  position: absolute;
  bottom: 0;
  left: calc(0.5 * 25% - 14px);
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: #0f172a;
  transition: left 0.18s ease;
}

/* Grille des posts du profil (scrolle avec le reste du profil) */
.account-sheet__grid {
  margin-top: 0;
}

.account-sheet__cells {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2px;
  border-radius: 0;
  overflow: hidden;
}

.account-sheet__cell {
  position: relative;
  aspect-ratio: 3 / 4;
  min-height: 140px;
  border: none;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  background: #f0f0f0;
  cursor: pointer;
}

.account-sheet__cell-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-sheet__cell-views {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.account-sheet__cell-play {
  width: 12px;
  height: 12px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.account-sheet__cell-photo {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.account-sheet__more {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: #f2f2f2;
  font-size: 14px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
}

.account-sheet__empty {
  text-align: center;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.4);
  padding: 24px 0;
}

/* Quand la galerie est vide, la grille occupe toute la hauteur restante
   pour centrer l'illustration entre le sélecteur et le bas de la page. */
.account-sheet__grid:has(.account-sheet__empty-state) {
  flex: 1;
  min-height: 0;
  display: flex;
}

.account-sheet__empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
}

.account-sheet__empty-illu {
  width: 180px;
  max-width: 60%;
  height: auto;
  display: block;
  opacity: 0.9;
}

.account-sheet__empty-text {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.4);
}

.account-sheet__empty-sub {
  margin: 0;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.35);
}

/* Bouton "Suivre" sur la page d'un profil ciblé (blanc + box-shadow, puis états) */
.account-sheet__btn--follow {
  background: #fff;
  color: #000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.account-sheet__btn--follow:hover {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.account-sheet__btn--follow:active {
  transform: scale(0.98);
}

.account-sheet__btn--follow.is-following,
.account-sheet__btn--follow.is-pending {
  background: #ededed;
  color: rgba(0, 0, 0, 0.55);
  box-shadow: none;
}
