/* Comprehensive Mobile View Fix */

/* Reset z-index stacking to ensure proper layering */
header {
  z-index: 1000;
  position: relative;
}

.nav-container {
  position: relative;
  z-index: 1000;
}

/* Fix mobile menu positioning and appearance */
@media (max-width: 768px) {
  /* Header and navigation fixes */
  header {
    padding: 15px 0;
  }

  .nav-container {
    padding: 0 15px;
  }

  /* Navigation links in mobile view */
  .nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 80px;
    transition: all 0.3s ease-in-out;
    z-index: 990;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  }

  .nav-links.active {
    left: 0;
  }

  /* Add a nav overlay */
  .nav-links::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  .nav-links.active::after {
    opacity: 1;
    visibility: visible;
  }

  /* Navigation link styling in mobile */
  .nav-links a {
    margin: 10px 0;
    padding: 12px 25px;
    width: 80%;
    text-align: center;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.2s ease;
  }

  .nav-links a:hover,
  .nav-links a:focus {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
  }

  /* Mobile menu button enhancements */
  .mobile-menu-btn {
    display: flex !important;
    margin-left: auto;
  }

  /* Improve accessibility */
  .mobile-menu-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
  }
}

/* Support for higher-density mobile screens */
@media (max-width: 480px) {
  .nav-links {
    width: 85%;
    padding-top: 70px;
  }

  .nav-links a {
    font-size: 16px;
    padding: 10px 20px;
  }
}
