/*
Theme Name: APKStoreTH
Theme URI: https://apkstoreth.com
Author: APKStoreTH Team
Author URI: https://apkstoreth.com
Description: Premium bilingual (EN/TH) Android game & app review theme for Thailand. Light glassmorphism design with AI-verified safety badges, Top-Up affiliate widgets, and advanced category filtering.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apkstoreth
Tags: gaming, apps, reviews, bilingual, thai, glassmorphism, light-theme, custom-post-types

APKStoreTH WordPress Theme
Copyright 2026 APKStoreTH
*/

/* ===========================
   DESIGN SYSTEM - LIGHT THEME
   =========================== */
:root {
  --bg-primary: #F6F8FF;
  --bg-panel: #FFFFFF;
  --bg-panel-hover: #EEF2FF;
  --bg-footer: #1E293B;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border-default: #E2E8F0;
  --border-light: rgba(99,102,241,0.12);
  --brand-indigo: #4F46E5;
  --brand-purple: #7C3AED;
  --brand-pink: #EC4899;
  --brand-green: #059669;
  --brand-yellow: #F59E0B;
  --brand-orange: #F97316;
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 15% 50%, rgba(79,70,229,0.05), transparent 30%),
                    radial-gradient(circle at 85% 30%, rgba(124,58,237,0.04), transparent 30%);
  background-attachment: fixed;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #6366F1; border-radius: 3px; }

/* ===========================
   GLASS PANEL
   =========================== */
.glass-panel {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  box-shadow: 0 2px 16px rgba(15,23,42,0.06);
}
.glass-panel:hover { box-shadow: 0 4px 24px rgba(15,23,42,0.1); }

/* ===========================
   TYPOGRAPHY
   =========================== */
.text-gradient {
  background: linear-gradient(90deg, var(--brand-indigo), var(--brand-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h1, h2, h3, h4, h5, h6 { font-weight: 800; line-height: 1.2; }

/* ===========================
   BUTTONS
   =========================== */
.btn-neon {
  background: linear-gradient(90deg, var(--brand-indigo), var(--brand-purple));
  color: #fff;
  font-weight: 800;
  border-radius: 9999px;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-neon:hover {
  box-shadow: 0 6px 24px rgba(79,70,229,0.4);
  transform: translateY(-1px);
  color: #fff;
}
.btn-outline {
  background: rgba(99,102,241,0.05);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover { background: rgba(99,102,241,0.1); color: var(--brand-indigo); }
.btn-outline.active {
  background: rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.3);
  color: var(--brand-indigo);
  font-weight: 700;
}

/* ===========================
   CATEGORY CHIPS
   =========================== */
.chip-bar { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: none; }
.chip-bar::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-default);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-chip:hover { background: rgba(79,70,229,0.06); border-color: rgba(79,70,229,0.25); color: var(--brand-indigo); }
.cat-chip.active {
  background: rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.3);
  color: var(--brand-indigo);
  font-weight: 700;
}

/* ===========================
   GAME / APP CARDS
   =========================== */
.game-card {
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(15,23,42,0.12); }
.game-card .card-image { position: relative; height: 9rem; overflow: hidden; }
.game-card .card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.game-card:hover .card-image img { transform: scale(1.1); }
.game-card .card-image .overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-panel), transparent); }
.game-card .card-body { padding: 0.75rem; }
.game-card .card-category { font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-indigo); margin-bottom: 0.25rem; }
.game-card .card-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.5rem; }
.game-card .card-meta { display: flex; align-items: center; justify-content: space-between; }
.game-card .card-rating { display: flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: var(--text-muted); }

/* Badges */
.badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
  color: #fff;
}
.badge-hot { background: rgba(239,68,68,0.9); }
.badge-new { background: rgba(16,185,129,0.9); }
.badge-free { background: rgba(124,58,237,0.8); }
.badge-th { background: var(--brand-indigo); }

