/* css/navigation.css */
/* GOLD EMPEROR RESPONSIVE NAVIGATION SYSTEM — Fasa 2 + Fasa 3 + Fasa 4 */

/* Pastikan tajuk setiap seksyen tidak terlindung di belakang sticky header */
section[id] {
  scroll-margin-top: 82px;
}

@media (max-width: 1023px) {
  section[id] {
    scroll-margin-top: 72px;
  }
}

/* ============================================================================
   FASA 3: STICKY HEADER & DESKTOP HORIZONTAL NAVIGATION BAR
   ============================================================================ */
.ge-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ge-header.navbar-initial {
  background: rgba(11, 12, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.ge-header.navbar-scrolled {
  background: rgba(11, 12, 14, 0.93);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.52);
}

.ge-nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

.ge-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
}

/* Zon Kiri: Logo Brand */
.ge-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
  text-decoration: none;
  border-radius: 10px;
}

.ge-brand-link:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.7);
  outline-offset: 3px;
}

.ge-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1B1D22;
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.ge-brand-link:hover .ge-brand-mark {
  border-color: #D4AF37;
}

.ge-brand-subtitle {
  display: none;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #A5A5A5;
  margin-top: 3px;
  line-height: 1;
}

/* Zon Tengah: Menu Horizontal Desktop (Tersembunyi di bawah 1024px) */
.ge-desktop-nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.ge-desktop-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.ge-desktop-link:hover,
.ge-desktop-link:focus-visible {
  color: #F5E6B8;
  background: rgba(27, 29, 34, 0.85);
  border-color: rgba(212, 175, 55, 0.2);
  outline: none;
}

.ge-desktop-link.is-active {
  color: #F5E6B8;
  font-weight: 600;
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.34);
}

.ge-desktop-link.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #F5E6B8 0%, #D4AF37 100%);
}

/* Zon Kanan Desktop: Login / My Account & Open Trading Account */
.ge-nav-account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  max-width: 165px;
  border-radius: 10px;
  background: rgba(27, 29, 34, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.22);
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.ge-nav-account-btn:hover,
.ge-nav-account-btn:focus-visible {
  border-color: rgba(212, 175, 55, 0.58);
  background: rgba(212, 175, 55, 0.1);
  color: #F5E6B8;
  outline: none;
}

/* Status Emas Halus apabila pengguna sudah log masuk (My Account) */
.ge-nav-account-btn.is-authenticated,
.ge-drawer-btn-account.is-authenticated {
  border-color: rgba(212, 175, 55, 0.48);
  background: rgba(212, 175, 55, 0.08);
  color: #F5E6B8;
}

.ge-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #E5C76B 0%, #D4AF37 55%, #B89123 100%);
  color: #0B0C0E;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: filter 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ge-nav-cta:hover,
.ge-nav-cta:focus-visible {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px rgba(212, 175, 55, 0.45);
  outline: none;
}

/* Butang Hamburger Mobile */
.ge-hamburger-btn {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid rgba(212, 175, 55, 0.26);
  background: rgba(27, 29, 34, 0.88);
  color: #F5E6B8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ge-hamburger-btn:hover,
.ge-hamburger-btn:focus-visible {
  border-color: #D4AF37;
  background: rgba(212, 175, 55, 0.12);
  outline: none;
}

/* Breakpoint Laptop 1024px – 1279px (Seimbang & tidak sesak) */
@media (min-width: 1024px) {
  .ge-nav-container {
    padding: 0 20px;
  }
  .ge-nav-inner {
    height: 72px;
    gap: 14px;
  }
  .ge-brand-mark {
    width: 36px;
    height: 36px;
  }
  .ge-desktop-nav {
    display: flex !important;
    gap: 4px;
  }
  #ge-desktop-actions {
    display: flex !important;
  }
  #navbar .lg\:hidden {
    display: none !important;
  }
  .ge-desktop-link {
    padding: 8px 9px;
    font-size: 13px;
  }
  .ge-nav-account-btn {
    height: 38px;
    padding: 0 11px;
    font-size: 12.5px;
    max-width: 158px;
  }
  .ge-nav-cta {
    height: 38px;
    padding: 0 13px;
    font-size: 12.5px;
  }
}

