/* ================================================================
   MASRI.CLOUD — MOBILE MENU (POWERED UP)
   Scope: HANYA mobile (max-width: 768px), tidak menyentuh desktop
   ================================================================ */

/* ── 1. HAMBURGER BUTTON (global override, hapus red debug) ─────── */
.nav__hamburger {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.nav__hamburger:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

/* ── 2. RESPONSIVE BREAKPOINT ─────────────────────────────────────── */
@media (max-width: 768px) {

  /* Sembunyikan desktop nav links */
  .nav__links { display: none !important; }

  /* Tampilkan hamburger – stay in flex flow (jangan absolute!) */
  .nav__hamburger { display: flex !important; }

  /* Sembunyikan Quick Test, Login, lang switcher di mobile */
  .nav__actions .btn--ghost,
  .nav__actions .btn--primary,
  .nav__actions > div:first-child { display: none !important; }

  /* Kecilkan padding nav di mobile */
  .nav__inner { padding: 14px 16px; }

  /* Body scroll lock saat menu terbuka */
  body.menu-open {
    overflow: hidden;
    /* Cegah jump dari scrollbar hilang */
    padding-right: var(--scrollbar-width, 0px);
  }
}

/* ── 3. OVERLAY (animasi fade-in/out) ─────────────────────────────── */
.nav__mobile {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}
.nav__mobile.open {
  display: block;
  pointer-events: auto;
}

.mobile__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.35s ease, backdrop-filter 0.35s ease;
  cursor: pointer;
}
.nav__mobile.open .mobile__overlay {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ── 4. PANEL SLIDE (dari kanan) ──────────────────────────────────── */
.mobile__panel {
  position: absolute;
  top: 0; right: 0;
  width: min(85vw, 320px);
  height: 100%;
  background: rgba(5, 8, 16, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.6),
              inset -1px 0 0 rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(110%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;   /* reset padding lama */
  gap: 0;       /* reset gap lama */
}
.nav__mobile.open .mobile__panel {
  transform: translateX(0);
}

/* ── 5. PANEL HEADER ──────────────────────────────────────────────── */
.mobile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.mobile__logo-text {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #67e8f9 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.mobile__close-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.mobile__close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ── 6. NAV LINKS (dengan ikon + stagger animation) ──────────────── */
.mobile__nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 12px 8px;
}
.mobile__nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
  /* Stagger enter animation */
  opacity: 0;
  transform: translateX(16px);
}
.nav__mobile.open .mobile__nav-link {
  opacity: 1;
  transform: translateX(0);
  transition: background 0.18s ease, color 0.18s ease,
              opacity 0.3s ease, transform 0.3s ease;
}
.nav__mobile.open .mobile__nav-link:nth-child(1) { transition-delay: 0.06s; }
.nav__mobile.open .mobile__nav-link:nth-child(2) { transition-delay: 0.1s;  }
.nav__mobile.open .mobile__nav-link:nth-child(3) { transition-delay: 0.14s; }
.nav__mobile.open .mobile__nav-link:nth-child(4) { transition-delay: 0.18s; }
.nav__mobile.open .mobile__nav-link:nth-child(5) { transition-delay: 0.22s; }

.mobile__nav-link:hover,
.mobile__nav-link:active {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.mobile__nav-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.18s, border-color 0.18s;
}
.mobile__nav-link:hover .mobile__nav-icon {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.28);
}

/* ── 7. SEPARATOR ─────────────────────────────────────────────────── */
.mobile__sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 20px 12px;
  flex-shrink: 0;
}

/* ── 8. CTA BUTTONS ───────────────────────────────────────────────── */
.mobile__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
}
.mobile__action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body, sans-serif);
}
.mobile__action-btn--primary {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.28);
}
.mobile__action-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.4);
}
.mobile__action-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.11);
}
.mobile__action-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

/* ── 9. PANEL FOOTER (lang + theme) ──────────────────────────────── */
.mobile__footer {
  margin-top: auto;
  padding: 16px 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 8px;
}
.mobile__footer-lang {
  display: flex;
  gap: 6px;
}
.mobile__footer-lang a {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.mobile__footer-lang a:hover,
.mobile__footer-lang a.lang-active {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}
.mobile__theme-toggle {
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.18s ease;
}
.mobile__theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ── 10. LIGHT MODE OVERRIDES ─────────────────────────────────────── */
[data-theme="light"] .mobile__panel {
  background: rgba(248, 250, 255, 0.99);
  border-left-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .mobile__header { border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="light"] .mobile__close-btn { color: rgba(0,0,0,0.5); border-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.03); }
[data-theme="light"] .mobile__close-btn:hover { background: rgba(0,0,0,0.07); color: #000; }
[data-theme="light"] .mobile__nav-link { color: rgba(0,0,0,0.6); }
[data-theme="light"] .mobile__nav-link:hover { background: rgba(0,0,0,0.04); color: #000; }
[data-theme="light"] .mobile__nav-icon { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .mobile__sep { background: rgba(0,0,0,0.07); }
[data-theme="light"] .mobile__action-btn--ghost { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.7); border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .mobile__footer { border-top-color: rgba(0,0,0,0.07); }
[data-theme="light"] .mobile__footer-lang a { color: rgba(0,0,0,0.5); border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .mobile__theme-toggle { color: rgba(0,0,0,0.55); border-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.03); }
[data-theme="light"] .mobile__overlay { }
