/* Header Search Dropdown */
.header-search-dropdown {
  background: var(--white);
  border-bottom: 1.5px solid var(--border);
  padding: 10px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  /* in-flow (not absolute) so it doesn't overlap content unexpectedly */
}

.header-search-dropdown form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 8px 14px;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

.header-search-dropdown input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
}

.header-search-dropdown button {
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

/* Slide Menu */
.slide-menu {
  position: fixed;
  inset: 0;
  /* Lower than bottom-nav so nav bar stays tappable even during animation */
  z-index: 9996;
}

.slide-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  /* Overlay must not extend behind the bottom-nav area */
  bottom: 0;
}

.slide-menu-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-radius: 18px 18px 0 0;
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.18s ease-out;
  max-height: 82vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
  contain: layout style;
}

.slide-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
}
body.dark-mode .slide-menu-header { background: #111111; }

.slide-menu-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: background 0.1s, color 0.1s;
  border: none; cursor: pointer; flex-shrink: 0;
}
.slide-menu-close:hover { background: var(--primary); color: #fff; }

.slide-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
}
.slide-menu-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  color: var(--dark);
  transition: background 0.1s, color 0.1s;
}
.slide-menu-nav a:hover { background: var(--primary-bg); color: var(--primary); }

/* Search results page */
.search-results-header {
  background: var(--bg);
  padding: 20px 16px;
  border-bottom: 1.5px solid var(--border);
}
.search-results-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; }
.search-results-count { font-size: 13px; color: var(--gray); margin-top: 4px; }

/* Taxonomy archive header */
.taxonomy-header {
  background: linear-gradient(135deg, var(--primary-bg), var(--white));
  padding: 24px 16px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 0;
}

/* 404 Page */
.page-404 {
  text-align: center;
  padding: 60px 16px;
}
.page-404 .error-code {
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}
.page-404 h1 { font-family: var(--font-display); font-size: 24px; font-weight: 800; margin: 12px 0 8px; }
.page-404 p { color: var(--gray); font-size: 14px; margin-bottom: 24px; }
.page-404 .btn-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 14px;
  transition: var(--transition);
}
.page-404 .btn-home:hover { background: var(--primary-light); }


/* ==============================================
   PARTICLES & BACKGROUND ANIMATIONS
   ============================================== */

/* ═══════════════════════════════════════════════════
   Z-INDEX ARCHITECTURE
   0   → canvas (particle background)
   2   → section wrappers (semi-transparent bg)
   5   → canvas AGAIN via mix-blend — NOT needed
   10  → card content, images, text
   999 → header
   9999→ bottom-nav, slide-menu
═══════════════════════════════════════════════════ */

/* ── Canvas: lowest layer ── */
#pas-particles {
  position: fixed !important;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 3 !important;      /* above section backgrounds(2), below card content(10) */
  pointer-events: none !important;
}
#pas-mesh { display: none !important; }

/* Cursor glow — disabled (was causing blue tint over images) */
#pas-cursor-glow {
  display: none !important;
}

