/* ============================= */
/* 📱 Mobile Navigation (Updated & Fixed Scroll) */
/* ============================= */
@media (max-width: 991px) {
  #nav-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--color-primary-dark);
    cursor: pointer;
    z-index: 1002;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    gap: 0;
    top: 100%;
    left: 200px;
    width: 100%;
    background-color: var(--color-bg-light);
    padding: 0rem 0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1003;
    animation: slideDown 0.3s ease forwards;

    /* ✅ Make entire nav-menu scrollable when height exceeds viewport */
    max-height: 80vh;
    overflow-y: auto;
  }

  .nav-menu.nav-menu-active {
    display: flex;
  }

  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid rgba(124, 58, 237, 0.15);
    position: relative;
  }

  .nav-menu li a {
    display: block;
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
  }

  .nav-menu li a:hover {
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    color: var(--color-text-light);
  }

  .has-submenu > a::after {
    content: '▸';
    float: right;
    margin-left: 0.5rem;
    transform: rotate(0deg);
    transition: transform 0.3s;
  }

  .has-submenu > a.rotate-arrow::after {
    transform: rotate(90deg);
  }

  /* ✅ Submenu scrolls independently inside nav-menu */
  .has-submenu > .submenu {
    display: none;
    position: relative;
    background-color: #fff;
    padding: 0.3rem 0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: 25vh; /* submenu max-height */
    overflow-y: auto;
    z-index: 1002;
  }

  .submenu-active {
    display: flex;
    flex-direction: column;
  }

  .submenu li a {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
  }

  .submenu li a:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
  }
}

/* ============================= */
/* 🌑 Overlay and Scroll Lock */
/* ============================= */
body.menu-open,
body.submenu-open {
  position: fixed;        /* ✅ Fix the body in place */
  width: 100%;
  overflow-y: hidden;     /* ✅ No scroll for body */
  top: 0;
  left: 0;
}

body.menu-open::after,
body.submenu-open::after {
  content: '';
  position: fixed;
  inset: 0;
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 1001;
  pointer-events: all;
}

/* ============================= */
/* 🎬 Animations */
/* ============================= */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* EXPERIENCE MOBILE RESPONSIVE  */
@media (max-width: 768px) {
  .experience-list li {
    padding: 0.9rem 1rem;
    margin-bottom: 1.2rem;
  }

  .experience-list h3 {
    font-size: 1.1rem;
  }

  .experience-list .date {
    font-size: 0.85rem;
  }
}


/* ============================= */
/* Responsive Utility Classes (Optional) */
/* ============================= */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }
  
  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  h3 {
    font-size: 1.4rem;
  }

  p {
    font-size: 0.95rem;
  }
}