/* Review link button */
.review-link {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--brand-indigo);
  border: 1.5px solid rgba(79,70,229,0.25);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
}
.review-link:hover { background: var(--brand-indigo); color: #fff; }

/* ===========================
   NAVBAR
   =========================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
  padding: 0 1.5rem;
}
.nav-inner { max-width: 1300px; margin: 0 auto; height: 4rem; display: flex; align-items: center; gap: 1.5rem; }
.nav-logo { font-size: 1.25rem; font-weight: 900; letter-spacing: 0.1em; display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.nav-logo i { color: var(--brand-indigo); }
.nav-links { display: flex; align-items: center; gap: 0.25rem; flex: 1; }
.nav-links a {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--brand-indigo); font-weight: 600; border-bottom: 2px solid var(--brand-indigo); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }

/* Search */
.nav-search { position: relative; }
.nav-search i { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 0.75rem; }
.nav-search input {
  background: var(--bg-panel-hover);
  border: 1px solid var(--border-default);
  font-size: 0.75rem;
  border-radius: 9999px;
  padding: 0.5rem 1rem 0.5rem 2rem;
  width: 11rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.nav-search input:focus { border-color: var(--brand-indigo); background: #fff; }

/* Lang Toggle */
.lang-toggle { display: flex; background: var(--bg-panel); border: 1px solid var(--border-light); border-radius: 9999px; padding: 2px; gap: 2px; }
.lang-btn {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s;
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.active {
  background: linear-gradient(90deg, #6366F1, #8B5CF6);
  color: #fff;
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
  padding-top: 5rem;
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 50%, #EFF6FF 100%);
}
.hero-blobs { position: absolute; inset: 0; pointer-events: none; }
.hero .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.hero-content { position: relative; z-index: 10; max-width: 1300px; margin: 0 auto; padding: 4rem 1.5rem; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(79,70,229,0.1);
  border: 1px solid rgba(79,70,229,0.3);
  border-radius: 9999px;
  padding: 0.375rem 1rem;
  margin-bottom: 1.5rem;
}
.hero-badge .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--brand-indigo); animation: pulse 2s infinite; }
.hero-badge span { font-size: 0.75rem; font-weight: 700; color: var(--brand-indigo); letter-spacing: 0.05em; }
.hero h1 { font-size: 3.5rem; line-height: 1; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.hero-desc { color: var(--text-muted); font-size: 1.125rem; margin-bottom: 2rem; max-width: 28rem; line-height: 1.7; }
.hero-stats { display: flex; gap: 2rem; }
.hero-stat .value { font-size: 1.5rem; font-weight: 900; }
.hero-stat .label { font-size: 0.75rem; color: var(--text-light); margin-top: 0.25rem; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ===========================
   SECTIONS
   =========================== */
.section { max-width: 1300px; margin: 0 auto; padding: 0 1.5rem; }
.section-title { font-size: 1.25rem; font-weight: 900; margin-bottom: 0.25rem; }
.section-subtitle { font-size: 0.75rem; color: var(--text-light); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.section-link { font-size: 0.75rem; font-weight: 600; color: var(--brand-indigo); }
.section-link:hover { text-decoration: underline; }

/* Grid layouts */
.grid-3x2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-3x3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-sidebar { display: grid; grid-template-columns: 3fr 1fr; gap: 2rem; }

/* ===========================
   SIDEBAR WIDGETS
   =========================== */
.sidebar-widget { margin-bottom: 1.5rem; }
.widget-title { font-size: 0.875rem; font-weight: 800; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.widget-title i { font-size: 0.75rem; }

/* Ranking list */
.ranking-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; cursor: pointer; transition: opacity 0.2s; }
.ranking-item:hover { opacity: 0.8; }
.ranking-number { font-size: 1rem; font-weight: 900; width: 1.5rem; text-align: center; }
.ranking-icon { width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; object-fit: cover; border: 1px solid var(--border-default); }
.ranking-info { flex: 1; min-width: 0; }
.ranking-name { font-size: 0.75rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-meta { font-size: 0.625rem; color: var(--text-light); }

/* Top-Up Widget */
.topup-widget {
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(124,58,237,0.1));
  border: 1px solid rgba(79,70,229,0.2);
}
.topup-widget .topbar { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--brand-indigo), var(--brand-purple)); }
.topup-btn {
  width: 100%;
  padding: 0.375rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid;
  background: var(--bg-panel);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: border-color 0.2s;
}

/* ===========================
   PRODUCT PAGE
   =========================== */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.breadcrumb a:hover { color: var(--brand-indigo); }
.breadcrumb .sep { font-size: 0.5rem; }

.product-hero { display: flex; gap: 1.25rem; align-items: flex-start; }
.product-icon { width: 6rem; height: 6rem; border-radius: 1.5rem; object-fit: cover; border: 1px solid var(--border-default); flex-shrink: 0; }
.product-info h1 { font-size: 2rem; }
.product-badge { display: inline-flex; align-items: center; gap: 0.25rem; background: rgba(16,185,129,0.1); color: var(--brand-green); border: 1px solid rgba(16,185,129,0.3); font-size: 0.625rem; font-weight: 700; padding: 0.125rem 0.5rem; border-radius: 9999px; }
.product-rating { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }

.score-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.score-card { text-align: center; padding: 1rem; }
.score-card .score { font-size: 1.5rem; font-weight: 900; }
.score-card .label { font-size: 0.625rem; color: var(--text-light); margin-top: 0.25rem; }

.safety-banner {
  border-radius: 0.75rem;
  border: 1px solid rgba(16,185,129,0.25);
  background: rgba(16,185,129,0.05);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.safety-banner i { color: var(--brand-green); font-size: 1.5rem; flex-shrink: 0; }

/* Pros & Cons */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pros-box { border-radius: 0.75rem; border: 1px solid rgba(16,185,129,0.4); background: linear-gradient(to bottom right, #F0FDF4, transparent); padding: 1.25rem; }
.cons-box { border-radius: 0.75rem; border: 1px solid rgba(239,68,68,0.4); background: linear-gradient(to bottom right, #FEF2F2, transparent); padding: 1.25rem; }
.pros-box li, .cons-box li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--text-secondary); padding: 0.375rem 0; }

/* Download Steps */
.download-step { display: flex; gap: 1rem; align-items: flex-start; padding: 0.5rem 0; }
.step-number {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* Rating bars */
.rating-bar { display: flex; align-items: center; gap: 0.5rem; font-size: 0.625rem; }
.rating-bar .bar { flex: 1; height: 0.375rem; background: rgba(99,102,241,0.1); border-radius: 9999px; overflow: hidden; }
.rating-bar .bar .fill { height: 100%; border-radius: 9999px; }

/* ===========================
   CATEGORY PAGE
   =========================== */
.category-hero {
  padding-top: 5rem;
  padding-bottom: 2rem;
  background: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 50%, #EFF6FF 100%);
  position: relative;
  overflow: hidden;
}
.sort-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; }
.sort-group { display: flex; align-items: center; gap: 0.5rem; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 2.5rem; }
.page-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-default);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.page-btn:hover { background: rgba(99,102,241,0.06); }
.page-btn.active {
  background: linear-gradient(90deg, var(--brand-indigo), var(--brand-purple));
  color: #fff;
  border-color: transparent;
}

/* ===========================
   NEWS / COMMUNITY
   =========================== */
.news-card { overflow: hidden; cursor: pointer; transition: all 0.3s; }
.news-card:hover { transform: translateY(-4px); }
.news-card .card-image { height: 10rem; overflow: hidden; }
.news-card .card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.news-card:hover .card-image img { transform: scale(1.05); }
.news-card .card-body { padding: 1rem; }
.news-badge { font-size: 0.625rem; padding: 0.125rem 0.5rem; border-radius: 9999px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===========================
   TOP CHARTS
   =========================== */
.chart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}
.chart-card:hover { transform: translateY(-2px); }
.chart-card .chart-rank { position: absolute; top: 0.75rem; left: 0.75rem; font-size: 1rem; font-weight: 900; color: var(--text-muted); }
.chart-card .chart-icon { width: 4rem; height: 4rem; border-radius: 0.75rem; object-fit: cover; border: 1px solid var(--border-default); margin: 0.5rem 0 0.75rem; }

/* ===========================
   FOOTER
   =========================== */
.site-footer {
  background: var(--bg-footer);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 2.5rem 1.5rem;
  color: #94A3B8;
}
.footer-inner { max-width: 1300px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-bottom: 2rem; }
.footer-brand .logo { font-weight: 900; letter-spacing: 0.1em; }
.footer-col h4 { color: #F1F5F9; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.footer-col a { display: block; font-size: 0.75rem; color: #94A3B8; padding: 0.25rem 0; transition: color 0.2s; }
.footer-col a:hover { color: #818CF8; }
.footer-social { display: flex; gap: 0.75rem; margin-top: 1rem; }
.footer-social a {
  width: 2rem; height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  color: #94A3B8;
  transition: all 0.2s;
}
.footer-social a:hover { color: #818CF8; border-color: rgba(129,140,248,0.3); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; font-size: 0.625rem; color: #64748B; }

/* ===========================
   TOAST
   =========================== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  transform: translateY(5rem);
  opacity: 0;
  transition: all 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; }
  .grid-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .score-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-3x2, .grid-3x3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2.5rem; }
  .pros-cons { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid-3x2, .grid-3x3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
}

/* ===========================
   BILINGUAL TOGGLE
   =========================== */
.th-text { display: none; }
body.lang-th .en-text { display: none; }
body.lang-th .th-text { display: inline; }
body.lang-th span.th-text,
body.lang-th div.th-text,
body.lang-th p.th-text { display: block; }
body.lang-th span.en-text,
body.lang-th div.en-text,
body.lang-th p.en-text { display: none; }

/* WordPress specific */
.screen-reader-text { clip: rect(1px,1px,1px,1px); position: absolute; height: 1px; width: 1px; overflow: hidden; }
.alignleft { float: left; margin-right: 1rem; }
.alignright { float: right; margin-left: 1rem; }
.aligncenter { display: block; margin: 0 auto; }
