/**
 * Mobile Menu - Cyberpunk Enhanced
 * King Size Game Theme
 */

/* ==========================================================================
   MOBILE MENU TOGGLE BUTTON
   ========================================================================== */

.menu-toggle {
  display: none;
  position: relative;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 2px solid var(--cyan-neon);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 1002;
}

.menu-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(255, 0, 255, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-toggle:hover::before {
  opacity: 1;
}

.menu-toggle:hover {
  border-color: var(--magenta-neon);
  box-shadow:
    0 0 20px rgba(0, 240, 255, 0.4),
    0 0 40px rgba(255, 0, 255, 0.2);
  transform: scale(1.05);
}

.menu-toggle:active {
  transform: scale(0.95);
}

/* Hamburger Icon */
.menu-toggle-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cyan-neon);
  margin: 0 auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px currentColor;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--cyan-neon);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px currentColor;
}

.menu-toggle-icon::before {
  top: -8px;
}

.menu-toggle-icon::after {
  top: 8px;
}

/* Active State - Transform to X */
.menu-toggle.active .menu-toggle-icon {
  background: transparent;
  box-shadow: none;
}

.menu-toggle.active .menu-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
  background: var(--magenta-neon);
}

.menu-toggle.active .menu-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
  background: var(--magenta-neon);
}

.menu-toggle.active {
  border-color: var(--magenta-neon);
  background: rgba(255, 0, 255, 0.05);
}

/* ==========================================================================
   MOBILE MENU OVERLAY
   ========================================================================== */

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Animated Grid Background */
.mobile-menu-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
  opacity: 0.5;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* Scanlines Effect */
.mobile-menu-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 240, 255, 0.02) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* ==========================================================================
   MOBILE MENU CONTENT
   ========================================================================== */

.mobile-menu-content {
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 400px;
  height: 100%;
  background: rgba(16, 18, 30, 0.98);
  border-left: 2px solid var(--cyan-neon);
  box-shadow:
    -10px 0 40px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(0, 240, 255, 0.2);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.admin-bar .mobile-menu-content {
  top: 32px;
  height: calc(100% - 32px);
}

.mobile-menu-content.active {
  transform: translateX(0);
}

/* Scrollbar Styling */
.mobile-menu-content::-webkit-scrollbar {
  width: 6px;
}

.mobile-menu-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.mobile-menu-content::-webkit-scrollbar-thumb {
  background: var(--cyan-neon);
  border-radius: 3px;
}

.mobile-menu-content::-webkit-scrollbar-thumb:hover {
  background: var(--magenta-neon);
}

/* Menu Header */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  background: rgba(0, 240, 255, 0.03);
}

.mobile-menu-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cyan-neon);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
  text-shadow: 0 0 10px currentColor;
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px solid var(--magenta-neon);
  border-radius: 6px;
  color: var(--magenta-neon);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-close:hover {
  background: rgba(255, 0, 255, 0.1);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
  transform: rotate(90deg);
}

.mobile-menu-close svg {
  width: 20px;
  height: 20px;
}

/* Menu Navigation */
.mobile-menu-nav {
  padding: 32px 20px;
}

.mobile-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-menu > li {
  margin-bottom: 8px;
  opacity: 0;
  transform: translateX(30px);
  animation: slideInMenu 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mobile-nav-menu > li:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav-menu > li:nth-child(2) { animation-delay: 0.15s; }
.mobile-nav-menu > li:nth-child(3) { animation-delay: 0.2s; }
.mobile-nav-menu > li:nth-child(4) { animation-delay: 0.25s; }
.mobile-nav-menu > li:nth-child(5) { animation-delay: 0.3s; }
.mobile-nav-menu > li:nth-child(6) { animation-delay: 0.35s; }

@keyframes slideInMenu {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-nav-menu a {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  background: rgba(0, 240, 255, 0.03);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.mobile-nav-menu a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--cyan-neon);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  box-shadow: 0 0 10px var(--cyan-neon);
}

.mobile-nav-menu a:hover::before,
.mobile-nav-menu a:focus::before {
  transform: scaleY(1);
}

.mobile-nav-menu a::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(0, 240, 255, 0.1),
    transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-menu a:hover::after,
.mobile-nav-menu a:focus::after {
  opacity: 1;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a:focus {
  color: #FFFFFF;
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateX(8px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(0, 240, 255, 0.2);
}

.mobile-nav-menu a:active {
  transform: translateX(4px) scale(0.98);
}

/* Current Menu Item */
.mobile-nav-menu .current-menu-item > a {
  color: var(--cyan-neon);
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--cyan-neon);
  font-weight: 700;
  box-shadow:
    0 0 20px rgba(0, 240, 255, 0.3),
    inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.mobile-nav-menu .current-menu-item > a::before {
  transform: scaleY(1);
  background: var(--magenta-neon);
  box-shadow: 0 0 15px var(--magenta-neon);
}

/* Menu Icon (optional) */
.menu-item-icon {
  margin-right: 12px;
  font-size: 1.2em;
  opacity: 0.7;
}

/* Menu Footer */
.mobile-menu-footer {
  padding: 24px 20px;
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  margin-top: auto;
}

.mobile-menu-social {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.mobile-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  color: var(--cyan-neon);
  transition: all 0.3s ease;
}

.mobile-social-link:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-neon);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 240, 255, 0.3);
}

.mobile-social-link svg {
  width: 20px;
  height: 20px;
}

.mobile-menu-info {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
}

.mobile-menu-info a {
  color: var(--cyan-neon);
  text-decoration: none;
  transition: color 0.3s ease;
}

.mobile-menu-info a:hover {
  color: var(--magenta-neon);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hide desktop menu on mobile */
  .main-navigation .nav-menu {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .mobile-menu-content {
    width: 90%;
  }

  .mobile-nav-menu a {
    font-size: 0.9rem;
    padding: 14px 16px;
  }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Focus visible */
.menu-toggle:focus-visible,
.mobile-menu-close:focus-visible {
  outline: 2px solid var(--cyan-neon);
  outline-offset: 2px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu-overlay,
  .mobile-menu-content,
  .mobile-nav-menu > li {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .mobile-menu-content {
    border-left-width: 3px;
  }

  .mobile-nav-menu a {
    border-width: 2px;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: light) {
  /* Adjustments for light mode if needed */
}
