/* ==========================================================================
   Menu compte — panneau ouvert au clic sur le lien "compte" dans le header.
   Reprend les variables de thème définies dans :root (style.css) :
   --plum-950/900/800/700, --cream, --lavender, --coral, --teal, --radius-*.
   ========================================================================== */

.account-menu {
  position: relative;
}

/* Le lien devient un <button> pour piloter le panneau en JS,
   mais garde exactement l'apparence du lien d'origine. */
.account-menu .account-link {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.account-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 200;
  width: 380px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  background: var(--plum-900);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 18px;
  color: var(--cream);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 4px 14px rgba(0, 0, 0, 0.25);
  animation: account-panel-in 0.16s ease-out;
}

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

@keyframes account-panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Sections (conversations / matchs) ---------- */

.account-panel-section + .account-panel-section {
  margin-top: 18px;
}

.account-panel-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.account-panel-section-head h3 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0;
  color: var(--cream);
}

.account-panel-section-head a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--coral);
  text-decoration: none;
  white-space: nowrap;
}

.account-panel-section-head a:hover {
  text-decoration: underline;
}

.account-panel-empty {
  margin: 0;
  padding: 10px 2px;
  font-size: 0.85rem;
  color: var(--lavender);
}

/* ---------- Sliders horizontaux ---------- */

.account-panel-slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.account-panel-slider::-webkit-scrollbar {
  height: 6px;
}

.account-panel-slider::-webkit-scrollbar-thumb {
  background: var(--coral-dim);
  border-radius: 999px;
}

.account-slide {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.account-slide:hover,
.account-slide:focus-visible {
  background: var(--plum-800);
  transform: translateY(-2px);
}

.account-slide-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--cream);
  background: linear-gradient(135deg, var(--coral), var(--teal));
}

.account-slide-avatar--groupe {
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--plum-700), var(--teal));
}

/* Les matchs ont un petit anneau "story" autour de l'avatar. */
.account-slide-avatar--match {
  box-shadow: 0 0 0 3px var(--plum-900), 0 0 0 5px var(--teal);
}

.account-slide-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--cream);
}

.account-slide-preview {
  font-size: 0.72rem;
  color: var(--lavender);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------- Sous-menu (Notifications / Profil / Déconnexion) ---------- */

.account-panel-menu {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-panel-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cream);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.account-panel-menu-item:hover,
.account-panel-menu-item:focus-visible {
  background: var(--plum-800);
}

.account-panel-menu-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.account-panel-menu-item--danger {
  color: var(--coral);
}

/* ---------- Sous-vue Notifications (placeholder) ---------- */

.account-panel-view--notifs[hidden] {
  display: none;
}

.account-panel-notifs-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.account-panel-notifs-head h3 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0;
  color: var(--cream);
}

.account-panel-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--plum-800);
  color: var(--cream);
  font-size: 1rem;
  cursor: pointer;
}

.account-panel-back:hover {
  background: var(--plum-700);
}

.account-panel-notifs-list {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Mobile ---------- */

@media (max-width: 480px) {
  .account-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    max-height: 80vh;
    border-radius: 22px 22px 0 0;
    animation: account-panel-in-mobile 0.18s ease-out;
  }

  @keyframes account-panel-in-mobile {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
