/* General Navbar Styling */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: white;
  border-top: solid #e27535 10px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
  padding: 0 50px;
  margin: auto;
  position: fixed; /* Make navbar always stay at the top */
  top: 0;
  left: 0;
  width: 100%;
  transition: top 0.3s ease-in-out; /* Smooth hide/show animation */
  z-index: 1000; /* Ensure navbar stays above other content */
}

/* Navbar List */
.navbar ul {
  list-style-type: none;
  display: flex;
  align-items: center;
  padding: 0;
  margin: auto;
  height: 100%; /* Ensure the list takes full height */
}

/* Navbar Items */
.navbar .nav-items,
.link {
  position: relative;
  margin: 0 15px;
  height: 100%; /* Make nav items take full height */
  display: flex;
  align-items: center; /* Align text vertically */
}
/* Navbar Links */
.navbar a,
.link {
  text-decoration: none;
  color: #6b6b6b;
  font-weight: bold;
  font-size: 14px;
  padding: 20px 15px; /* Adjust padding to match navbar height */
  display: flex;
  align-items: center;
  height: 100%; /* Ensures full height for alignment */
  position: relative; /* Needed for ::after pseudo-element */
  cursor: pointer;
}

/* First menu item - No hover effect */
.navbar .nav-items:first-child a {
  font-size: 19px;
  color: #304b5c;
  font-family: Georgia, "Times New Roman", Times, serif;
}

/* Hover Effect Using ::after - No Movement */
.nav-items:not(:first-child)::after,
.nav-items:not(:first-child) a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0; /* Aligns at the bottom */
  width: 100%;
  height: 3px; /* Border thickness */
  background-color: #304b5c;
  transform: scaleX(0); /* Initially hidden */
  transition: transform 0.3s ease-in-out;
}

/* Show the border on hover */
.nav-items:not(:first-child):hover::after,
.nav-items:not(:first-child) a:hover::after {
  transform: scaleX(1); /* Expands border on hover */
}

/* Change text color on hover */
.nav-items:not(:first-child) a:hover {
  color: #6eacaa;
}

/* Logo */
.navbar .logo img {
  width: 70px;
  height: auto;
}

/* Flexbox for Logo and Navigation */
.navbar .logo {
  display: flex;
  align-items: center;
}

/* DROPDOWN MENU */
.nav-items {
  position: relative;
}

/* Dropdown Styling */
.nav-items .dropdown {
  display: none;
  position: absolute;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
  list-style: none;
  padding: 0; /* Remove padding to prevent overlap */
  min-width: 150px;
  top: 100%;
  left: 0;
  height: auto;
  z-index: 1000;
  transition: transform 0.3s ease-in-out;
}

/* Show dropdown on hover (EXCEPT first child) */
.nav-items:not(:first-child):hover .dropdown {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0); /* Moves into place */
}

/* Dropdown Items */
.dropdown li {
  padding: 0;
}

/* Dropdown Links */
.dropdown li a {
  font-size: 12px;
  font-weight: lighter;
  color: black;
  text-decoration: none;
  display: block;
  width: 100%;
  padding: 12px 15px;
  background-color: white; /* Ensure background is visible */
  position: relative; /* Needed for hover effect */
}

/* Hover Effect for Dropdown Items */
.dropdown li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: #e80f0f;
  transform: scaleX(0);
  transition: transform 0.3s ease-in-out;
}

/* Show the border on hover */
.dropdown li a:hover::after {
  transform: scaleX(1);
}

/* Change text color on hover */
.dropdown li a:hover {
  color: #e80f0f;
}

/* === HAMBURGER MENU ICON === */

.menu-toggle i {
  display: none;
  font-size: 28px;
  color: #2ba79d;
  cursor: pointer;
  position: absolute;
  right: 25px;
  top: 18px;
  z-index: 1100;
}
@media screen and (min-width: 800px) and (max-width: 1500px) {
  .navbar .nav-items:first-child a {
    font-size: 25px;
  }
}
@media screen and (min-width: 50px) and (max-width: 600px) {
  .navbar .nav-items:first-child a {
    font-size: 12px;
  }
}
/* === RESPONSIVE STYLES === */
@media screen and (min-width: 50px) and (max-width: 1500px) {
  .navbar {
    display: flex;
    margin: 0;
    padding: 0%;
    justify-content: left;
    overflow: visible !important;
    pointer-events: auto;
  }
  .navbar ul {
    display: block;
    margin: 0;
    padding: 0%;
    width: 100%;
  }
  .navbar .nav-items {
    margin: 0;
    padding: 0%;
    transition: max-height 0.3s ease;
    width: 100%;
  }
  .navbar .nav-items:first-child li {
    font-size: 8px;
    justify-content: center;
  }
  .navbar .nav-items ul:first-child {
    margin: 0 auto;
    font-size: 10px;
  }
  .navbar .logo img {
    width: 40px;
  }
  .menu-toggle i {
    display: block;
    margin: 0;
    padding: 0;
  }
  .menu-toggle {
    margin: 0;
    padding: 0;
  }

  .navbar .nav-items.show {
    display: block;
  }
  .navbar .nav-items .link {
    width: 100vh;
    margin: 0;
  }

  .navbar .nav-items.slide-down {
    display: block;
    animation: slideDown 0.3s ease forwards;
  }
  .navbar .nav-items.slide-up {
    animation: slideUp 0.3s ease forwards;
  }
  .nav-items:not(:first-child) {
    display: none;
  }
  .nav-items:not(:first-child).show {
    display: block;
  }

  /* DROPDOWN */

  .nav-items .dropdown {
    display: none;
    position: static; /* override absolute */
    box-shadow: none;
    padding-left: 15px;

    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-items.open .dropdown {
    display: block;
    max-height: 1000px; /* enough height to show contents */
    background-color: #d87300;
  }

  /* Optional: style dropdown items for mobile better */
  .dropdown li a {
    font-size: 14px;
    color: #ffff;
    background-color: #ca5100;
    margin: 0;
    width: 100vh;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes slideUp {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(-10px);
    }
  }
}