/* ── Body: solid background ── */
html, body { background: var(--white) !important; }
body.dark-mode { background: #0A0A0A !important; }

/* ── Sections: z:2 with semi-transparent backgrounds ──
   Canvas (z:3) renders ABOVE these, so particles float
   over the section background but content (z:10) is on top. */
.section-wrapper {
  position: relative !important;
  z-index: 2 !important;
  background: rgba(255,255,255,0.92) !important;
  /* NO min-height, NO overflow that inflates height */
  overflow: hidden !important;
}
.section-wrapper.bg-gray {
  background: rgba(247,247,247,0.92) !important;
}
body.dark-mode .section-wrapper {
  background: rgba(8,8,8,0.93) !important;
}
body.dark-mode .section-wrapper.bg-gray {
  background: rgba(22,22,22,0.92) !important;
}
.faq-section {
  position: relative !important;
  z-index: 2 !important;
  background: rgba(255,255,255,0.92) !important;
}
body.dark-mode .faq-section {
  background: rgba(8,8,8,0.93) !important;
}
.section-divider {
  position: relative !important;
  z-index: 2 !important;
  background: var(--bg) !important;
}
body.dark-mode .section-divider { background: #0A0A0A !important; }

/* App page section backgrounds */
.sa-info, .sa-sc-section, .sa-dl-section,
.sa-details-section, .sa-tut-section,
.sa-author-section, .sa-content {
  position: relative !important;
  z-index: 2 !important;
}
.sa-sep { position: relative !important; z-index: 2 !important; }
.sa-tg-section { position: relative !important; z-index: 2 !important; }
.fp-hero {
  position: relative !important;
  z-index: 2 !important;
}
footer.site-footer { position: relative !important; z-index: 2 !important; }

/* ── Card CONTENT at z:10 — above canvas ── */
.trending-card, .app-card, .game-card, .upd-card,
.featured-card, .category-row, .fp-qcat,
.faq-card, .telegram-banner {
  position: relative !important;
  z-index: 10 !important;
  /* Strict height/size — never inflate */
  flex-shrink: 0 !important;
}
/* ALL images inside cards */
.trending-thumb, .trending-thumb img,
.app-icon,       .app-icon img,
.game-card-img,  .game-card-img-placeholder,
.featured-card-img {
  display: block !important;
  flex-shrink: 0 !important;
  object-fit: cover !important;
  max-width: 100% !important;
}
/* upd-icon img — fixed 68px, no inheritance issues */
.upd-icon img {
  display: block !important;
  width: 68px !important;
  height: 68px !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
}

/* ── Header / nav always on top ── */
.site-header    { position: sticky !important; z-index: 999  !important; }
.bottom-nav     { position: fixed  !important; z-index: 10001 !important; } /* always above everything */
.slide-menu     { z-index: 9996 !important; }  /* below bottom-nav */
.sa-sticky      { z-index: 997  !important; }
#pas-scroll-bar { position: fixed !important; z-index: 10002 !important; pointer-events: none !important; }


/* ── Animated gradient header border ── */
.pas-header-bar {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    var(--primary) 0%,
    #9333ea 25%,
    var(--primary) 50%,
    #3b82f6 75%,
    var(--primary) 100%
  );
  background-size: 200% 100%;
  animation: pasHeaderBar 4s linear infinite;
}
@keyframes pasHeaderBar {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}



/* ── Ripple effect ── */
.pas-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transform: scale(0);
  animation: pasRippleOut 0.65s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}
@keyframes pasRippleOut {
  0%   { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(1); opacity: 0; }
}

/* Cursor glow styles consolidated in z-index block above */


/* ── Section wrappers and scroll areas NEVER hidden ── */
/* Section structure elements — always fully visible, no animation delays */
.section-wrapper, .section-wrapper.pas-reveal,
.trending-scroll, .section-header, .section-divider,
.updates-grid, .updates-tabs {
  opacity: 1 !important;
  transform: none !important;
  transition: background 0.3s ease !important;
  will-change: auto !important;
}
/* section-title keeps its gradient animation */
.section-title {
  opacity: 1 !important;
  transform: none !important;
}
/* ── Card hover — subtle neutral shadow only, zero colour tint ── */
.app-card,
.game-card,
.featured-card,
.category-row,
.fp-qcat,
.upd-card,
.trending-card {
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  transform: none !important;
}
.app-card:hover      { box-shadow: 0 4px 16px rgba(0,0,0,0.14) !important; }
.fp-qcat:hover       { box-shadow: 0 4px 16px rgba(0,0,0,0.14) !important; }
.game-card:hover     { box-shadow: 0 6px 20px rgba(0,0,0,0.22) !important; }
.category-row:hover  { box-shadow: 0 3px 12px rgba(0,0,0,0.12) !important; }
.upd-card:hover      { box-shadow: 0 3px 10px rgba(0,0,0,0.10) !important; }
/* upd-cards are ALWAYS visible — never animated, never opacity:0 */
.upd-card,
.upd-card.pas-reveal,
.updates-grid .upd-card {
  opacity: 1 !important;
  transform: none !important;
  will-change: auto !important;
  transition: box-shadow 0.18s ease !important;
}

