/* NAV Bar CSS Variables */
   
/* :root {
      --bg-dark: #1e1e1e;
      --card-bd-hover: #4a9eda;
      --space-xs: 8px;
      --space-sm: 12px;
      --space-lg: 24px;
      --space-xl: 32px;
      --text-base: 16px;
      --text-2xl: 24px;
    } */

    /* Reset */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      min-height: 200vh; /* For scroll testing */
    }

    /* NAVBAR STYLES */
    .navbar {
      position: sticky;
      top: 0;
      left: 0;
      right: 0;
      background-color: var(--bg-dark);
      padding: var(--space-sm) var(--space-xl);
      z-index: 1000;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }

    .navbar-container {
      max-width: 1200px;
      margin: 0 auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: relative;
    }

    .navbar-logo {
      font-size: var(--text-2xl);
      font-weight: bold;
      color: var(--card-bd-hover);
    }

    .navbar-logo a {
      text-decoration: none;
      color: inherit;
      display: flex;
      align-items: center;
    }

    .navbar-logo-img {
      height: 50px;
      width: auto;
      display: block;
    }

    /* If image fails to load, show text */
    .navbar-logo-text {
      display: none;
      font-size: 24px;
      font-weight: bold;
      color: var(--card-bd-hover);
    }

    /* DESKTOP MENU STYLES */
    .navbar-menu {
      list-style: none;
      display: flex;
      flex-direction: row;
      gap: var(--space-lg);
      margin: 0;
      padding: 0;
      align-items: center;
    }

    .navbar-menu li {
      position: relative;
    }

    .navbar-menu li a {
      color: white;
      text-decoration: none;
      font-size: var(--text-base);
      padding: 8px 12px;
      border-radius: 4px;
      transition: all 0.3s ease;
      display: block;
      white-space: nowrap;
      position: relative; /* ADDED: Enables ::after pseudo-element for active section underline */
    }

    .navbar-menu li a:hover {
      color: var(--card-bd-hover);
      background: rgba(255, 255, 255, 0.1);
    }

    /* DROPDOWN STYLES */
    .dropdown {
      position: relative;
    }

    .dropdown > a::after {
      content: ' ▾';
      font-size: 12px;
    }

    .dropdown-menu {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      background-color: var(--bg-dark);
      margin-top: 0px;
      padding: var(--space-sm) 0;
      border-radius: 4px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      list-style: none;
      min-width: 160px;
      z-index: 999;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Add invisible bridge to maintain hover state */
.dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px; /* Invisible bridge height */
  display: block;
  z-index: 998;
}

    .dropdown-menu li {
      margin: 0;
    }

    .dropdown-menu li a {
      padding: var(--space-xs) var(--space-lg);
      color: white;
      text-decoration: none;
      display: block;
      font-size: 14px;
    }

    .dropdown-menu li a:hover {
      background-color: rgba(255, 255, 255, 0.05);
      color: var(--card-bd-hover);
    }

