/* =========================================================
   NAVBAR CSS — Responsive, Centered Nav (no auth buttons)
   ========================================================= */

:root {
  --header-h: 80px;        /* tinggi header default (desktop) */
  --brand: #da9100;        /* warna aksen */
  --bg: #080808;           /* latar header/menu */
  --text: #ffffff;         /* warna teks */
  --divider: rgba(255,255,255,0.1);
}

/* ---- Logo ---- */
.logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ---- Header/Navbar ---- */
.custom-header {
  background-color: var(--bg);
  height: var(--header-h);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1000;
  color: var(--text);
}

/* Container jadi anchor centering nav */
.custom-header .container {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  /* space-between agar toggle/or anything di kanan punya ruang */
  justify-content: space-between;
}

/* ---- Center Navigation (desktop) ----
   Absolute ke container supaya betul-betul center */
.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap; /* cegah wrap yang bikin geser */
}

/* ---- Navigation Links ---- */
.nav-link {
  font-size: 16px;
  font-weight: 500;
  padding: 8px 15px;
  color: var(--text) !important;
  transition: color .25s ease, background-color .25s ease;
}
.nav-link:hover,
.nav-link:focus {
  color: var(--brand) !important;
  text-decoration: none;
}

/* Active state opsional */
.nav-link.active,
.nav-item.active > .nav-link {
  color: var(--brand) !important;
}

/* ---- Mobile Menu Toggle Button ---- */
#menuToggle {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 6px;
  display: none; /* hidden on desktop */
  line-height: 1;
}

/* Fokus ring aksesibilitas */
#menuToggle:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---- Mobile Menu ----
   Fixed full-height di bawah header, bisa scroll */
.mobile-menu {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: calc(100vh - var(--header-h));
  background-color: var(--bg);
  padding: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0,0,0,.3);
  transition: opacity .25s ease, transform .25s ease, visibility .25s step-end;
  transform: translateY(-8px);
  overflow-y: auto;
}

/* Saat aktif */
.mobile-menu.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .25s ease, transform .25s ease, visibility 0s;
  padding: 14px 14px 24px;
}

/* Item mobile */
.mobile-menu .nav-item {
  border-bottom: 1px solid var(--divider);
  margin: 6px 0;
}
.mobile-menu .nav-item:last-child { border-bottom: 0; }

.mobile-menu .nav-link {
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-radius: 8px;
}
.mobile-menu .nav-link:hover,
.mobile-menu .nav-link:active {
  background-color: rgba(255,255,255,0.06);
}

/* ---- Animasi item (cascade) ---- */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-menu.active .nav-item {
  animation: slideDown .25s ease forwards;
  opacity: 0;
}
.mobile-menu.active .nav-item:nth-child(1) { animation-delay: .04s; }
.mobile-menu.active .nav-item:nth-child(2) { animation-delay: .08s; }
.mobile-menu.active .nav-item:nth-child(3) { animation-delay: .12s; }
.mobile-menu.active .nav-item:nth-child(4) { animation-delay: .16s; }
.mobile-menu.active .nav-item:nth-child(5) { animation-delay: .20s; }

/* ---- Lock scroll saat menu buka ---- */
body.menu-open { overflow: hidden; }

/* ---- Responsiveness ---- */

/* XL down: rapatkan padding link sedikit */
@media (max-width: 1199.98px) {
  .nav-center .nav-link { padding: 8px 10px; }
}

/* LG down: tampilkan toggle, sembunyikan nav center */
@media (max-width: 991.98px) {
  #menuToggle { display: inline-flex; align-items: center; justify-content: center; }

  .nav-center { display: none !important; }
}

/* MD down: kecilkan header & logo */
@media (max-width: 767.98px) {
  :root { --header-h: 70px; }

  .logo { height: 35px; }
  .mobile-menu { top: var(--header-h); height: calc(100vh - var(--header-h)); }
  .mobile-menu .nav-link { font-size: 15px; }
}

/* SM down: ekstra kompak */
@media (max-width: 575.98px) {
  :root { --header-h: 60px; }

  .logo { height: 30px; }
  .mobile-menu { top: var(--header-h); height: calc(100vh - var(--header-h)); }
  .mobile-menu .nav-item { margin: 8px 0; }
  .mobile-menu .nav-link { padding: 8px 10px; font-size: 14px; }
}

/* ---- Prefer reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- Font family konsisten ---- */
.custom-header,
.nav-link,
.mobile-menu {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