/* Lock image dimensions so they never stretch on hover */
.app-icon img,
.app-icon,
.game-card-img,
.upd-icon img,
.upd-icon,
.trending-thumb img,
.trending-thumb {
  flex-shrink: 0 !important;
  transform: none !important;
  transition: none !important;
}

/* upd-icon: fixed 68px — compact, fits 3-col on smallest phones */
.upd-icon {
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  min-height: 68px !important;
  max-width: 68px !important;
  max-height: 68px !important;
}
/* upd-card: min-width:0 MUST be kept — stops grid cell from expanding to text width */
.upd-card,
.updates-grid .upd-card {
  min-width: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
}
/* upd-name / upd-cat: guaranteed truncation */
.upd-name, .upd-cat {
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* ── Pulse on download button ── */
.sa-btn-dl, .dlp-btn-ready {
  position: relative;
  overflow: hidden;
}
.sa-btn-dl::after, .dlp-btn-ready::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 var(--primary-shadow);
  animation: pasButtonPulse 2.8s ease-out infinite;
}
@keyframes pasButtonPulse {
  0%   { box-shadow: 0 0 0 0 var(--primary-shadow); }
  60%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Section titles — plain colour, no clip/gradient effects ── */
.section-title {
  display: inline-flex !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--dark) !important;
}
/* Dark mode: --dark flips to #EDEDED automatically via CSS variable,
   but we also set explicitly for specificity */
body.dark-mode .section-title,
body.dark-mode h2.section-title,
body.dark-mode .section-header .section-title {
  color: #EDEDED !important;
}

/* ── Shimmer loading skeleton (enhanced) ── */
@keyframes pasShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

