/* header.css */
/* Top Line Wrapper */
.top-line-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 10000; /* Bigger than header */
  pointer-events: none;
}

/* Active Page Line */
#active-line {
  position: absolute;
  height: 4px;
  background: #005dd6; /* Active page color */
  transition: all 0.3s ease;
  width: 0;
}

/* Hover Line */
#hover-line {
  position: absolute;
  height: 4px;
  background: #54d2ff;
  transition: all 0.3s ease;
  width: 0;
  opacity: 0; /* hidden when not hovering */
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100px;
  padding: 0 2rem;
  background: transparent;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
  transition: background 0.5s ease, padding 0.3s ease, transform 0.3s ease, opacity 0.5s ease, height 0.5s ease; /* <<< add height transition too */
  opacity: 1;
}

/* when header shrinks on scroll */
.header.scrolled {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  height: 80px;
}

.logo img {
  height: 50px;
  transition: transform 0.5s ease, height 0.5s ease;
  transform-origin: center left;
}

.header.scrolled .logo img {
  transform: scale(0.80);
  height: 50px; /* Optional tiny tweak */
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
}

/* Default: mobile-first approach */
.nav-link,
.dropdown-toggle {
  text-decoration: none;
  color: #001a40;
  padding: 0.5rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

/* Desktop only */
@media (min-width: 769px) {
  nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
  }

  .nav-link,
  .dropdown, .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center; /* Optional */
    height: 100%;
  }
}

/* BUTTON STYLE for Consultation */
.btn-consult {
  background: #005dd6;
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s;
  border: none;
  height: 40px; /* Match header height */
}

.btn-consult:hover {
  background: #1f66cc;
}

/* Dropdown */
.dropdown {
  position: relative;
  padding-top: .5rem;
  padding-bottom: .5rem;
}

@media (min-width: 769px) {
  .dropdown .arrow {
    display: none;
  }
}

/* ===== Desktop Dropdowns ===== */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%; /* Position below the dropdown toggle */
  left: 0;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: auto;
  transition: all 0.3s ease, transform 0.3s ease;
  width: 200px;
  border-radius: 8px;
}

/* Dropdown show on hover (Desktop) */
@media (min-width: 769px) {
  .dropdown:hover .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0px); /* Animate up into place */
    pointer-events: auto;
  }
}

/* Default dropdown links */
.dropdown-content a {
  display: block;
  padding: 0.75rem 1rem;
  color: #001a40;
  text-decoration: none;
  font-weight: 600;
  text-align: left;
}

.dropdown-content a:hover {
  background: #f0f0f0;
}

.dropdown-content.mega-menu {
  display: flex !important;
}



/* ===== Mega Menu Upgrade for Desktop ===== */
@media (min-width: 769px) {
  .mega-menu {
    position: fixed; /* changed from absolute */
    top: 100px; /* exactly header height */
    left: 0;
    width: 100vw; /* Full viewport width */
    height: 50vh; /* Half viewport height */
    background: white;
    padding: 4rem 6rem; /* a little breathing space */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 998; /* Just below header z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease, transform 0.3s ease;
  }

  /* On Hover */
  .dropdown:hover .mega-menu {
    opacity: 1;
    transform: translateY(0px);
    pointer-events: auto;
  }

  /* Inside columns */
  .mega-menu .mega-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .mega-link {
    display: block;
    text-decoration: none;
    padding: 0;
    margin: 0;
    gap: 0;
  }
  }
  
  .mega-label {
    display: block;
    font-weight: 600;
    color: #001a40;
    text-decoration: none;
    text-align: center;
    transition: color 0.3s ease;
  }
  
  .mega-label:hover {
    text-decoration: underline;
    text-decoration-color: #001a4070;
  }

  .mega-image-wrapper {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-top-left-radius: 35px;
    border-bottom-right-radius: 35px;
    margin: 0;
    padding: 0;
    gap: 0;
    box-sizing: border-box;
    transition: transform 0.3s ease;
  }
  
  .mega-image-wrapper img {
    width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
    padding: none;
    margin: none;
    transition: transform 0.3s ease;
  }
  
  .mega-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: #54d2ff59;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
  }
  
  .mega-image-wrapper:hover {
    transform: scale(1.05);
  }
  
  .mega-image-wrapper:hover .mega-overlay {
    opacity: 1;
  }
  
  .mega-dots {
    font-size: 2rem;
    color: white;
    font-weight: bold;
    font-family: 'Times New Roman', Times, serif;
  }

  .mega-menu .mega-column img {
    object-fit: cover;
  }

  .mega-menu .mega-column a {
    margin-top: 0.5rem;
    font-weight: 600;
    color: #001a40;
    text-decoration: none;
  }

  .mega-menu .mega-column a:hover {
    text-decoration: underline;
    text-decoration-color: #001a4070;
    background: none;
  }

