/* ==========================================================================
   MENU FINAL - Le Plat Gagnant
   ========================================================================== */

/* Variables locales au menu */
:root {
  --menu-gold: #D4AF37;
  --menu-gold-light: rgba(212, 175, 55, 0.15);
  --menu-gold-medium: rgba(212, 175, 55, 0.3);
  --menu-white: #FFFFFF;
  --menu-black: #1A1A1A;
  --menu-dark: #333333;
  --menu-gray: #666666;
  --menu-light-gray: #f8f9fa;
  --menu-shadow-small: 0 2px 8px rgba(0, 0, 0, 0.08);
  --menu-shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.1);
  --menu-shadow-large: 0 10px 30px rgba(0, 0, 0, 0.1);
  --menu-transition: 0.3s ease;
  --menu-border-radius-small: 8px;
  --menu-border-radius-medium: 12px;
  --menu-border-radius-large: 30px;
}

/* ==========================================================================
   1. HEADER & LOGO
   ========================================================================== */

.header {
  background-color: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.header.scrolled {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1001;
}

.logo-container:hover {
  transform: translateY(-2px);
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
  transition: all 0.3s ease;
}

.logo-container:hover .logo {
  box-shadow: 0 6px 14px rgba(212, 175, 55, 0.4);
  transform: rotate(5deg);
}

.logo-text {
  margin-left: 12px;
  font-weight: 700;
  font-size: 1.4rem;
  color: #1A1A1A;
  letter-spacing: 0.5px;
  position: relative;
}

.logo-text:after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #D4AF37, rgba(212, 175, 55, 0.15));
  transition: width 0.3s ease;
}

.logo-container:hover .logo-text:after {
  width: 100%;
}

/* ==========================================================================
   2. DESKTOP NAVIGATION
   ========================================================================== */

.nav-desktop {
  display: flex;
  align-items: center;
}

.nav-desktop ul {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  position: relative;
  margin: 0;
  padding: 0 8px;
}

.nav-link {
  color: #333333;
  font-weight: 500;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
}

.nav-link:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(212, 175, 55, 0.15);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.nav-link:hover:before,
.nav-item.active .nav-link:before {
  opacity: 1;
}

.nav-link:hover,
.nav-item.active .nav-link {
  color: #D4AF37;
}

.nav-link:after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: #D4AF37;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.nav-link:hover:after,
.nav-item.active .nav-link:after {
  width: 30px;
}

/* ==========================================================================
   3. DROPDOWN DESKTOP
   ========================================================================== */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-toggle:after {
  content: "\f107";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.8rem;
  margin-left: auto;
  transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle:after {
  transform: rotate(-180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  margin-left: -110px; /* Half width for centering */
  width: 220px;
  background-color: #FFFFFF;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 100;
  overflow: hidden;
}

.dropdown-menu:before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  margin-left: -8px;
  width: 16px;
  height: 16px;
  background-color: #FFFFFF;
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: -3px -3px 5px rgba(0, 0, 0, 0.05);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.dropdown-item {
  padding: 10px 16px;
  display: block;
  color: #333333;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.25s ease;
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
}

.dropdown-item:last-child {
  margin-bottom: 0;
}

.dropdown-item:hover {
  background-color: rgba(212, 175, 55, 0.15);
  color: #D4AF37;
  transform: translateX(5px);
}

.dropdown-item:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background-color: #D4AF37;
  transform: scaleY(0);
  transition: transform 0.3s ease;
  border-radius: 0 2px 2px 0;
}

.dropdown-item:hover:before {
  transform: scaleY(1);
}

/* ==========================================================================
   4. AUTHENTICATION BUTTONS
   ========================================================================== */

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 20px;
}

.auth-buttons .btn-login {
  background-color: transparent;
  border: 2px solid #D4AF37;
  color: #D4AF37;
  padding: 8px 20px;
  border-radius: 30px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
}

.auth-buttons .btn-login:hover {
  background-color: rgba(212, 175, 55, 0.15);
  transform: translateY(-2px);
}

.auth-buttons .btn-register {
  background-color: #D4AF37;
  color: #FFFFFF;
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
  text-decoration: none;
}

.auth-buttons .btn-register:hover {
  background-color: #333333;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(26, 26, 26, 0.3);
}

/* ==========================================================================
   5. MENU TOGGLE BUTTON
   ========================================================================== */

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 2000;
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
  position: relative;
}