/* ── Scroll progress bar at top of page ── */
#pas-scroll-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 10000;
  background: linear-gradient(90deg, var(--primary), #9333ea);
  pointer-events: none;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ── Stagger entrance animations ── */
.pas-reveal {
  opacity: 0;
  /* NO transform — transform creates stacking contexts = huge blank sections */
  transition: opacity 0.5s ease;
}
.pas-reveal.pas-visible {
  opacity: 1;
}
.pas-delay-1 { transition-delay: 0.06s; }
.pas-delay-2 { transition-delay: 0.12s; }
.pas-delay-3 { transition-delay: 0.18s; }
.pas-delay-4 { transition-delay: 0.24s; }
.pas-delay-5 { transition-delay: 0.30s; }
.pas-delay-6 { transition-delay: 0.36s; }


/* ══════════════════════════════════════════════════════
   FIX: Vertical empty space / compress on hover
   Root causes:
   1. Logo img transform inside overflow:hidden triggers reflow
   2. game-card had conflicting transform transition
   3. translateY lifts on telegram-banner & fp-search-btn
   ══════════════════════════════════════════════════════ */

/* 1. Logo — replace rotate+scale with a subtle glow instead */
.logo-android-img {
  transition: filter 0.3s ease !important;
}
.site-logo:hover .logo-android-img {
  transform: none !important;
  filter: drop-shadow(0 0 6px var(--primary)) drop-shadow(0 2px 4px rgba(0,0,0,0.15)) !important;
}

/* 2. Game card — fully kill transform, shadow-only hover */
.game-card {
  transform: none !important;
  transition: box-shadow 0.18s ease, border-color 0.18s ease !important;
}
.game-card:hover {
  transform: none !important;
}

/* 3. Telegram banner — replace translateY lift with deeper shadow */
.telegram-banner {
  transition: opacity 0.18s ease, box-shadow 0.18s ease !important;
}
.telegram-banner:hover {
  transform: none !important;
  opacity: 0.93 !important;
  box-shadow: 0 8px 28px rgba(25, 118, 210, 0.45) !important;
}

/* 4. Search button — remove translateY lift */
.fp-search-btn {
  transition: opacity 0.18s ease !important;
}
.fp-search-btn:hover {
  transform: none !important;
  opacity: 0.85 !important;
}

/* 5. Safeguard: no element inside header or bottom-nav
      should ever cause a layout height change on hover */
.site-header *,
.bottom-nav * {
  line-height: inherit;
}
.nav-item:hover svg,
.btn-icon:hover svg {
  transform: none !important;
}

/* ── Hero badge shimmer ── */
.fp-badge {
  background: linear-gradient(135deg,
    rgba(99,102,241,.12) 0%,
    rgba(139,92,246,.22) 50%,
    rgba(99,102,241,.12) 100%
  );
  background-size: 200% 100%;
  animation: pasBadgeShimmer 3s ease infinite;
}
@keyframes pasBadgeShimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Gradient text animation on hero highlight ── */
.fp-hero-hl {
  background: linear-gradient(90deg, var(--primary), #9333ea, #3b82f6, var(--primary));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pasGradText 5s ease infinite;
}
@keyframes pasGradText {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Bottom nav active indicator pulse ── */
.nav-item.active svg {
  animation: pasNavPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pasNavPop {
  0%   { transform: scale(0.7); }
  100% { transform: scale(1); }
}

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .pas-orb, .pas-float-icon, .pas-header-bar,
  .fp-hero-hl, .fp-badge, .sa-btn-dl::after,
  .dlp-btn-ready::after, .pas-ripple { animation: none !important; }
  .pas-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ── Particle toggle button state ── */
#particle-toggle { transition: color 0.15s, background 0.15s; }
#particle-toggle:hover { background: rgba(0,0,0,0.06); }
body.dark-mode #particle-toggle:hover { background: rgba(255,255,255,0.08); }
/* When particles are off, button appears muted */
#particle-toggle[title*="Turn on"] {
  opacity: 0.45;
}
#particle-toggle[title*="Turn on"]:hover {
  opacity: 1;
}


/* ══════════════════════════════════════════════════════
   iOS / iPhone Bottom Navigation Fixes — v4.7.0
   ══════════════════════════════════════════════════════ */

/* 1. Force GPU compositing — fixes iOS Safari position:fixed
      disappearing / jumping when address bar shows/hides     */
.bottom-nav {
  -webkit-transform: translate3d(0, 0, 0) !important;
  transform: translate3d(0, 0, 0) !important;
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
  will-change: transform !important;
}

/* 2. Ensure semi-transparent bg so backdrop-filter blur shows */
.bottom-nav {
  background: rgba(255, 255, 255, 0.92) !important;
}
body.dark-mode .bottom-nav {
  background: rgba(8, 8, 8, 0.92) !important;
}

/* 3. Nav items stay in icon zone only — NOT in safe-area zone */
.nav-item {
  height: var(--bottom-nav-height, 64px) !important;
  max-height: var(--bottom-nav-height, 64px) !important;
  /* Remove 300ms tap delay on iOS */
  touch-action: manipulation !important;
}

/* 4. iOS safe-area — use both constant() and env() for full
      compatibility with iOS 11.0+ (constant) and 11.2+ (env) */
@supports (padding-bottom: constant(safe-area-inset-bottom)) {
  .bottom-nav {
    height: calc(var(--bottom-nav-height, 64px) + constant(safe-area-inset-bottom)) !important;
    padding-bottom: constant(safe-area-inset-bottom) !important;
  }
  body {
    padding-bottom: calc(var(--bottom-nav-height, 64px) + constant(safe-area-inset-bottom)) !important;
  }
}
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    height: calc(var(--bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
  body {
    padding-bottom: calc(var(--bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* 5. Prevent content scrolling under the fixed bar on all iOS pages */
.site-content, main, #main, .content-area {
  padding-bottom: calc(var(--bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px));
}

/* 6. Active tap feedback — faster on touch devices */
.nav-item:active {
  opacity: 0.65 !important;
  transition: opacity 0.08s ease !important;
}
