/* ===== CSS VARIABLES ===== */
:root {
  --primary-navy: #0a1628;
  --primary-navy-light: #132241;
  --primary-navy-dark: #050d18;
  --accent-red: #e63946;
  --accent-red-hover: #ff1a2b;
  --white: #ffffff;
  --gray-light: #f5f5f5;
  --gray: #888888;
  --text-dark: #1a1a1a;
  --text-light: #cccccc;
}

/* ===== LOGO BAR (White Background) ===== */
.logo-bar {
  /* background: #919191; */
  padding: 15px 0;
  background-image: url("/assets/bg-header.png");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid #eaeaea;
}

.logo-bar .container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 50px;
  height: 50px;
  background: var(--primary-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-navy);
}

.logo-text span {
  color: var(--accent-red);
}

.social-icons {
  display: flex;
  gap: 15px;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.social-icons a {
  width: 40px;
  height: 40px;
  background: var(--white);
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s ease;
  border-radius: 50%;
  border: 2px solid var(--primary-navy);
}

.social-icons a:hover {
  background: var(--primary-navy);
  color: var(--white);
  transform: translateY(-3px);
}

/* Mobile Menu Toggle di Logo Bar */
.mobile-menu-toggle {
  display: none;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--primary-navy);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 10px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  color: var(--accent-red);
}

/* ===== NAVIGATION (Navy Background) ===== */
.navbar {
  background: var(--primary-navy);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

/* Desktop only: navbar fixed saat scroll */
@media (min-width: 769px) {
  .navbar.scrolled {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
  }
}

.navbar .container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Logo di dalam navbar (muncul saat scroll - desktop only) */
.navbar-logo {
  display: none;
  /* Hidden by default */
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.navbar-logo img {
  width: 40px;
  height: auto;
}

/* Desktop only: saat navbar scrolled, logo muncul dan menu geser */
@media (min-width: 769px) {
  .navbar-logo {
    display: block;
  }

  .navbar.scrolled .navbar-logo {
    opacity: 1;
  }

  .nav-menu {
    transition: transform 0.3s ease;
  }

  .navbar.scrolled .nav-menu {
    transform: translateX(25px);
  }
}

.nav-menu {
  display: flex;
  gap: 0;
  list-style: none;
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  display: block;
  padding: 20px 25px;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent-red);
  transition: width 0.3s ease;
}

.nav-menu a:hover {
  background: var(--primary-navy-light);
}

.nav-menu a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 20px;
}

/* Close button - hidden on desktop */
.nav-close-btn {
  display: none;
}

/* Dropdown CSS */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: block;
  /* Always block for animation, control with visibility */
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--primary-navy);
  min-width: 250px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  padding: 0;
  transform: translateY(-20px);
  /* Start slightly down */
  transition: all 0.3s ease;
  list-style: none;
}

.dropdown:hover .dropdown-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-menu a {
  padding: 15px 20px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-transform: uppercase;
}

.dropdown-menu a:hover {
  background: var(--primary-navy-light);
  padding-left: 25px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  /* Styles for tablets can go here if needed */
}

@media (max-width: 768px) {

  /* Navbar container sticky di mobile */
  #navbar-container {
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-navy);
    flex-direction: column;
    z-index: 9999;
    padding-top: 60px;
    overflow-y: auto;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition:
      transform 0.4s ease,
      opacity 0.3s ease,
      visibility 0.3s ease;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu a {
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-menu li {
    width: 100%;
  }

  /* Close button untuk mobile menu */
  .nav-close-btn {
    display: block;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--white);
    cursor: pointer;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    z-index: 10000;
  }

  .nav-close-btn:hover {
    color: var(--accent-red);
  }

  /* Dropdown di mobile dengan animasi slide */
  .dropdown-menu {
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    background: var(--primary-navy-dark);
    box-shadow: none;
    min-width: 100%;
    /* Animasi slide menggunakan max-height */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }

  /* Saat active, dropdown slide turun */
  .dropdown.active .dropdown-menu {
    max-height: 500px;
    /* Cukup besar untuk menampung semua item */
    transition: max-height 0.4s ease-in;
  }

  /* Disable hover pada mobile, hanya gunakan click */
  .dropdown:hover .dropdown-menu {
    max-height: 0;
  }

  .dropdown.active:hover .dropdown-menu {
    max-height: 500px;
  }

  .navbar .container {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .logo-bar .container {
    flex-direction: column;
  }

  .logo-bar {
    padding: 0 !important;
  }

  .social-icons {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}