/**
 * Mobile Menu Styles
 * Smooth animations and touch-friendly design
 * Add this to your CSS or import via <style> tag
 */

/* ============================================================================
   Mobile Menu Base Styles
   ========================================================================== */

/* Hamburger button - Touch friendly (44x44px minimum) */
[data-mobile-toggle] {
  display: flex;
  width: 56px;
  height: 56px;
  padding: 12px;
  background: transparent;
  border: 2px solid #FFD700;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  z-index: 1000;
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

[data-mobile-toggle]:hover {
  background-color: rgba(255, 215, 0, 0.1);
  border-color: #FFD700;
}

[data-mobile-toggle]:focus {
  outline: 2px solid #FFD700;
  outline-offset: 2px;
}

/* Hamburger icon animation */
[data-mobile-toggle]::before,
[data-mobile-toggle]::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background-color: #FFD700;
  position: absolute;
  transition: all 0.3s ease;
  left: 50%;
  transform: translateX(-50%);
}

[data-mobile-toggle]::before {
  top: 12px;
  box-shadow: 0 8px 0 #FFD700;
}

[data-mobile-toggle]::after {
  bottom: 12px;
}

/* Hamburger active state (X icon) */
[data-mobile-toggle].hamburger-active::before {
  top: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
  box-shadow: none;
}

[data-mobile-toggle].hamburger-active::after {
  bottom: 50%;
  transform: translateX(-50%) translateY(50%) rotate(-45deg);
}

/* ============================================================================
   Mobile Menu Navigation
   ========================================================================== */

nav[role="navigation"] {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 90vw;
  height: 100vh;
  height: 100dvh;
  background-color: #050505;
  border-right: 1px solid rgba(255, 215, 0, 0.2);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: 16px;
  overscroll-behavior: contain;
}

nav[role="navigation"].mobile-menu-open {
  transform: translateX(0);
}

/* Menu list styles */
nav[role="navigation"] ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav[role="navigation"] li {
  margin: 0;
  padding: 0;
}

/* Menu links - Touch friendly (min 44px height) */
nav[role="navigation"] a {
  display: block;
  padding: 16px 20px;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

nav[role="navigation"] a:hover,
nav[role="navigation"] a:focus {
  background-color: rgba(255, 215, 0, 0.1);
  border-left-color: #FFD700;
  color: #FFD700;
  padding-left: 24px;
  outline: none;
}

nav[role="navigation"] a:active {
  background-color: rgba(255, 215, 0, 0.15);
}

/* Active navigation item */
nav[role="navigation"] a.active {
  background-color: rgba(255, 215, 0, 0.1);
  border-left-color: #FFD700;
  color: #FFD700;
  font-weight: 700;
}

/* ============================================================================
   Mobile Menu Overlay
   ========================================================================== */

[data-mobile-overlay] {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0);
  z-index: 998;
  transition: background-color 0.3s ease;
  cursor: pointer;
  pointer-events: none;
}

[data-mobile-overlay].overlay-visible {
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

/* ============================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet and up - hide mobile menu elements */
@media (min-width: 768px) {
  [data-mobile-toggle],
  [data-mobile-overlay] {
    display: none !important;
  }

  nav[role="navigation"] {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    transform: translateX(0) !important;
    padding: 0;
    overflow: visible;
  }

  nav[role="navigation"] ul {
    display: flex;
    gap: 8px;
  }

  nav[role="navigation"] li {
    margin: 0;
  }

  nav[role="navigation"] a {
    padding: 8px 16px;
    border-left: none;
    border-bottom: 2px solid transparent;
    min-height: auto;
    font-size: 14px;
  }

  nav[role="navigation"] a:hover,
  nav[role="navigation"] a:focus {
    border-left: none;
    border-bottom-color: #FFD700;
    padding-left: 16px;
  }

  nav[role="navigation"] a.active {
    border-left: none;
    border-bottom-color: #FFD700;
  }
}

/* ============================================================================
   Accessibility & Animations
   ========================================================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  [data-mobile-toggle],
  [data-mobile-toggle]::before,
  [data-mobile-toggle]::after,
  nav[role="navigation"],
  [data-mobile-overlay],
  nav[role="navigation"] a {
    transition: none !important;
  }

  [data-mobile-toggle].hamburger-active::before {
    transform: translateX(-50%) translateY(-50%) rotate(45deg);
  }

  [data-mobile-toggle].hamburger-active::after {
    transform: translateX(-50%) translateY(50%) rotate(-45deg);
  }
}

/* Focus visible for keyboard navigation */
[data-mobile-toggle]:focus-visible,
nav[role="navigation"] a:focus-visible {
  outline: 2px solid #FFD700;
  outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Lock scroll when menu is open (for body) */
body.mobile-menu-open {
  overflow: hidden;
}
