/* 
 * Critical mobile menu fix
 * This ensures the mobile menu dropdown works properly
 * Updated to fix hamburger visibility and functionality
 * Added higher priority and specificity to overrule conflicts
 */

/* Critical hamburger button and menu fixes */
@media screen and (max-width: 992px) {
  /* Force hamburger to display properly */
  .hamburger {
    display: flex !important;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 40px; /* Larger width for better touch target */
    height: 30px; /* Larger height for better touch target */
    position: relative;
    z-index: 9999; /* Highest z-index to ensure it's clickable */
    padding: 5px;
    background: transparent;
    border: 2px solid #333; /* Add border for visibility */
    border-radius: 4px; /* Rounded corners */
    outline: none;
    -webkit-tap-highlight-color: transparent;
    margin-right: 15px; /* Add space on the right */
  }

  /* Ensure hamburger lines are visible and clickable */
  .hamburger .line1,
  .hamburger .line2,
  .hamburger .line3 {
    width: 100%;
    height: 3px;
    background-color: #111 !important; /* Darker color for better visibility */
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
    margin: 5px 0; /* Add space between lines */
  }

  /* Simple and reliable active state animation */
  .hamburger.active .line1 {
    transform: translateY(10px) rotate(45deg);
  }

  .hamburger.active .line2 {
    opacity: 0;
  }

  .hamburger.active .line3 {
    transform: translateY(-10px) rotate(-45deg);
  }

  /* Ensure hamburger stays visible regardless of other styles */
  nav ~ .hamburger {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Critical fix: Ensure the mobile menu appears correctly */
  .nav-links {
    position: fixed !important;
    right: -100% !important;
    top: 80px !important;
    flex-direction: column !important;
    background-color: rgba(
      0,
      0,
      0,
      0.95
    ) !important; /* Darker theme for better visibility */
    width: 80% !important;
    max-width: 300px !important;
    height: calc(100vh - 80px) !important;
    text-align: center !important;
    transition: right 0.3s ease !important;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2) !important;
    padding: 20px 0 !important;
    z-index: 9998 !important;
    overflow-y: auto !important;
    display: flex !important;
  }

  /* Critical fix: Mobile menu active state - using !important to override any conflicting styles */
  .nav-links.active {
    right: 0 !important;
    display: flex !important;
  }

  /* Improve visibility and interaction with navigation links */
  .nav-links li {
    margin: 0 !important;
    width: 100% !important;
    display: block !important;
  }

  .nav-links a {
    padding: 15px 20px !important;
    font-size: 1.1rem !important;
    width: 100% !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    display: block !important;
    text-align: left !important;
  }

  .nav-links a:hover,
  .nav-links a:active {
    background-color: rgba(255, 255, 255, 0.1) !important;
  }

  /* Ensure header has proper z-index and hamburger positioning */
  header {
    z-index: 9999 !important;
  }

  /* Ensure proper header layout */
  header .container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative !important;
  }

  /* Prevent scrolling when menu is open */
  body.no-scroll {
    overflow: hidden !important;
  }
}

/* Standalone hamburger menu fix for maximum visibility - upgraded for better visibility */
@media screen and (max-width: 992px) {
  /* More specificity for the hamburger selector */
  body header .container .hamburger,
  header .container .hamburger,
  .hamburger {
    display: flex !important;
    visibility: visible !important;
    width: 40px !important;
    height: 30px !important;
    flex-direction: column !important;
    justify-content: space-around !important;
    cursor: pointer !important;
    padding: 6px !important;
    background: rgba(
      0,
      0,
      0,
      0.1
    ) !important; /* Darker background for better contrast */
    position: absolute !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10000 !important;
    border: 2px solid #000 !important; /* Thicker black border for visibility */
    border-radius: 4px !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3) !important;
  }

  /* More specificity for the hamburger lines */
  body header .container .hamburger .line1,
  body header .container .hamburger .line2,
  body header .container .hamburger .line3,
  .hamburger .line1,
  .hamburger .line2,
  .hamburger .line3 {
    width: 100% !important;
    height: 4px !important;
    background-color: #000 !important; /* Black for maximum visibility */
    display: block !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    margin: 0 !important; /* Remove any margin that might be affecting spacing */
  }

  /* Add hover effect for better user experience */
  .hamburger:hover {
    background: rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4) !important;
  }
}
