/**
 * @file
 * Mobile Menu Enhancements for Commercial Pro theme
 * Additional animations and mobile-specific improvements
 */

/* Mobile menu icon animations */
.mobile-nav-links a i {
  transition: transform 0.3s ease;
  min-width: 20px;
}

.mobile-nav-links a:hover i {
  transform: scale(1.2);
}

/* Mobile menu slide in animation */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Mobile menu content staggered animation */
.mobile-menu.active .mobile-menu-content > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.mobile-menu.active .mobile-menu-close {
  animation-delay: 0.1s;
}

.mobile-menu.active .mobile-menu-search {
  animation-delay: 0.2s;
}

.mobile-menu.active .mobile-nav-links {
  animation-delay: 0.3s;
}

.mobile-menu.active .mobile-user-links {
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile menu link hover effects */
.mobile-nav-links a {
  position: relative;
  overflow: hidden;
}

.mobile-nav-links a::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.mobile-nav-links a:hover::after {
  left: 100%;
}

/* Mobile menu CTA button pulse effect */
.mobile-nav-links .btn {
  position: relative;
  overflow: hidden;
}

.mobile-nav-links .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.mobile-nav-links .btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Mobile search form enhancements */
.mobile-menu-search .search-form {
  position: relative;
  overflow: hidden;
}

.mobile-menu-search .search-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(43, 90, 135, 0.1), transparent);
  transition: left 0.8s ease;
}

.mobile-menu-search .search-form:focus-within::before {
  left: 100%;
}

/* Mobile user links enhancements */
.mobile-user-links a {
  position: relative;
  overflow: hidden;
}

.mobile-user-links a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--primary-color, #2B5A87);
  transition: width 0.3s ease;
  z-index: -1;
}

.mobile-user-links a:hover::before {
  width: 100%;
}

.mobile-user-links a:hover {
  color: white;
  border-color: var(--primary-color, #2B5A87);
}

/* Mobile menu close button enhanced */
.mobile-menu-close {
  position: relative;
}

.mobile-menu-close::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(43, 90, 135, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.mobile-menu-close:hover::before {
  width: 100%;
  height: 100%;
}

/* Mobile menu overlay fade effect */
.mobile-menu-overlay {
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Additional mobile responsiveness */
@media (max-width: 320px) {
  .mobile-menu {
    width: 100%;
  }
  
  .mobile-menu-content {
    padding: 1.5rem;
  }
  
  .mobile-nav-links a {
    padding: 0.75rem 0;
    font-size: 0.9rem;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-menu-content {
    padding: 1rem;
  }
  
  .mobile-nav-links a {
    padding: 0.5rem 0;
    font-size: 0.9rem;
  }
  
  .mobile-user-links {
    margin-top: 1rem;
    padding-top: 1rem;
  }
}

/* Light theme override - Force light colors */
@media (prefers-color-scheme: dark) {
  .mobile-menu {
    background: #f8fafc !important;
    color: #374151 !important;
  }
  
  .mobile-menu-close {
    color: #374151 !important;
  }
  
  .mobile-nav-links a {
    color: #374151 !important;
    border-bottom-color: #e5e7eb !important;
  }
  
  .mobile-nav-links a:hover {
    background: rgba(96, 165, 250, 0.1) !important;
  }
  
  .mobile-user-links a {
    color: #374151 !important;
    border-color: #e5e7eb !important;
  }
  
  .mobile-menu-search .search-form {
    background: #f3f4f6 !important;
    border-color: #e5e7eb !important;
  }
  
  .mobile-menu-search .search-form input {
    color: #374151 !important;
  }
  
  .mobile-menu-search .search-form input::placeholder {
    color: #6b7280 !important;
  }
}

/* Print styles */
@media print {
  .mobile-menu-toggle,
  .mobile-menu,
  .mobile-menu-overlay {
    display: none !important;
  }
}

/* Accessibility improvements */
.mobile-menu-toggle:focus,
.mobile-menu-close:focus,
.mobile-nav-links a:focus,
.mobile-user-links a:focus {
  outline: 2px solid var(--primary-color, #2B5A87);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu,
  .mobile-menu-overlay,
  .mobile-menu-toggle span,
  .mobile-nav-links a,
  .mobile-user-links a {
    transition: none !important;
    animation: none !important;
  }
}

/* High contrast support */
@media (prefers-contrast: high) {
  .mobile-menu {
    border: 2px solid black;
  }
  
  .mobile-nav-links a {
    border-bottom: 2px solid black;
  }
  
  .mobile-user-links a {
    border: 2px solid black;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .mobile-nav-links a {
    padding: 1.2rem 0;
  }
  
  .mobile-user-links a {
    padding: 1rem 1.2rem;
  }
  
  .mobile-menu-close {
    width: 50px;
    height: 50px;
  }
} 