/*
 * Mobile menu styles
 * This file contains all styles related to the mobile navigation menu
 *= require_self
 */

/* Mobile menu styling enhancements */
.mobile-menu-button {
  display: none;
}

/* Make the button visible on mobile devices */
@media (max-width: 767px) {
  .mobile-menu-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 8px;
    border-radius: 4px;
    margin-left: auto;
    background-color: transparent;
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 60;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Better touch targeting for mobile */
  .mobile-menu-button:active,
  .mobile-menu-button:focus {
    background-color: rgba(59, 130, 246, 0.1);
    outline: none;
  }
  
  /* Add a slight shadow for better visibility */
  .mobile-menu-button:hover {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: #3b82f6;
  }
  
  /* Hide desktop menu on mobile */
  .navbar-nav {
    display: none !important;
  }
  
  /* When menu is active, add overlay to rest of page */
  .mobile-menu.active::before {
    content: "";
    position: fixed;
    top: 64px; /* Match navbar height */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 40;
  }
  
  /* Improve mobile menu styles */
  .mobile-menu.active {
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Make mobile menu links more clickable */
  .mobile-menu .nav-link {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
    touch-action: manipulation;
  }
  
  .mobile-menu .nav-link:hover,
  .mobile-menu .nav-link:active,
  .mobile-menu .nav-link:focus {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
  }
  
  /* Add active state for mobile links */
  .mobile-menu .nav-link.active {
    background-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    font-weight: 500;
  }
}

/* Browser-specific fixes */
.browser-ios .mobile-menu-button {
  /* iOS needs these resets */
  -webkit-appearance: none;
  appearance: none;
}

/* iOS-specific styles */
.browser-ios .mobile-menu .nav-link {
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Touch active state for better feedback */
.mobile-menu .nav-link.mobile-touch-active,
.browser-ios .mobile-menu .nav-link:active {
  background-color: rgba(59, 130, 246, 0.2) !important;
  color: #3b82f6 !important;
}

/* Enhance mobile menu animations */
.mobile-menu {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background-color: white;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 55;
}

.mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  display: flex !important;
  flex-direction: column;
}
