/* ========================================
   MENU MOBILE - SLIDE-IN NAVIGATION
   DJ RAFF v2.5
   ======================================== */

/**
 * Menu mobile avec animation slide-in depuis la gauche
 * - Overlay semi-transparent avec backdrop blur
 * - Animations fluides 60fps (GPU accelerated)
 * - Accessible au clavier
 * - Responsive (caché sur desktop ≥1024px)
 */

/* ========== MENU CONTAINER ========== */

#mobile-menu {
  position: fixed;
  top: 0;
  left: -100%; /* Caché par défaut */
  width: 280px;
  height: 100vh;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow-y: auto;
  padding: 100px 0 40px 0;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
  /* GPU acceleration */
  will-change: left;
  transform: translateZ(0);
}

/* Menu actif (visible) */
#mobile-menu.active {
  left: 0;
}

/* Scrollbar personnalisée pour menu mobile */
#mobile-menu::-webkit-scrollbar {
  width: 4px;
}

#mobile-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

#mobile-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

#mobile-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ========== LOGO MENU ========== */

#mobile-menu .menu-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 24px;
}

#mobile-menu .menu-logo h2 {
  color: white;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
}

/* ========== NAVIGATION LINKS ========== */

#mobile-menu nav {
  display: flex;
  flex-direction: column;
}

#mobile-menu nav a {
  display: block;
  color: white;
  padding: 16px 24px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

/* Hover et focus states */
#mobile-menu nav a:hover,
#mobile-menu nav a:focus,
#mobile-menu nav a:active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: white;
  padding-left: 28px;
  outline: none;
}

/* Indicateur visuel lien actif (page courante) */
#mobile-menu nav a.active {
  background: rgba(255, 255, 255, 0.2);
  border-left-color: white;
  font-weight: 700;
}

/* Effet ripple au clic */
#mobile-menu nav a::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

#mobile-menu nav a:active::after {
  width: 100%;
  height: 100%;
}

/* ========== CTA BUTTON ========== */

#mobile-menu .mobile-cta {
  margin: 24px;
  padding: 16px;
  background: white;
  color: #a855f7;
  text-align: center;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#mobile-menu .mobile-cta:hover,
#mobile-menu .mobile-cta:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  outline: none;
}

#mobile-menu .mobile-cta:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========== OVERLAY ========== */

#mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px); /* Safari */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
  cursor: pointer;
}

#mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* Desktop: Masquer menu mobile complètement */
@media (min-width: 1024px) {
  #mobile-menu,
  #mobile-overlay {
    display: none !important;
  }
}

/* Mobile landscape: Réduire padding vertical */
@media (max-width: 1023px) and (max-height: 500px) {
  #mobile-menu {
    padding: 70px 0 20px 0;
  }

  #mobile-menu nav a {
    padding: 12px 24px;
  }

  #mobile-menu .mobile-cta {
    margin: 16px 24px;
    padding: 12px;
  }
}

/* ========== ACCESSIBILITÉ ========== */

/* Focus visible pour navigation clavier */
#mobile-menu:focus-within {
  outline: 2px solid white;
  outline-offset: -2px;
}

#mobile-menu nav a:focus-visible {
  outline: 2px dashed white;
  outline-offset: -4px;
}

/* Réduire animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
  #mobile-menu,
  #mobile-overlay,
  #mobile-menu nav a,
  #mobile-menu .mobile-cta {
    transition: none;
  }
}

/* ========== DARK MODE SUPPORT (futur) ========== */

@media (prefers-color-scheme: dark) {
  /* Déjà en dark par défaut (gradient purple/pink) */
  /* Ajuster si besoin en v3.0 */
}

/* ========== HIGH CONTRAST MODE ========== */

@media (prefers-contrast: high) {
  #mobile-menu {
    border-right: 2px solid white;
  }

  #mobile-menu nav a {
    border-left-width: 6px;
  }

  #mobile-menu nav a:hover,
  #mobile-menu nav a:focus {
    background: rgba(255, 255, 255, 0.3);
  }
}