/* Breakpoint Desktop 1280px – 1440px+ (Ruang luas & seimbang) */
@media (min-width: 1280px) {
  .ge-nav-container {
    padding: 0 32px;
  }
  .ge-nav-inner {
    gap: 18px;
  }
  .ge-brand-mark {
    width: 40px;
    height: 40px;
  }
  .ge-brand-subtitle {
    display: block;
  }
  .ge-desktop-nav {
    gap: 6px;
  }
  .ge-desktop-link {
    padding: 8px 12px;
    font-size: 14px;
  }
  .ge-nav-account-btn {
    height: 40px;
    padding: 0 14px;
    font-size: 13.5px;
    max-width: 185px;
  }
  .ge-nav-cta {
    height: 40px;
    padding: 0 16px;
    font-size: 13.5px;
  }
}

/* ============================================================================
   FASA 2: MOBILE DRAWER OVERLAY & PANEL (KANAN, 85–90% LEBAR SKRIN, 100dvh)
   ============================================================================ */
.ge-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 6, 9, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

.ge-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ge-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  width: min(88vw, 372px);
  max-width: 90vw;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, #121317 0%, #0B0C0E 100%);
  border-left: 1px solid rgba(212, 175, 55, 0.24);
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.3s ease;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
}

.ge-drawer-panel.is-open {
  transform: translateX(0);
  visibility: visible;
}

.ge-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  background: rgba(20, 21, 25, 0.92);
  flex-shrink: 0;
}

.ge-drawer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.ge-drawer-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #1B1D22;
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ge-drawer-close {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #1B1D22;
  border: 1px solid rgba(212, 175, 55, 0.24);
  color: #D4D7DF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.ge-drawer-close:hover,
.ge-drawer-close:focus-visible {
  color: #FFFFFF;
  border-color: rgba(212, 175, 55, 0.65);
  background: rgba(212, 175, 55, 0.1);
  outline: none;
}

.ge-drawer-nav-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px;
}

.ge-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ge-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ge-drawer-link:hover,
.ge-drawer-link:focus-visible {
  background: #1B1D22;
  color: #F5E6B8;
  border-color: rgba(212, 175, 55, 0.2);
  outline: none;
}

.ge-drawer-link.is-active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16) 0%, rgba(212, 175, 55, 0.05) 100%);
  border-color: rgba(212, 175, 55, 0.45);
  color: #F5E6B8;
  font-weight: 600;
}

.ge-drawer-arrow {
  width: 16px;
  height: 16px;
  color: rgba(212, 175, 55, 0.72);
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}

.ge-drawer-link:hover .ge-drawer-arrow,
.ge-drawer-link.is-active .ge-drawer-arrow {
  color: #D4AF37;
  transform: translateX(2px);
}

.ge-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #34D399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  display: inline-block;
  flex-shrink: 0;
}

.ge-live-dot.is-hidden {
  display: none;
}

.ge-drawer-footer {
  flex-shrink: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  background: #141519;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ge-drawer-btn-account {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #1B1D22;
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.ge-drawer-btn-account:hover,
.ge-drawer-btn-account:focus-visible {
  border-color: rgba(212, 175, 55, 0.65);
  background: rgba(212, 175, 55, 0.1);
  color: #F5E6B8;
  outline: none;
}

.ge-drawer-btn-cta {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #E5C76B 0%, #D4AF37 55%, #B89123 100%);
  color: #0B0C0E;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.ge-drawer-btn-cta:hover,
.ge-drawer-btn-cta:focus-visible {
  filter: brightness(1.06);
  outline: none;
}

.ge-drawer-tagline {
  margin: 2px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #A5A5A5;
}

@media (max-height: 620px) {
  .ge-drawer-header {
    padding: 11px 16px;
  }
  .ge-drawer-link {
    padding: 9px 12px;
    min-height: 40px;
    font-size: 14px;
  }
  .ge-drawer-footer {
    padding: 11px 14px 12px;
    gap: 7px;
  }
  .ge-drawer-btn-account,
  .ge-drawer-btn-cta {
    min-height: 40px;
    padding: 9px 12px;
  }
}

/* Hormati tetapan prefers-reduced-motion pengguna */
@media (prefers-reduced-motion: reduce) {
  .ge-header,
  .ge-brand-mark,
  .ge-desktop-link,
  .ge-nav-account-btn,
  .ge-nav-cta,
  .ge-hamburger-btn,
  .ge-drawer-overlay,
  .ge-drawer-panel,
  .ge-drawer-link,
  .ge-drawer-arrow,
  .ge-drawer-close,
  .ge-drawer-btn-account,
  .ge-drawer-btn-cta {
    transition: none !important;
  }
}