.menu-toggle:hover {
  background-color: rgba(212, 175, 55, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.menu-toggle i {
  font-size: 24px;
  color: #333333;
  transition: all 0.4s ease;
}

.menu-toggle:hover i {
  color: #D4AF37;
}

/* Animation du menu toggle */
body.menu-open .menu-toggle {
  background-color: rgba(212, 175, 55, 0.15);
}

body.menu-open .menu-toggle i {
  transform: rotate(180deg);
  color: #D4AF37;
}

/* ==========================================================================
   6. MOBILE NAVIGATION
   ========================================================================== */

.nav-mobile {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #FFFFFF;
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateY(-20px);
  padding-top: 80px; /* Espace en haut pour ne pas couper les éléments */
  background: #FFFFFF;
}

/* Barre latérale */
.nav-mobile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: #D4AF37;
  z-index: 0;
}

body.menu-open .nav-mobile {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu {
  list-style: none;
  padding: 0 30px;
  margin: 20px 0 0; /* Ajout de marge supérieure pour éloigner de la barre de menu */
}

.mobile-item {
  margin-bottom: 15px;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInItem 0.5s forwards;
}

/* Animation pour les items du menu */
@keyframes slideInItem {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Délai pour chaque item */
.mobile-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-item:nth-child(5) { animation-delay: 0.3s; }
.mobile-item:nth-child(6) { animation-delay: 0.35s; }
.mobile-item:nth-child(7) { animation-delay: 0.4s; }
.mobile-item:nth-child(8) { animation-delay: 0.45s; }
.mobile-item:nth-child(9) { animation-delay: 0.5s; }
.mobile-item:nth-child(10) { animation-delay: 0.55s; }

.mobile-link {
  display: block;
  padding: 14px 0;
  color: #333333;
  font-weight: 600;
  font-size: 1.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.mobile-link:after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 0;
  height: 3px;
  background-color: #D4AF37;
  transition: width 0.3s ease;
}

.mobile-link:hover,
.mobile-item.active .mobile-link {
  color: #D4AF37;
}

.mobile-link:hover:after,
.mobile-item.active .mobile-link:after {
  width: 40px;
}

.mobile-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-dropdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(212, 175, 55, 0.15);
  transition: all 0.3s ease;
}

.mobile-dropdown-icon i {
  transition: transform 0.4s ease;
}

.mobile-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  margin-left: 20px;
  list-style: none;
  padding: 0;
  opacity: 0;
  transform: translateY(-10px);
}

.mobile-item.active-dropdown .mobile-dropdown {
  max-height: 1000px;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  padding-bottom: 10px;
}

.mobile-item.active-dropdown .mobile-dropdown-icon {
  background-color: rgba(212, 175, 55, 0.3);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.mobile-item.active-dropdown .mobile-dropdown-icon i {
  transform: rotate(180deg);
  color: #D4AF37;
}

.mobile-dropdown-link {
  padding: 12px 20px;
  display: block;
  color: #666666;
  font-weight: 500;
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  border-left: 2px solid rgba(212, 175, 55, 0.15);
}

.mobile-dropdown-link:hover {
  color: #D4AF37;
  padding-left: 25px;
  border-left: 2px solid #D4AF37;
}

.mobile-divider {
  height: 1px;
  background: linear-gradient(to right, rgba(212, 175, 55, 0.15), transparent);
  margin: 20px 0;
  width: 80%;
}

.mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 30px 30px 50px;
}

.mobile-login {
  display: block;
  padding: 16px 30px;
  text-align: center;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  background-color: rgba(212, 175, 55, 0.15);
  color: #D4AF37;
  border: 2px solid #D4AF37;
}

.mobile-login:hover {
  background-color: #D4AF37;
  color: #FFFFFF;
}

.mobile-register {
  display: block;
  padding: 16px 30px;
  text-align: center;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  background-color: #D4AF37;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.mobile-register:hover {
  background-color: #333333;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(26, 26, 26, 0.3);
}

/* ==========================================================================
   7. USER MENU DESKTOP
   ========================================================================== */

.user-menu {
  margin-left: 10px;
}

.user-menu .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #f8f9fa;
  border-radius: 30px;
  padding: 8px 18px 8px 8px;
  transition: all 0.3s ease;
}

.user-menu .nav-link:hover {
  background-color: rgba(212, 175, 55, 0.15);
}

.user-menu .nav-link:before,
.user-menu .nav-link:after {
  display: none;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #D4AF37;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.user-menu:hover .user-avatar {
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3);
}

/* ==========================================================================
   7b. USER MENU MOBILE
   ========================================================================== */

.mobile-user {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 30px;
  margin-top: 20px;
  margin-bottom: 15px;
  background-color: #f8f9fa;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  animation: fadeInDown 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: 0.05s;
  opacity: 0;
  transform: translateY(-15px);
  position: relative;
  overflow: hidden;
  border-left: 3px solid #D4AF37;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.mobile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #D4AF37;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.mobile-user-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mobile-username {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333333;
}

.mobile-email {
  font-size: 0.9rem;
  color: #666666;
}

/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
  .nav-link {
    padding: 8px 12px;
  }
  
  .auth-buttons {
    margin-left: 10px;
  }
}

@media (max-width: 990px) {
  .nav-desktop {
    display: none;
  }
  
  .menu-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .logo {
    width: 42px;
    height: 42px;
  }
  
  .logo-text {
    font-size: 1.2rem;
  }
  
  .menu-toggle {
    width: 42px;
    height: 42px;
  }
  
  .mobile-link {
    font-size: 1.3rem;
  }
  
  .mobile-dropdown-link {
    font-size: 1.1rem;
  }
  
  .mobile-auth {
    margin: 20px 20px 30px;
  }
}