/* Ensure dropdown shows on hover for desktop */
@media (min-width: 769px) {
  .dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.3s ease;
  }
  
  /* Optional: Add slight delay to prevent accidental hover */
  .dropdown-menu {
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
}

    /* HAMBURGER BUTTON - HIDDEN ON DESKTOP */
    .navbar-toggle {
      display: none;
      background: none;
      border: none;
      cursor: pointer;
      padding: 10px;
      width: 44px;
      height: 44px;
      position: relative;
      z-index: 1001;
    }

    /* Hamburger lines */
    .navbar-toggle span,
    .navbar-toggle span::before,
    .navbar-toggle span::after {
      display: block;
      width: 24px;
      height: 2px;
      background: white;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      transition: all 0.3s ease;
    }

    .navbar-toggle span {
      top: 50%;
      transform: translate(-50%, -50%);
    }

    .navbar-toggle span::before {
      content: '';
      top: -8px;
    }

    .navbar-toggle span::after {
      content: '';
      bottom: -8px;
    }

    /* Active hamburger animation */
    .navbar-toggle.active span {
      background: transparent;
    }

    .navbar-toggle.active span::before {
      top: 0;
      transform: translateX(-50%) rotate(45deg);
    }

    .navbar-toggle.active span::after {
      bottom: 0;
      transform: translateX(-50%) rotate(-45deg);
    }

    /* MOBILE STYLES */
    @media screen and (max-width: 768px) {
      .navbar {
        padding: var(--space-sm) var(--space-lg);
      }

      /* Show hamburger button */
      .navbar-toggle {
        display: block;
      }
      
      /* Hide menu by default, position it absolutely */
      .navbar-menu {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        right: var(--space-lg);
        background: rgba(30, 30, 30, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        min-width: 220px;
        max-width: calc(100vw - 40px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        gap: 4px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
      }
      
      /* Show menu when active */
      .navbar-menu.active {
        display: flex;
        animation: slideIn 0.3s ease;
      }
      
      /* Mobile menu items */
      .navbar-menu li {
        margin: 0;
        width: 100%;
      }
      
      .navbar-menu li a {
        padding: 12px 16px;
        width: 100%;
        text-align: left;
        border-radius: 6px;
      }
      
      /* Mobile dropdown adjustments */
      .dropdown > a::after {
        float: right;
      }

      .dropdown-menu {
        position: static;
        background: transparent;
        box-shadow: none;
        border: none;
        padding: 0;
        margin-left: 20px;
        margin-top: 4px;
        display: none;
      }
      
      .dropdown.active .dropdown-menu {
        display: block;
      }
      
      .dropdown-menu li a {
        font-size: 14px;
        color: rgba(255, 255, 255, 0.8);
        padding: 8px 16px;
      }
    }

    /* Animations */
    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes slideIn {
      from {
        opacity: 0;
        transform: translateX(20px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    /* Content sections for demo */
    .section {
      padding: 80px 20px;
      max-width: 1200px;
      margin: 0 auto;
      text-align: center;
    }

    .section h2 {
      color: white;
      font-size: 36px;
      margin-bottom: 20px;
    }

    .section p {
      color: rgba(255, 255, 255, 0.9);
      font-size: 18px;
      line-height: 1.6;
    }

    .section:nth-child(even) {
      background: rgba(0, 0, 0, 0.1);
    }
  
    /* Active Section Highlighting Styles */

/* Desktop styles for active section */
.navbar-menu > li > a.active-section,
.navbar-menu > li.active-section > a {
  color: #FFC20E; /* Highlight color - adjust to match your theme */
  font-weight: 600;
  position: relative;
}

/* Add an underline indicator for active section */
.navbar-menu > li > a.active-section::after,
.navbar-menu > li.active-section > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #FFC20E; /* Match the highlight color */
  animation: slideIn 0.3s ease-out;
}

/* Animation for the underline */
@keyframes slideIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Style for dropdown items when active */
.dropdown-menu a.active-section {
  background-color: rgba(255, 194, 14, 0.1);
  color: #FFC20E;
  font-weight: 600;
}

/* When Writing section children are active, highlight Writing too */
.dropdown:has(.dropdown-menu a.active-section) > a {
  color: #FFC20E;
}

/* Mobile styles for active section */
@media (max-width: 768px) {
  .navbar-menu > li > a.active-section,
  .navbar-menu > li.active-section > a {
    background-color: rgba(255, 194, 14, 0.1);
    border-left: 3px solid #FFC20E;
    padding-left: calc(1rem - 3px); /* Adjust padding to account for border */
  }
  
  .navbar-menu > li > a.active-section::after,
  .navbar-menu > li.active-section > a::after {
    display: none; /* Hide underline on mobile */
  }
}

/* Optional: Add smooth transition for color changes */
.navbar-menu a {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Optional: Different style for hover vs active */
.navbar-menu > li > a:hover:not(.active-section) {
  color: rgba(255, 194, 14, 0.8); /* Lighter shade for hover */
}

/* Dark theme support (if you have a dark mode) */
@media (prefers-color-scheme: dark) {
  .navbar-menu > li > a.active-section,
  .navbar-menu > li.active-section > a {
    color: #4db8ff;
  }
  
  .navbar-menu > li > a.active-section::after,
  .navbar-menu > li.active-section > a::after {
    background-color: #4db8ff;
  }
  
  .dropdown-menu a.active-section {
    background-color: rgba(77, 184, 255, 0.1);
    color: #4db8ff;
  }
  
  @media (max-width: 768px) {
    .navbar-menu > li > a.active-section,
    .navbar-menu > li.active-section > a {
      background-color: rgba(77, 184, 255, 0.1);
      border-left-color: #4db8ff;
    }
  }
}

/* ===== NAVBAR LOGO EFFECTS ===== */

/* Base logo styling */
.navbar-logo-img {
  height: 50px; /* adjust as needed */
  width: auto;
  display: inline-block;
  animation: pulse 2.5s infinite ease-in-out;
  filter: drop-shadow(0 0 6px rgba(255, 194, 14, 0.6)); /* soft glow */
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Add a hover effect for extra interactivity */
.navbar-logo-img:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px rgba(255, 194, 14, 0.9));
}

/* Pulse animation just for navbar logo */
@keyframes navbar-logo-pulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 6px rgba(255, 194, 14, 0.6));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 14px rgba(255, 194, 14, 1));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 6px rgba(255, 194, 14, 0.6));
  }
}

/* Apply namespaced animation */
.navbar-logo-img {
  animation: navbar-logo-pulse 2.5s infinite ease-in-out;
}

