/*  Variables */
:root {
  --pd-primary:       #ff7b01;
  --pd-muted:         #94a3b8;
  --pd-border:        #e5e7eb;
  --pd-heading-color: #1a202c;
  --pd-shadow-lg:     0 12px 30px rgba(15, 23, 42, 0.12);
  --pd-radius-lg:     16px;
  --pd-danger:        #ef4444;
}

/* Wrapper dropdown */
.pd-dropdown {
  position: relative;
  display: inline-block;
}

/*  Menu flottant */
.pd-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius-lg);
  box-shadow: var(--pd-shadow-lg);

  /* Animé : caché par défaut */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 1050;

  padding: 14px 0;
}

/* Ouverture au hover OU via classe .show (JS) */
.pd-dropdown:hover .pd-dropdown-menu,
.pd-dropdown.show .pd-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Empêche la fermeture quand la souris glisse sur le menu */
.pd-dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Bouton déclencheur  */
.pd-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 4px 6px 4px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}

.pd-profile-btn:hover {
  background: #f1f5f9;
}

/*  Avatar circulaire */
.pd-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pd-primary), #ec4899);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.pd-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/*  Infos textuelles (nom + rôle)  */
.pd-profile-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.pd-profile-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--pd-heading-color);
}

.pd-profile-role {
  font-size: 11px;
  color: var(--pd-muted);
}

/* Chevron */
.pd-chevron {
  font-size: 12px;
  color: #94a3b8;
  transition: transform .2s;
}

.pd-dropdown:hover .pd-chevron,
.pd-dropdown.show .pd-chevron {
  transform: rotate(180deg);
}

/* ── Liens du menu ───────────────────────────────────────── */
.pd-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  color: #475569;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.pd-dropdown-menu a:hover {
  background: #f8fafc;
  color: var(--pd-primary);
}

.pd-dropdown-menu a i {
  font-size: 16px;
  color: var(--pd-muted);
  width: 18px;
  flex-shrink: 0;
}

.pd-dropdown-menu a:hover i {
  color: var(--pd-primary);
}

/* Lien "Déconnexion" en rouge */
.pd-dropdown-menu a.pd-signout {
  color: var(--pd-danger);
}

.pd-dropdown-menu a.pd-signout i {
  color: var(--pd-danger);
}

.pd-dropdown-menu a.pd-signout:hover {
  background: #fef2f2;
  color: var(--pd-danger);
}

/*  Séparateur  */
.pd-dropdown-menu hr {
  margin: 8px 14px;
  border: 0;
  border-top: 1px solid var(--pd-border);
}

/*  Responsive : masquer nom/rôle sur mobile  */
@media (max-width: 575px) {
  .pd-profile-info,
  .pd-chevron {
    display: none;
  }
}
