/* Custom Navigation Styles */

/* Navbar base styles */
.navbar {
  padding: 15px 0;
  transition: all 0.3s ease;
  background-color: #000; /* Black background */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1030 !important;
  will-change: transform; /* Optimize for animations */
  height: auto; /* Allow height to adjust based on logo size */
}

/* Navbar when scrolled */
.navbar.scrolled {
  padding: 10px 0;
  background-color: rgba(0, 0, 0, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Add padding to body to prevent content from being hidden under fixed navbar */
body {
  padding-top: 280px; /* Adjusted for the larger initial logo (250px + padding) */
  overflow-x: hidden; /* Prevent horizontal scrollbars */
  width: 100%;
  max-width: 100vw;
  position: relative;
}

/* Adjust body padding when navbar is scrolled */
body.scrolled-nav {
  padding-top: 110px; /* Adjusted for the smaller scrolled logo (80px + padding) */
}

/* Logo styles - Basic positioning only (animations in logo-animation.css) */
.navbar-brand {
  padding: 0;
  margin-right: 20px;
  display: flex;
  align-items: center;
  overflow: visible; /* Allow logo animations to overflow */
}

.logo-img {
  max-height: 250px;
  height: 250px;
  width: auto;
  /* Transition handled in logo-animation.css */
}

/* Navigation links */
.navigation-link {
  color: #fff;
  font-weight: 500;
  padding: 10px 15px;
  transition: all 0.2s ease;
  position: relative;
}

.navigation-link:hover,
.navigation-link:focus {
  color: #f8f8f8;
  text-decoration: none;
}

.navigation-link:after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: #fff;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navigation-link:hover:after,
.nav-item.active .navigation-link:after {
  width: 80%;
}

.nav-item.active .navigation-link {
  font-weight: 600;
  color: #fff;
}

/* Desktop navigation */
.nav-desktop {
  margin-left: auto;
}

/* Mobile menu button */
.menu-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px 15px 10px 10px; /* Added more padding on the right side */
  z-index: 1000;
  margin-right: 10px; /* Additional right margin */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Add extra padding for the container on mobile */
@media (max-width: 768px) {
  .navbar-header {
    padding-right: 10px;
  }

  .menu-button {
    margin-right: 15px; /* More margin on smaller screens */
    padding-right: 20px; /* Extra padding on the right */
  }

  /* Ensure the container has enough space */
  .container-fluid {
    padding-right: 15px !important;
  }
}

.menu-icon {
  width: 30px;
  height: 20px;
  position: relative;
  margin-right: 5px; /* Add right margin to the icon */
}

.menu-icon-top,
.menu-icon-middle,
.menu-icon-bottom {
  position: absolute;
  height: 2px;
  width: 100%;
  background: #fff; /* Changed to white to match the theme */
  transition: all 0.3s ease;
}

.menu-icon-top {
  top: 0;
}

.menu-icon-middle {
  top: 50%;
  transform: translateY(-50%);
}

.menu-icon-bottom {
  bottom: 0;
}

.menu-button.collapsed .menu-icon-top {
  transform: rotate(45deg);
  top: 9px;
}

.menu-button.collapsed .menu-icon-middle {
  opacity: 0;
}

.menu-button.collapsed .menu-icon-bottom {
  transform: rotate(-45deg);
  bottom: 9px;
}

/* Mobile navigation */
@media (max-width: 991px) {
  .navbar-collapse {
    position: fixed; /* Changed from absolute to fixed */
    top: 280px; /* Match the initial navbar height with large logo */
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.98); /* Changed to dark background */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    padding: 20px;
    z-index: 1040; /* Higher than the navbar */
    max-height: calc(100vh - 280px); /* Limit height to viewport */
    overflow-y: auto; /* Allow scrolling if needed */
    transition: all 0.3s ease; /* Smooth transitions */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px); /* Start slightly above */
  }

  /* Adjust mobile menu position when navbar is scrolled */
  .navbar.scrolled + .navbar-collapse,
  .navbar.scrolled .navbar-collapse {
    top: 110px; /* Match the scrolled navbar height with smaller logo */
    max-height: calc(100vh - 110px); /* Adjust max height accordingly */
  }

  /* When menu is shown */
  .navbar-collapse.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Reset position */
    display: block !important;
  }

  .navbar-nav {
    margin: 0;
    padding: 20px 0;
  }

  .navbar-nav > li {
    margin-bottom: 15px;
    text-align: center;
  }

  .navigation-link {
    display: block;
    padding: 15px 0;
    color: white !important; /* White text for dark background */
    font-size: 18px;
    transition: all 0.3s ease;
  }

  .navigation-link:hover,
  .nav-item.active .navigation-link {
    color: #f8f8f8 !important;
    transform: translateX(5px);
  }

  .navigation-link:after {
    left: 0;
    transform: none;
    background-color: white; /* White underline */
  }

  .navigation-link:hover:after,
  .nav-item.active .navigation-link:after {
    width: 30px;
  }

  /* Fix for menu closing too quickly */
  .navbar-collapse.show,
  .navbar-collapse.collapsing {
    display: block !important;
  }

  /* Prevent menu from closing on hover */
  .navbar-collapse:hover,
  .navbar-collapse:focus,
  .navbar-collapse:active {
    display: block !important;
  }

  /* Style the toggle button */
  .menu-button {
    z-index: 1000;
    position: relative;
    transition: all 0.3s ease;
  }

  /* Improve tap target size */
  .menu-icon {
    width: 30px;
    height: 24px;
    padding: 10px;
    margin: -10px;
  }

  /* Active state for menu button */
  .menu-button.active .menu-icon-top {
    transform: rotate(45deg);
    top: 50%;
    margin-top: -1px;
  }

  .menu-button.active .menu-icon-middle {
    opacity: 0;
  }

  .menu-button.active .menu-icon-bottom {
    transform: rotate(-45deg);
    bottom: 50%;
    margin-bottom: -1px;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991px) {
  .navbar-header {
    padding: 0 15px;
  }
}

/* Smaller screens */
@media (max-width: 576px) {
  .logo-img {
    height: 40px !important;
  }

  .navbar {
    padding: 10px 0;
  }
}
