﻿/* Import Khmer fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Battambang:wght@100;300;400;700;900&family=Bayon&family=Content:wght@400;700&family=Koulen&family=Moul&family=Moulpali&family=Siemreap&family=Kantumruy+Pro:wght@100;200;300;400;500;600;700&display=swap');

/* Import Albert Sans for English (original font) */
@import url('https://fonts.googleapis.com/css2?family=Albert+Sans:wght@400;500;600;700;800;900&display=swap');

/* Base font smoothing & selection highlight styling */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: rgba(255, 252, 252, 0.4);
  color: #f8f6f6;
}

::-moz-selection {
  background-color: rgba(255, 253, 255, 0.4);
  color: #ff3d3d;
}

/* Default font for English and other languages - Keep original */
body {
  font-family: 'Albert Sans', sans-serif;
}

/* Khmer language specific font styling - ONLY for Khmer */
html[lang="km"],
html[lang="km"] *,
[lang="km"],
[lang="km"] * {
  font-family: 'Battambang', 'Kantumruy Pro', 'Content', 'Siemreap', sans-serif !important;
}

/* Headings - Keep Albert Sans for default */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Albert Sans', sans-serif;
  font-weight: 700;
}

/* For Khmer headings only, use Khmer fonts */
html[lang="km"] h1,
html[lang="km"] h2,
html[lang="km"] h3,
html[lang="km"] h4,
html[lang="km"] h5,
html[lang="km"] h6 {
  font-family: 'Koulen', 'Battambang', 'Moul', sans-serif !important;
}

/* Button text - Keep Albert Sans for default */
button,
.btn {
  font-family: 'Albert Sans', sans-serif;
  font-weight: 700;
}

/* Khmer buttons */
html[lang="km"] button,
html[lang="km"] .btn {
  font-family: 'Battambang', 'Kantumruy Pro', sans-serif !important;
}

/* Ensure proper line height for Khmer text ONLY */
html[lang="km"] {
  line-height: 1.8;
}

html[lang="km"] p,
html[lang="km"] li,
html[lang="km"] td,
html[lang="km"] span {
  line-height: 2;
}

/* Navigation and footer links - Keep Albert Sans for default */
nav a,
footer a {
  font-family: 'Albert Sans', sans-serif;
  font-weight: 500;
}

/* Khmer navigation and footer */
html[lang="km"] nav a,
html[lang="km"] footer a {
  font-family: 'Battambang', 'Kantumruy Pro', sans-serif !important;
}

/* Fix any text rendering issues for Khmer */
html[lang="km"] * {
  text-rendering: optimizeLegibility;
  font-feature-settings: normal;
}

/* Popular Khmer font classes for specific use cases */
.font-battambang {
  font-family: 'Battambang', sans-serif !important;
}

.font-koulen {
  font-family: 'Koulen', sans-serif !important;
}

.font-kantumruy {
  font-family: 'Kantumruy Pro', sans-serif !important;
}

.font-content {
  font-family: 'Content', sans-serif !important;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

.font-moul {
  font-family: 'Moul', sans-serif !important;
}

.font-bayon {
  font-family: 'Bayon', sans-serif !important;
}

.font-siemreap {
  font-family: 'Siemreap', sans-serif !important;
}

/* Hide scrollbar for horizontal scroll on mobile */
.scrollbar-hide {
  -ms-overflow-style: none;
  /* Internet Explorer 10+ */
  scrollbar-width: none;
  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
  /* Safari and Chrome */
}

/* ── JP168 brand palette (match live site brown/gold theme) ── */
:root {
  --jp-bg-main: #120e0a;
  --jp-bg-card: #471f04;
  --jp-bg-card-muted: rgba(31, 22, 16, 0.55);
  --jp-primary-bg: #f7e1a9;
  --jp-primary-text: #1f1a03;
  --jp-gold: #d69418;
  --jp-gold-muted: #a38a63;
  --jp-border: #c5a059;
  --jp-border-subtle: rgba(255, 183, 49, 0.35);
  --jp-pagination-active-bg: #f7e1a9;
  --jp-pagination-active-text: #1f1a03;
  --jp-pagination-inactive-bg: transparent;
  --jp-pagination-inactive-text: #e8c97a;
  --jp-accent-coins: #c5a059;
  --jp-accent-amount: #ffdf00;
  --jp-accent-highlight: #c5a059;
  --jp-text-gradient-start: #c5a059;
  --jp-text-gradient-end: #c5a059;


  /* iOS install guide step cards — change these OR --jp-bg-card / --jp-border-subtle */
  --jp-ios-card-bg: var(--jp-bg-card);
  --jp-ios-card-border: var(--jp-border-subtle);
}

/* Coin amount on banner (e.g. 9,999) — bright yellow */
.jp-accent-amount {
  color: var(--jp-accent-amount) !important;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 223, 0, 0.35);
}

