/* =============================================
   ULTRA-PREMIUM MOBILE NAVIGATION
   Gainz Pro - Cinematic Mobile Menu
   ============================================= */

/* Hamburger Button */
.hamburger-btn {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10002;
  padding: 10px;
  border-radius: 12px;
  transition: background 0.3s;
  margin-left: auto;
}

.hamburger-btn:hover {
  background: oklch(100% 0 0 / 8%);
}

.hamburger-btn:focus-visible {
  outline: 2px solid var(--primary, #22c55e);
  outline-offset: 2px;
}

/* Hamburger Lines - morph to X */
.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text, #f5f5f5);
  border-radius: 2px;
  position: absolute;
  left: 10px;
  transition: all 0.25s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.hamburger-line:nth-child(1) {
  top: 14px;
}
.hamburger-line:nth-child(2) {
  top: 21px;
}
.hamburger-line:nth-child(3) {
  top: 28px;
}

/* Hamburger → X Morph */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

/* Hamburger Glow on Tap */
.hamburger-btn.active {
  background: oklch(72% 0.19 145 / 15%);
}

.hamburger-btn.active .hamburger-line {
  background: var(--primary, #22c55e);
  box-shadow: 0 0 8px var(--primary, #22c55e);
}

/* Mobile Nav Backdrop - Performance Optimized */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 80%);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-out, visibility 0.2s;
  will-change: opacity;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Glass Panel - Performance Optimized */
.mobile-nav-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: linear-gradient(180deg, oklch(12% 0 0) 0%, oklch(6% 0 0) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid oklch(100% 0 0 / 12%);
  border-radius: 24px 24px 0 0;
  z-index: 10001;
  padding: 20px 24px 40px;
  transform: translateY(100%) translateZ(0);
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  box-shadow: 0 -8px 30px oklch(0% 0 0 / 40%);
}

.mobile-nav-panel.active {
  transform: translateY(0) translateZ(0);
}

/* Panel Grab Handle */
.mobile-nav-handle {
  width: 40px;
  height: 4px;
  background: oklch(100% 0 0 / 25%);
  border-radius: 2px;
  margin: 0 auto 28px;
}

/* Nav Links Container */
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

/* Individual Nav Link - Performance Optimized */
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: oklch(100% 0 0 / 4%);
  border: 1px solid oklch(100% 0 0 / 6%);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text, #f5f5f5);
  transition: transform 0.15s ease-out, opacity 0.15s ease-out, background 0.15s, border-color 0.15s;
  opacity: 0;
  transform: translateY(16px) translateZ(0);
  will-change: transform, opacity;
}

.mobile-nav-link.visible {
  opacity: 1;
  transform: translateY(0) translateZ(0);
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
  background: oklch(72% 0.19 145 / 12%);
  border-color: oklch(72% 0.19 145 / 25%);
}

.mobile-nav-link:active {
  transform: scale(0.98) translateZ(0);
}

/* Link Icon */
.mobile-nav-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, oklch(72% 0.19 145 / 20%) 0%, oklch(72% 0.19 145 / 8%) 100%);
  border-radius: 12px;
  flex-shrink: 0;
}

.mobile-nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--primary, #22c55e);
  stroke-width: 2;
  fill: none;
}

/* Link Text */
.mobile-nav-text {
  display: flex;
  flex-direction: column;
}

.mobile-nav-label {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #f5f5f5);
}

.mobile-nav-sublabel {
  font-size: 13px;
  color: var(--text-muted, #888);
  margin-top: 2px;
}

/* Nav Arrow */
.mobile-nav-arrow {
  margin-left: auto;
  width: 20px;
  height: 20px;
  stroke: var(--text-muted, #888);
  opacity: 0.5;
  transition: transform 0.2s, opacity 0.2s;
}

.mobile-nav-link:hover .mobile-nav-arrow {
  transform: translateX(4px);
  opacity: 1;
  stroke: var(--primary, #22c55e);
}

/* Theme Toggle Row */
.mobile-nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: oklch(100% 0 0 / 3%);
  border: 1px solid oklch(100% 0 0 / 6%);
  border-radius: 16px;
  margin-bottom: 20px;
}

.mobile-nav-controls-label {
  font-size: 14px;
  color: var(--text-muted, #888);
}

/* Theme Toggle Button (Mobile Panel Version) */
.mobile-theme-toggle {
  position: relative;
  width: 56px;
  height: 32px;
  background: oklch(20% 0 0);
  border: 1px solid oklch(100% 0 0 / 12%);
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.3s;
  overflow: hidden;
}

.mobile-theme-toggle::before {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  background: oklch(95% 0 0);
  border-radius: 50%;
  top: 2px;
  left: 3px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  box-shadow: 0 2px 8px oklch(0% 0 0 / 30%);
}

/* Footer Links */
.mobile-nav-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid oklch(100% 0 0 / 6%);
}

.mobile-nav-footer a {
  font-size: 13px;
  color: var(--text-muted, #888);
  text-decoration: none;
  transition: color 0.2s;
}

.mobile-nav-footer a:hover {
  color: var(--primary, #22c55e);
}

/* Show hamburger on mobile, hide nav-links */
@media (max-width: 768px) {
  .hamburger-btn {
    display: block;
  }

  .nav-links {
    display: none !important;
  }

  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mobile-nav-panel {
    transition: opacity 0.15s;
    transform: none;
  }

  .mobile-nav-panel:not(.active) {
    opacity: 0;
    visibility: hidden;
  }

  .mobile-nav-panel.active {
    opacity: 1;
    visibility: visible;
  }

  .mobile-nav-link {
    opacity: 1;
    transform: none;
  }

  .hamburger-line {
    transition: none;
  }
}

/* Hide old mobile menu elements if they exist */
.mobile-menu-btn,
.mobile-menu-drawer,
.nav-overlay {
  display: none !important;
}