/* ===== MOBILE VERSION (No Mega Menu) ===== */
@media (max-width: 768px) {
  .mega-menu {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: 0;
    background: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    gap: 0;
    margin: 0; /* No margin on mobile */
    padding: 0; /* No padding on mobile */
  }
  .mega-link,.mega-image-wrapper,
  .mega-overlay,
  .mega-dots {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .mega-menu img {
    display: none; /* No images */
  }

  .mega-menu .mega-column {
    width: 100%;
    padding-left: 1rem;
    text-align: left;
    align-items: flex-start;
  }

  .mega-menu .mega-column a {
    padding-left: 0;
    text-align: left;
  }

  .dropdown-content {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100%;
  }
}



@media (max-width: 768px) {
  .dropdown-content {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    border-left: 3px solid #00bcd4; /* LEFT LINE */
    border-top: 1px solid #ddd;
    box-shadow: none;
    display: none;
    padding-left: 1rem; /* to push text away from left line */
  }
  

  .dropdown.open .dropdown-content {
    display: block;
  }

  .arrow {
    transition: transform 0.3s ease;
  }

  .dropdown.open .arrow {
    transform: rotate(180deg); /* rotate arrow when open */
  }
}


/* Hamburger Animation */
/* Hamburger default */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 9999; /* so it stays on top */
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #000;
  transition: all 0.3s ease;
}

/* Hamburger becomes "X" */
.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
}


/* Move hamburger inside menu when active */
@media (max-width: 767px) {
  #navbar.active .hamburger {
    position: absolute;
    top: 2rem;
    right: 1rem;
  }

  .mobile-logo {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }

  .mobile-logo img {
    height: 50px;
  }

  /* Scroll Guide Line */
  .scroll-line {
    position: absolute;
    right: 10px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #000, transparent 50%, #000 100%);
    background-size: 4px 40px;
    background-repeat: repeat-y;
    animation: scrollMove 2s linear infinite;
    opacity: 0.5;
  }

  @keyframes scrollMove {
    0% {
      background-position: 0 0;
    }
    100% {
      background-position: 0 40px;
    }
  }
}

/* Hide scroll line and mobile logo on desktop */
@media (min-width: 768px) {
  .mobile-logo,
  .scroll-line {
    display: none;
  }
}


/* Mobile Navbar */
#navbar {
  display: flex;
  gap: 1rem;
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  #navbar {
    position: fixed;
    top: 0;
    left: 0; /* important: left 0 */
    width: 85%;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1rem;
    display: flex;
    transform: translateX(-100%); /* start off screen */
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 10000;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    pointer-events: none; /* block clicks when hidden */
}

#navbar.active {
    transform: translateX(0); /* slide in */
    opacity: 1;
    pointer-events: auto; /* allow clicks */
    overflow-y: auto; /* allow scrolling inside menu */
}


  .header {
    padding: 1rem;
  }
}

.no-scroll {
  overflow: hidden;
  height: 100vh;
}

/* Hide Mobile Only Stuff on Desktop */
.mobile-only {
  display: none;
}

/* Show Mobile Only Stuff when screen is mobile */
@media (max-width: 768px) {
  .mobile-only {
    display: flex;
  }
  
  .mobile-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
  }

  .mobile-navbar-header {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }

  .mobile-logo img {
    height: 40px;
  }

  .close-menu {
    font-size: 2rem;
    cursor: pointer;
  }

  .scroll-guide {
    position: absolute;
    right: 10px;
    bottom: 20px;
    font-size: 0.8rem;
    opacity: 0.5;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
  }
}

.mobile-hamburger {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mobile-hamburger span {
  width: 25px;
  height: 3px;
  background-color: #000;
  transition: all 0.3s ease;
}

.scroll-guide {
  position: absolute;
  bottom: 2rem;
  right: 1rem;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  color: gray;
  opacity: 0.7;
}


/* Hide mobile-only hamburger on desktop */
@media (min-width: 768px) {
.mobile-top,
.scroll-guide {
  display: none;
}
}


/* Mobile Menu Underlay */
#menu-underlay {
  position: fixed;
  top: 0;
  inset: 0; /* Cover full screen */
  left: 0; /* Start from very left */
  width: 100%; /* Cover full screen */
  height: 100vh;
  background: rgba(113, 181, 245, 0.6); /* semi-transparent background */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9997; /* Just behind the navbar */
}

/* When active */
#menu-underlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Default arrow style */
.arrow {
  transition: transform 0.3s ease;
  display: inline-block;
  cursor: pointer;
}

/* Rotate arrow when dropdown is open */
.dropdown.open .arrow {
  transform: rotate(180deg); /* Rotated state */
}


@media (max-width: 768px) {
  /* Smooth dropdown opening/closing */
  .dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease;
    opacity: 0;
  }

  .dropdown.open .dropdown-content {
    max-height: 500px;
    opacity: 1;
  }
}


/* Arrow rotation animation */
.arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

/* Rotated arrow */
.arrow.rotated {
  transform: rotate(180deg);
}