.jp-accent-coins {
  color: var(--jp-accent-coins) !important;
  font-weight: 700;
}

/* Gold gradient text (headings + JP168 highlights) */
.jp-accent-gold,
.jp-text-gradient-gold,
.jp-brand {
  background: linear-gradient(180deg, var(--jp-text-gradient-start) 0%, var(--jp-text-gradient-end) 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
}

.jp-section-heading {
  color: #fff;
}

.jp-body-text {
  color: #fae8e8;
  line-height: 1.8;
}

.bonus-page .jp-section-heading {
  color: #fff;
}

.bonus-page .jp-accent-gold {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #FFBE09 !important;
  color: #FFBE09 !important;
}

/* iOS guide (isoguide) — 7 step cards */
[data-i18n="isoguide.title"] {
  background: linear-gradient(135deg, var(--jp-text-gradient-start) 0%, var(--jp-text-gradient-end) 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

.jp-ios-step-card {
  background: var(--jp-ios-card-bg) !important;
  border: 1px solid var(--jp-ios-card-border) !important;
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px rgba(184, 52, 35, 0.418);
}

/* Screenshot red highlights are inside PNG files (Step 1.png … Step 7.png), not CSS */
.jp-ios-step-card img[alt^="Step"] {
  border: none !important;
}

.jp-ios-step-card p {
  color: #fff;
}

.jp-ios-step-card .jp-accent-gold {
  font-weight: 700;
}

/* Installation guide step cards — gold border drawn on top of image */
.guide-step-card {
  position: relative;
  border: none;
  border-radius: 20px;
  overflow: hidden;
  padding: 0;
  line-height: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* Border overlay sits above the image, below text (z-10) */
.guide-step-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 20px;
  border: 1px solid var(--jp-gold);
  box-shadow:
    inset 0 0 0 1px rgba(245, 225, 178, 0.25),
    inset 0 0 24px rgba(197, 160, 89, 0.08);
  pointer-events: none;
}

.guide-step-card img,
.guide-step-card .guide-step-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 20px;
  object-fit: cover;
  object-position: center;
  vertical-align: top;
}

.jp-btn-primary {
  background: var(--jp-primary-bg) !important;
  color: var(--jp-primary-text) !important;
}

.jp-btn-secondary {
  background: transparent !important;
  color: var(--jp-primary-bg) !important;
  border: 1px solid var(--jp-primary-bg) !important;
}

.jp-text-muted {
  color: var(--jp-gold-muted) !important;
}

.jp-border-gold {
  border-color: var(--jp-border-subtle) !important;
}

.jp-bg-card {
  background: var(--jp-bg-card-muted) !important;
  border: 1px solid var(--jp-border-subtle) !important;
}

/* Active navigation link styles */
.nav-link {
  position: relative;
  transition: all 0.3s ease;
  color: var(--jp-gold-muted);
}

/* Category button base (inactive) */
.category-btn {
  color: #e8c97a !important;
  font-weight: 500;
  transition: all 0.2s ease;
}

.category-btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Active category button styles */
.category-btn.active {
  background: #f7e1a9 !important;
  color: #1f1a03 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(197, 160, 89, 0.35);
}

.category-btn.active:hover {
  background: #f7e1a9 !important;
  color: #1f1a03 !important;
  opacity: 0.95;
}

.nav-link:hover {
  color: var(--jp-gold) !important;
}

.nav-link.active {
  color: var(--jp-gold) !important;
  font-weight: 600;
}

/* ── FAQ section (dark glass + gold accent bar) ── */
[data-i18n="faq.title"] {
  background: linear-gradient(180deg, #f9e79f 0%, #f5e1b2 40%, #c5a059 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

.jp-faq-title {
  color: #ffffff !important;
}

.faq-item {
  overflow: visible;
  background: rgba(65, 2, 7, 0.72) !important;
  background-image: none !important;
  border: 1px solid rgba(201, 69, 179, 0.22) !important;
  border-radius: 10px !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 4px 16px rgba(72, 7, 78, 0.25);
}

.faq-item>.absolute.left-0,
.faq-accent-bar {
  position: absolute !important;
  width: 5px !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  border-radius: 4px !important;
  background: linear-gradient(180deg, #f9e79f 0%, #f5e1b2 40%, #c5a059 100%) !important;
  box-shadow: 0 0 10px rgba(245, 225, 178, 0.3) !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

.jp-faq-section,
.mb-0.pb-4:has(.faq-item) {
  position: relative;
  z-index: 20;
  padding-bottom: 2rem;
}

.faq-bottom-spacer {
  height: 6rem;
  pointer-events: none;
}

.faq-question {
  position: relative;
  z-index: 10;
  cursor: pointer;
  pointer-events: auto;
  padding-left: 1.25rem !important;
}

.faq-question:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

/* Ensure all FAQ question buttons are clickable */
.faq-item button.faq-question {
  z-index: 30 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

/* Allow clicks to pass through child elements to the button */
.faq-item button.faq-question * {
  pointer-events: none;
}

/* But ensure the button itself receives clicks */
.faq-item button.faq-question {
  pointer-events: auto !important;
}

/* Ensure FAQ items don't block clicks */
.faq-item {
  position: relative;
  z-index: 1;
}

/* Keep FAQ items visible unless explicitly hidden */
.faq-item:not(.hidden) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

.faq-item.hidden {
  display: none !important;
}

/* Ensure FAQ section container doesn't cut off items */
[data-i18n="faq.title"]+div,
.faq-item+.faq-item {
  display: block !important;
}

/* Ensure parent containers don't hide FAQ items */
section:has(.faq-item) {
  overflow: visible !important;
  max-height: none !important;
}

div:has(.faq-item) {
  overflow: visible !important;
  max-height: none !important;
}

.faq-question .flex {
  position: relative;
  z-index: 10;
}

.faq-question span.font-semibold,
.faq-question span.text-yellow-400 {
  position: relative;
  z-index: 10;
  display: inline-block;
  background: linear-gradient(180deg, #f9e79f 0%, #f5e1b2 45%, #c5a059 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  text-shadow: none !important;
}

.faq-question span.text-yellow-400.text-4xl {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  line-height: 1 !important;
  margin-right: 0.75rem;
}

.faq-answer {
  max-height: 0;
  overflow: hidden !important;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.faq-answer>div {
  color: #d1d1d1 !important;
  border-top: 1px solid rgba(197, 160, 89, 0.18) !important;
}

.faq-item.active .faq-answer {
  max-height: var(--faq-answer-max, 800px) !important;
  overflow: hidden !important;
}

.faq-icon {
  color: #ffffff !important;
  flex-shrink: 0;
}

/* Pagination prev/next buttons */
#prevBtn span,
#nextBtn span {
  color: #e8c97a !important;
}

/* Pagination page number buttons */
#paginationNumbers button {
  color: var(--jp-pagination-inactive-text);
  background: var(--jp-pagination-inactive-bg);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

#paginationNumbers button:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

#paginationNumbers button[data-page].active-page,
#paginationNumbers button[style*="f7e1a9"] {
  color: var(--jp-pagination-active-text) !important;
  background: var(--jp-pagination-active-bg) !important;
  font-weight: 700 !important;
}

#paginationNumbers span {
  color: var(--jp-pagination-inactive-text);
}

/* Mobile Menu Styles */
#mobileMenu {
  max-height: calc(100vh - 120px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  background-color: rgba(18, 14, 10, 0.98) !important;
  border-color: var(--jp-border-subtle) !important;
}

#mobileMenu nav {
  max-height: 100% !important;
  overflow-y: auto !important;
}

/* Dark overlay backdrop when menu is open */
.menu-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 40;
  transition: opacity 0.3s ease;
}

.menu-backdrop.active {
  display: block;
}

/* Prevent body scroll when menu is open on mobile */
@media (max-width: 1023px) {
  body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
  }

  /* Darken header background when menu is open */
  header:has(#mobileMenu:not(.hidden)) {
    background-color: rgba(18, 14, 10, 0.98) !important;
    opacity: 1 !important;
  }

  /* Darken body background when menu is open */
  body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 35;
    pointer-events: none;
  }
}