/* Mobile navigation CSS - loaded directly in index.html */
@media (max-width: 640px) {
  /* Performance optimizations */
  html {
    scroll-behavior: auto !important; /* Disable smooth scrolling for better performance */
  }
  
  /* Reduce GPU usage with hardware acceleration only for essential elements */
  #mobile-nav-container {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
  }
  
  /* Disable animations during page transitions for better performance */
  .navigating * {
    transition: none !important;
    animation: none !important;
  }
  
  /* Full-height content container with no top padding on mobile */
  body {
    padding-top: 0 !important;
    overscroll-behavior: none; /* Prevent pull-to-refresh on mobile */
  }
  
  /* Remove top margin from main container */
  .min-h-screen > div:first-child,
  main, 
  div[class*="pt-"] {
    padding-top: 16px !important;
    margin-top: 0 !important;
  }
  #mobile-nav-container {
    display: flex !important; /* Show on mobile */
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #f0f0f3 !important;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.15) !important;
    z-index: 9999 !important;
    padding: 10px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
  }

  #mobile-nav-inner {
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: 100% !important;
    background-color: #f0f0f3 !important;
    border-radius: 16px !important;
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.1),
                -6px -6px 12px rgba(255, 255, 255, 0.8) !important;
    padding: 6px 0 !important;
  }

  .mobile-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 4px !important;
    color: #666 !important;
    text-decoration: none !important;
    font-family: futura-pt, Futura, "Helvetica Neue", Arial, sans-serif !important;
    transition: all 0.3s ease !important;
    border-radius: 12px !important;
    width: 18% !important;
    position: relative !important;
  }

  .mobile-nav-item:active {
    transform: scale(0.95) !important;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1),
                inset -2px -2px 5px rgba(255, 255, 255, 0.8) !important;
  }

  .mobile-nav-item.active {
    color: #B71C1C !important;
    font-weight: bold !important;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.1),
                inset -3px -3px 6px rgba(255, 255, 255, 0.8) !important;
  }

  .mobile-nav-icon {
    margin-bottom: 6px !important;
    width: 26px !important;
    height: 26px !important;
    stroke-width: 2px !important;
  }

  .mobile-nav-text {
    font-size: 13px !important;
    font-weight: 500 !important;
    letter-spacing: -0.3px !important;
  }
  
  /* Mobile profile dropdown menu */
  #mobile-profile-dropdown {
    position: fixed !important;
    bottom: 84px !important;
    right: 10px !important;
    width: 200px !important;
    background-color: #f0f0f3 !important;
    border-radius: 16px !important;
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.15),
                -6px -6px 12px rgba(255, 255, 255, 0.8) !important;
    padding: 10px 0 !important;
    z-index: 9998 !important;
    opacity: 0 !important;
    transform: translateY(20px) !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
  }
  
  #mobile-profile-dropdown.open {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: all !important;
  }
  
  .mobile-dropdown-item {
    display: flex !important;
    align-items: center !important;
    padding: 14px 16px !important;
    color: #333 !important;
    text-decoration: none !important;
    font-family: futura-pt, Futura, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 16px !important;
    transition: background-color 0.2s ease !important;
  }
  
  .mobile-dropdown-item:active {
    background-color: rgba(0, 0, 0, 0.05) !important;
  }
  
  .mobile-dropdown-item svg {
    margin-right: 12px !important;
    width: 20px !important;
    height: 20px !important;
  }
  
  .mobile-dropdown-item.logout {
    color: #B71C1C !important;
  }
  
  .mobile-dropdown-separator {
    height: 1px !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
    margin: 8px 0 !important;
  }
  
  /* Profile button special styling to show active state */
  .mobile-nav-item#nav-profile.active-dropdown {
    color: #B71C1C !important;
    font-weight: bold !important;
    background-color: rgba(183, 28, 28, 0.1) !important;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.1),
                inset -3px -3px 6px rgba(255, 255, 255, 0.8) !important;
  }

  /* Add bottom padding to main content */
  main, 
  .min-h-screen > div:nth-child(2),
  .flex-grow,
  .overflow-auto,
  .pb-24,
  [class*="pb-"] {
    padding-bottom: 100px !important;
  }
  
  /* Enhance layout for small screens */
  .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Larger text for better readability on mobile */
  h1, h2 {
    font-size: 110% !important;
  }
  
  /* Larger buttons for better touch targets */
  button {
    min-height: 42px !important;
  }
}

@media (min-width: 641px) {
  /* Forcefully hide the mobile navigation on larger screens */
  #mobile-nav-container,
  #mobile-nav-inner,
  #mobile-profile-dropdown,
  .mobile-nav-item {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
  }
}