/**
 * Navbar Component Styles
 * Minimal CSS for reusable navbar component
 */

/* Navbar Container - Sticky Wrapper */
#navbar-container,
navbar-component {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  display: block;
}

/* Ensure body has scroll padding for sticky header */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* Adjust based on header height */
}

/* Header Sticky Behavior */
#main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: white;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  will-change: transform;
}

#main-header.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile Menu Styles */
#mobile-nav {
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Mobile menu overlay and slide-in */
@media (max-width: 1023px) {
  #mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    background: white;
    padding: 24px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    opacity: 0;
    transform: translateX(-100%);
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  #mobile-nav.mobile-menu {
    left: 0;
    opacity: 1;
    transform: translateX(0);
  }

  #mobile-nav ul {
    display: flex;
    flex-direction: column;
    gap: 20px;
    list-style: none;
    padding: 0 20px;
    margin: 0;
    align-items: flex-start;
  }

  #mobile-nav ul li {
    padding: 0;
    width: 100%;
  }

  #mobile-nav ul li a {
    display: block;
    padding: 12px 0;
    font-size: 18px;
    color: #6A6A6A;
    text-decoration: none;
    transition: color 0.2s ease;
    text-align: left;
  }

  #mobile-nav ul li a:hover,
  #mobile-nav ul li a.active {
    color: #287ABD;
  }

  #close-icon {
    align-self: flex-end;
    cursor: pointer;
    width: 24px;
    height: 24px;
  }

  /* Body overlay when menu is open */
  body.mobile-menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    animation: fadeIn 0.3s ease-in-out;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  /* Prevent body scroll when menu is open */
  body.mobile-menu-open {
    overflow: hidden;
  }
}

/* Desktop Navigation Styles */
@media (min-width: 1024px) {
  #mobile-nav {
    display: flex;
    align-items: center;
    gap: 32px;
  }

  #mobile-nav ul {
    display: flex;
    gap: 32px;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
  }

  #mobile-nav ul li a {
    color: #6A6A6A;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap;
  }

  #mobile-nav ul li a:hover,
  #mobile-nav ul li a.active {
    color: #287ABD;
  }

  #close-icon {
    display: none;
  }
}

/* Mobile Menu Toggle Button */
#mobile-menu-toggle {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/* Active Link Indicator */
#mobile-nav a.active {
  position: relative;
  color: #287ABD;
  font-weight: 600;
}


/* Smooth transitions */
#mobile-nav a {
  transition: all 0.2s ease;
}

/* Ensure sections appear below sticky header */
section {
  scroll-margin-top: 100px;
}

/* Header Sticky Behavior */
header {
  transition: box-shadow 0.3s ease;
}

header.scrolled {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Logo hover effect */
#logo {
  transition: opacity 0.2s ease;
}

#logo:hover {
  opacity: 0.8;
}

/* CTA Button styles (if not already defined) */
.btn-primary {
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 122, 189, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}
