/* Header Navigation */
.navbar {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #2a2a2a;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar__container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar__brand {
  display: flex;
  align-items: center;
}

.navbar__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  /* hérite de ton thème */
  font-family: var(--ff);
  font-weight: 700;
  letter-spacing: .3px;
  text-decoration: none;
}

.navbar__logo:hover {
    color: #ffd700;
    text-shadow: 0 0 8px var(--gold-glow);
}

.navbar__logo svg {
  color: var(--accent-color, #4f8cff);
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar__link {
  color: #a1a1aa;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.navbar__link:hover {
  color: #ffffff;
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color, #4f8cff);
  transition: width 0.2s ease;
}

.navbar__link:hover::after {
  width: 100%;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  gap: 3px;
}

.navbar__toggle span {
  width: 20px;
  height: 2px;
  background: #ffffff;
  transition: all 0.2s ease;
}

.navbar__mobile {
  display: none;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  padding: 1rem 1.5rem;
}

.navbar__mobile-link {
  display: block;
  color: #a1a1aa;
  text-decoration: none;
  padding: 0.75rem 0;
  font-weight: 500;
  border-bottom: 1px solid #2a2a2a;
}

.navbar__mobile-link:hover {
  color: #ffffff;
}

.navbar__mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #2a2a2a;
}

/* Mobile menu toggle animation */
.navbar__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar__toggle.active span:nth-child(2) {
  opacity: 0;
}

.navbar__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.navbar__mobile.active {
  display: block;
}

@media (max-width: 768px) {

  .navbar__nav,
  .navbar__actions {
    display: none;
  }

  .navbar__toggle {
    display: flex;
  }
}

/* ====== Profil (header) ====== */
.profile {
  position: relative;
  display: inline-block;
}

.profile__btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: transparent;
  border: 1px solid var(--line, #2a2a2a);
  padding: .375rem .5rem;
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.profile__btn:hover {
  background: rgba(255, 255, 255, .06);
  border-color: #3a3a3a;
}

.profile__btn:focus-visible {
  outline: 2px solid var(--accent-color, #4f8cff);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, .2);
}

.profile__name {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #e8e8e8;
}

.profile__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .3px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  user-select: none;
  overflow: hidden;
}

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

/* Variante pour initiales */
.profile__avatar--initials {
  background: var(--gold-glow);
  color: #fff;
}


.chev {
  transition: transform .2s ease;
}

.profile__btn[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

/* Menu */
.profile__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #1a1a1d;
  border: 1px solid #2f2f2f;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
  padding: .4rem;
  z-index: 40;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
}

.profile__menu[hidden] {
  display: block;
  /* pour permettre transition même si hidden */
  opacity: 0;
  pointer-events: none;
}

.profile__menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Items */
.profile__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .7rem .9rem;
  border-radius: 8px;
  background: none;
  color: #f0f0f0;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  transition: background .2s ease, color .2s ease;
}

.profile__item:hover {
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent-color, #4f8cff);
}

.profile__item:focus-visible {
  outline: 2px solid var(--accent-color, #4f8cff);
  outline-offset: 2px;
}

/* Séparateur */
.profile__sep {
  height: 1px;
  margin: .4rem 0;
  background: #2f2f2f;
  border: 0;
}


/* Préfère-réduire les animations */
@media (prefers-reduced-motion: reduce) {

  .profile__btn,
  .chev {
    transition: none;
  }

  .profile__menu.show {
    opacity: 1;
  }
}

/* ====== Variantes theme (optionnelles) ====== */
:root {
  --line: #2a2a2a;
  --menu-bg: #121214;
}

.profile__menu {
  background: var(--menu-bg);
  border-color: var(--line);
}

/* ====== Mobile ====== */
@media (max-width: 768px) {

  /* Le header cache déjà .navbar__actions → utiliser la zone mobile */
  .navbar__mobile .profile__item {
    padding: .8rem .9rem;
  }
}