html{
    scroll-behavior:smooth;
}

/* --- HEADER BASE --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: 0.35s;
  backdrop-filter: blur(10px);
}

/* Logo inside h2 */
.logo {
    display: block;
    width: 150px;
    height: 50px;
    background-image: url('images/logonew.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.logo:hover {
    opacity: 0.9;
    transform: scale(1.05);
    transition: 0.3s ease;
}

/* NAVBAR */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 8%;
  transition: 0.35s;
}

/* SCROLL EFFECT */
header.scrolled {
  background: rgba(255, 255, 255, 0.263);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

header.scrolled nav {
  padding: 12px 8%;
}

/* LOGO */
nav h2 {
  font-size: 24px;
  letter-spacing: 1px;
}

nav h2 a {
  text-decoration: none;
  color: rgb(7, 7, 7);
}

/* MENU */
.menu {
  list-style: none;
  display: flex;
  gap: 30px;
  align-items: center;
}

.menu li {
  position: relative;
}

.menu a {
  text-decoration: none;
  color: rgb(255, 255, 255);
  font-weight: 500;
  font-size: 16px;
  padding: 8px 5px;
  transition: 0.3s;
}
header.scrolled .menu a{
  color: rgb(0, 0, 0);
}

.menu a:hover {
  color: #f4c542;
}

/* --- HAMBURGER --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 2000;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: rgb(239, 239, 239);
  border-radius: 3px;
  transition: 0.35s;
}

header.scrolled .hamburger span {
    background: rgb(0, 0, 0);
}

/* HAMBURGER ANIMATION TO X */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
  background: #fff;
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  background: #fff;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
  background: #fff;
}

/* --- DROPDOWN MENU --- */
.dropdown {
  position: relative;
}

/* SUBMENU BASE */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: rgba(1, 1, 1, 0.718);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  padding: 5px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 1000;
  list-style: none;   /* removes bullets */
  margin: 0; 
}

/* SUBMENU LINKS */
.submenu a {
  display: block;
  padding: 12px 18px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.25s ease;
}
.submenu li {
  margin: 0;
  padding: 0;
}

.submenu a:hover {
  background: rgba(1, 1, 1, 0.482);
  color: #f4c542;
  padding-left: 22px;
}

.submenu li:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header.scrolled .submenu{
  background: rgba(226, 226, 226, 0.718);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15); 
}
header.scrolled .submenu a:hover {
  background: rgba(1, 1, 1, 0.402);
  color: #f8c027;
  padding-left: 22px;
}

/* --- DESKTOP HOVER ON LINK --- */
@media (min-width: 751px) {
  .dropdown:hover > a,
  .dropdown:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
  .submenu {
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }
}

/* --- MOBILE MENU --- */
@media (max-width: 750px) {
  .hamburger {
    display: flex;
  }

  .menu {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 290px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: flex-start;
    padding: 100px 30px;
    gap: 20px;
    transition: right 0.3s ease-out;
  }

  .menu.active {
    right: 0;
  }

  .logo {
    width: 120px;
    height: 40px;
  }

  .menu a {
    font-size: 18px;
    color: white;
    padding: 3px 0;
    width: 100%;
    transition: background 0.2s ease;
  }

  .menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
  }

  /* MOBILE SUBMENU */
  .submenu {
    position: relative;
    top: auto;
    left: auto;
    background: rgba(0,0,0,0.414);
    border-radius: 8px;
    padding: 3px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .submenu a {
    color: #fff;
    padding: 8px 12px;
    font-size: 17px;
  }

  header.scrolled .menu a{
    color: rgb(244, 244, 244);
  }

  .dropdown.active .submenu {
    max-height: 500px;
  }

  header.scrolled .submenu{
    background: rgba(32, 32, 32, 0.032);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15); 
  }
  header.scrolled .submenu a:hover {
    background: rgba(1, 1, 1, 0.402);
    color: #f8c027;
    padding-left: 22px;
  }

  body.menu-open {
    overflow: hidden;
  }
}

/* SHOW SUBMENU WHEN CLICKED ON ANY SCREEN */
.dropdown.active .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  max-height: 500px; /* ensures mobile and desktop click works */
}