/* ============================================================
   MEGA888BARU.COM — Shared Stylesheet
   Google Fonts: Rajdhani (headings) + Nunito Sans (body)
   NOTE: @import removed — fonts now loaded via <link> in HTML
   for non-render-blocking loading.
   ============================================================ */

/* ── Font Awesome: override font-display to swap (prevent FOIT) ── */
@font-face {
  font-family: 'Font Awesome 6 Free';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/webfonts/fa-solid-900.woff2') format('woff2');
}
@font-face {
  font-family: 'Font Awesome 6 Brands';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/webfonts/fa-brands-400.woff2') format('woff2');
}

/* ── CSS Variables (default = Home/Gold theme) ── */
:root {
  --primary:        #c9a227;
  --primary-light:  #f5d060;
  --primary-dark:   #7a600a;
  --accent:         #ff6b35;
  --hero-bg:        linear-gradient(160deg, #0a0a0a 0%, #181208 60%, #0f0f0f 100%);
  --hero-glow:      rgba(201, 162, 39, 0.18);
  --card-bg:        #141414;
  --card-border:    rgba(201, 162, 39, 0.25);
  --sidebar-bg:     #0d0d0d;
  --page-bg:        #0d0d0d;
  --text:           #f0f0f0;
  --text-muted:     #888;
  --section-bg:     #111111;
  --section-border: rgba(255,255,255,0.06);
  --btn-android:    linear-gradient(135deg, #2ecc71, #1abc9c);
  --btn-ios:        linear-gradient(135deg, #636e72, #2d3436);
  --btn-pc:         linear-gradient(135deg, #0078d4, #004c8c);
  --download-btn-shadow: 0 4px 20px rgba(201,162,39,0.3);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito Sans', sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-light); }

ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.3rem; }

h1, h2, h3, h4 {
  font-family: 'Rajdhani', sans-serif;
  line-height: 1.2;
}

/* ── Page Wrapper ── */
.page-wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* ============================================================
   HEADER / TOP BAR
   ============================================================ */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s;
}
.hamburger:hover { background: rgba(255,255,255,0.07); }
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 950;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
body.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: all;
}

/* ── Sidebar ── */
.mega-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 1000;
  padding: 60px 0 30px;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
body.sidebar-open .mega-sidebar { transform: translateX(0); }

.sidebar-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}
.sidebar-close:hover { color: var(--text); }

.sidebar-menu { list-style: none; padding: 0; }
.sidebar-menu li { border-bottom: 1px solid rgba(255,255,255,0.05); }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  position: relative;
}
.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.2s;
}
.sidebar-link:hover { background: rgba(255,255,255,0.04); color: var(--primary-light); }
.sidebar-link:hover::before { transform: scaleY(1); }
.sidebar-link.active { color: var(--primary); background: rgba(201,162,39,0.06); }
.sidebar-link.active::before { transform: scaleY(1); }

/* ============================================================
   HERO SECTION — Base styles
   ============================================================ */
.hero {
  background: #000;
  padding: 30px 20px 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}

/* Logo */
.hero-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.hero-logo img {
  width: 550px;
  height: auto;
  max-width: 100%;
  background: #000;
  filter: none;
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* CTAs */
.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.cta-box {
  flex: 1;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 64px;
}
.cta-box:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

.cta-box.telegram {
  background: linear-gradient(135deg, #0d2137 0%, #0b3568 100%);
  border-color: rgba(33,150,243,0.4);
}
.cta-box.whatsapp {
  background: linear-gradient(135deg, #0d2e14 0%, #0b4020 100%);
  border-color: rgba(37,211,102,0.4);
}

.cta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}
.cta-left span {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.cta-small-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cta-small-icon.fa-brands, .cta-small-icon.fa-solid {
  font-size: 20px;
  color: #fff;
}

.cta-character {
  width: 75px;
  height: 75px;
  object-fit: contain;
  position: absolute;
  right: 10px;
  bottom: 0;
  opacity: 0.9;
}

/* Update line */
.update-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 0.78rem;
  flex-wrap: wrap;
}
.update-line .label {
  color: var(--text-muted);
}
.update-line span:last-child {
  color: var(--primary);
  font-weight: 600;
}

/* ============================================================
   HERO LAYOUT VARIANTS
   ============================================================ */

/* --- DAFTAR: logo left, CTAs stacked right --- */
.hero-layout-daftar .hero-logo {
  justify-content: flex-start;
}
.hero-layout-daftar .hero-logo img {
  width: 550px;
  height: auto;
}
.hero-layout-daftar .hero-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.hero-layout-daftar .hero-ctas {
  flex-direction: column;
  flex: 1;
  max-width: none;
  gap: 8px;
}
.hero-layout-daftar .cta-box {
  max-width: 100%;
  flex: none;
}

/* --- LOGIN: CTAs full-width row, logo compact center --- */
.hero-layout-login .hero-logo img {
  width: 550px;
  height: auto;
}
.hero-layout-login .hero-ctas {
  flex-direction: row;
  gap: 10px;
}
.hero-layout-login .cta-box {
  max-width: none;
  flex: 1;
}

/* --- DOWNLOAD: 2-col grid for CTAs, logo center large --- */
.hero-layout-download .hero-logo img {
  width: 550px;
  height: auto;
}
.hero-layout-download .hero-ctas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.hero-layout-download .cta-box {
  max-width: 100%;
  min-height: 72px;
}

/* --- RASMI: CTAs left, logo right --- */
.hero-layout-rasmi .hero-inner {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.hero-layout-rasmi .hero-logo {
  justify-content: flex-end;
  margin-bottom: 0;
  flex-shrink: 0;
}
.hero-layout-rasmi .hero-logo img {
  width: 550px;
  height: auto;
}
.hero-layout-rasmi .hero-ctas {
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.hero-layout-rasmi .cta-box {
  max-width: 100%;
  flex: none;
}

/* ============================================================
   DOWNLOAD CARDS — Base
   ============================================================ */
.card {
  margin: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.5); }

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--card-border);
}
.card-header-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.card-header-icon i {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--primary);
}
.card-header-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  color: var(--primary-light);
}

.card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-id-body {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  flex-wrap: wrap;
  color: var(--text-muted);
}
.test-id-body strong { color: var(--primary); }

.download-btn {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  color: #fff;
  text-transform: uppercase;
}
.download-btn i {
  margin-right: 8px;
}
.download-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}
.download-btn:hover::after { background: rgba(255,255,255,0.08); }
.download-btn:active { transform: scale(0.98); }

.download-btn.android { background: var(--btn-android); box-shadow: 0 4px 14px rgba(46,204,113,0.3); }
.download-btn.ios     { background: var(--btn-ios);     box-shadow: 0 4px 14px rgba(99,110,114,0.3); }
.download-btn.pc      { background: var(--btn-pc);      box-shadow: 0 4px 14px rgba(0,120,212,0.3); }

.download-extra-link {
  text-align: center;
  font-size: 0.82rem;
}
.download-extra-link a {
  color: var(--primary);
  border-bottom: 1px dotted var(--primary);
  transition: color 0.2s;
}
.download-extra-link a:hover { color: var(--primary-light); }

/* ============================================================
   DOWNLOAD CARD LAYOUT VARIANTS
   ============================================================ */

/* --- DAFTAR: 2-col grid --- */
.cards-layout-daftar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 8px;
}
.cards-layout-daftar .card {
  margin: 6px 8px;
}

/* --- LOGIN: horizontal compact row --- */
.cards-layout-login {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cards-layout-login .card {
  margin: 8px 16px;
}
.cards-layout-login .card-body {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cards-layout-login .download-btn {
  width: auto;
  flex: 1;
  min-width: 120px;
  font-size: 0.85rem;
  padding: 10px 12px;
}

/* --- DOWNLOAD: 2x2 large grid --- */
.cards-layout-download {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 8px;
}
.cards-layout-download .card {
  margin: 6px 8px;
}
.cards-layout-download .download-btn {
  padding: 11px 10px;
  font-size: 0.88rem;
}

/* --- RASMI: single col with accent left border --- */
.cards-layout-rasmi .card {
  border-left: 4px solid var(--primary);
}

/* ============================================================
   CONTENT BOXES
   ============================================================ */
.content-box {
  margin: 16px 16px;
  padding: 22px 20px;
  background: var(--section-bg);
  border: 1px solid var(--section-border);
  border-radius: 14px;
}

.content-box h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 14px;
  line-height: 1.25;
}
.content-box h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--section-border);
}
.content-box h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 12px 0 6px;
}
.content-box p {
  color: #bbb;
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.content-box ul, .content-box ol {
  color: #bbb;
  font-size: 0.92rem;
}
.content-box li { margin-bottom: 6px; }
.content-box strong { color: var(--text); }
.content-box a { color: var(--primary); }

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.faq-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--section-border);
  border-radius: 10px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-family: 'Nunito Sans', sans-serif;
  text-align: left;
  transition: background 0.2s;
}
.faq-question:hover { background: rgba(255,255,255,0.04); }

.faq-icon {
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.faq-text { font-size: 0.88rem; line-height: 1.4; }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.faq-item.open .faq-answer { max-height: 200px; }
.faq-answer p {
  padding: 0 16px 14px;
  font-size: 0.87rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Contact Section ── */
.contact-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-actions h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  color: var(--primary-light);
  margin-bottom: 2px;
}
.contact-actions p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.contact-btn {
  display: block;
  padding: 13px 16px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff !important;
  border-radius: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
}
.contact-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  color: #fff;
}
.contact-btn br { display: none; }

.address-text {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Info Table ── */
.table-wrapper { overflow-x: auto; border-radius: 10px; }

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.info-table tr { border-bottom: 1px solid var(--section-border); }
.info-table tr:last-child { border-bottom: none; }
.info-table td {
  padding: 10px 12px;
  vertical-align: top;
}
.info-table td:first-child {
  color: var(--text-muted);
  width: 42%;
  font-weight: 600;
}
.info-table td:last-child { color: var(--text); }
.info-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--section-border);
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer .footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer .footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer .footer-links a:hover { color: var(--primary); }
.dmca-badge img { height: 22px; opacity: 0.7; transition: opacity 0.2s; }
.dmca-badge:hover img { opacity: 1; }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 800;
}
.back-to-top.show { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-light); }

/* ============================================================
   PAGE-SPECIFIC COLOR THEMES (override :root vars)
   ============================================================ */

/* Daftar — Emerald Green */
body.theme-daftar {
  --primary:        #00c9a7;
  --primary-light:  #7fffd4;
  --primary-dark:   #007a66;
  --hero-bg:        linear-gradient(160deg, #030f0d 0%, #071a13 60%, #050e09 100%);
  --hero-glow:      rgba(0,201,167,0.18);
  --card-bg:        #0b1612;
  --card-border:    rgba(0,201,167,0.25);
  --section-bg:     #0b1410;
  --section-border: rgba(0,201,167,0.1);
  --download-btn-shadow: 0 4px 20px rgba(0,201,167,0.3);
}

/* Login — Electric Blue */
body.theme-login {
  --primary:        #4facfe;
  --primary-light:  #a8d8ff;
  --primary-dark:   #1a6fb5;
  --hero-bg:        linear-gradient(160deg, #030712 0%, #071528 60%, #030a14 100%);
  --hero-glow:      rgba(79,172,254,0.18);
  --card-bg:        #08111e;
  --card-border:    rgba(79,172,254,0.25);
  --section-bg:     #080f1a;
  --section-border: rgba(79,172,254,0.1);
  --download-btn-shadow: 0 4px 20px rgba(79,172,254,0.3);
}

/* Download — Flame Orange */
body.theme-download {
  --primary:        #ff8c42;
  --primary-light:  #ffb380;
  --primary-dark:   #b55a1a;
  --hero-bg:        linear-gradient(160deg, #0f0800 0%, #1e0f00 60%, #120900 100%);
  --hero-glow:      rgba(255,140,66,0.18);
  --card-bg:        #150c03;
  --card-border:    rgba(255,140,66,0.25);
  --section-bg:     #130b02;
  --section-border: rgba(255,140,66,0.1);
  --download-btn-shadow: 0 4px 20px rgba(255,140,66,0.3);
}

/* Mega888 Rasmi — Royal Purple */
body.theme-rasmi {
  --primary:        #a855f7;
  --primary-light:  #d8b4fe;
  --primary-dark:   #6b21a8;
  --hero-bg:        linear-gradient(160deg, #07030f 0%, #110720 60%, #08040f 100%);
  --hero-glow:      rgba(168,85,247,0.18);
  --card-bg:        #0e0817;
  --card-border:    rgba(168,85,247,0.25);
  --section-bg:     #0c0714;
  --section-border: rgba(168,85,247,0.1);
  --download-btn-shadow: 0 4px 20px rgba(168,85,247,0.3);
}

/* ── Animated entrance ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card, .content-box {
  animation: fadeUp 0.4s ease both;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.content-box:nth-child(1) { animation-delay: 0.25s; }
.content-box:nth-child(2) { animation-delay: 0.3s; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }

/* ── Selection ── */
::selection { background: var(--primary); color: #000; }
