/* ==========================================================================
   Apkdownloadss.com - Clean, Modern & High-Performance APK Store UI
   Version: 2.5.0 (Royal Electric Indigo & Cyan Neon Cyber Theme)
   Inspired by premium modern app portals (APKPure / Uptodown / TapTap)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

/* --- Theme Design Tokens (Royal Electric Indigo & Cyan Neon) --- */
:root {
  /* Brand Accent Colors */
  --brand-primary: #4F46E5;       /* Royal Electric Indigo */
  --brand-primary-hover: #4338CA;
  --brand-primary-light: rgba(79, 70, 229, 0.12);
  --brand-primary-glow: rgba(79, 70, 229, 0.4);
  
  --brand-blue: #3B82F6;          /* Vibrant Electric Blue */
  --brand-cyan: #06B6D4;          /* Cyan Neon */
  --brand-purple: #8B5CF6;
  --brand-amber: #F59E0B;
  --star-gold: #FBBF24;
  --brand-red: #EF4444;

  /* Light Mode Palette */
  --bg-page: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-input: #F8FAFC;
  --bg-chip: #EEF2F6;
  --bg-chip-hover: #E2E8F0;
  
  --text-main: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  
  --border-color: #E2E8F0;
  --border-card: #E2E8F0;
  --border-hover: #4F46E5;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 14px rgba(79, 70, 229, 0.08), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px rgba(79, 70, 229, 0.12);
  --shadow-card-hover: 0 12px 28px rgba(79, 70, 229, 0.16), 0 4px 10px rgba(0, 0, 0, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --transition: all 0.2s ease-in-out;
  --navbar-height: 70px;
}

/* --- Dark Mode Palette (Default Midnight Sapphire) --- */
body.dark-theme, [data-theme="dark"] {
  --bg-page: #0B0F19;
  --bg-surface: #111827;
  --bg-card: #161F32;
  --bg-input: #0F172A;
  --bg-chip: #1E293B;
  --bg-chip-hover: #334155;

  --text-main: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --border-color: #26334D;
  --border-card: rgba(99, 102, 241, 0.16);
  --border-hover: #6366F1;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
  --shadow-card-hover: 0 12px 28px rgba(79, 70, 229, 0.3);
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   BUTTONS & BADGES (ROYAL ELECTRIC INDIGO & CYAN NEON)
   ========================================================================== */
.btn-primary, .btn-red, .btn-install, .btn-download-hero, .btn-download-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #4F46E5 0%, #3B82F6 50%, #06B6D4 100%) !important;
  color: #FFFFFF !important;
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-align: center;
  text-decoration: none !important;
}
.btn-primary:hover, .btn-red:hover, .btn-install:hover, .btn-download-hero:hover, .btn-download-main:hover {
  background: linear-gradient(135deg, #4338CA 0%, #2563EB 50%, #0891B2 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(6, 182, 212, 0.5);
  color: #FFFFFF !important;
}
.btn-primary:active, .btn-download-hero:active {
  transform: translateY(0);
}

.btn-size-tag, .btn-size-badge {
  background: rgba(0, 0, 0, 0.32);
  color: #FFFFFF !important;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

.btn-secondary, .btn-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-surface);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-decoration: none !important;
}
.btn-secondary:hover, .btn-white:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-1px);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-chip);
  color: var(--text-secondary);
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(6, 182, 212, 0.15);
  color: #22D3EE;
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

/* App Hero Banner */
.app-hero-banner {
  position: relative;
  width: 100%;
  height: 320px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-card);
  background: #0B1329;
}
.app-hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.65) saturate(1.2);
  transition: transform 0.4s ease;
}
.app-hero-banner:hover .app-hero-banner-img {
  transform: scale(1.02);
}
.app-hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.3) 0%, rgba(15, 23, 42, 0.88) 75%, rgba(15, 23, 42, 0.98) 100%);
  display: flex;
  align-items: flex-end;
  padding: 28px;
}
.app-hero-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
  flex-wrap: wrap;
}
.app-hero-main-flex {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 280px;
}
.app-hero-logo {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.app-hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  line-height: 1.2;
}
.app-hero-dev {
  font-size: 0.9rem;
  color: #A7F3D0;
  font-weight: 600;
  margin-bottom: 8px;
}
.app-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.badge-tag-category {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.badge-tag-verified {
  background: rgba(16, 185, 129, 0.25);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.badge-tag-version {
  background: rgba(59, 130, 246, 0.25);
  color: #93C5FD;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Screenshots Gallery */
.screenshots-gallery-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.screenshots-gallery-scroll::-webkit-scrollbar {
  height: 6px;
}
.screenshots-gallery-scroll::-webkit-scrollbar-thumb {
  background: var(--brand-primary);
  border-radius: 10px;
}
.screenshot-card {
  flex: 0 0 220px;
  height: 380px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  scroll-snap-align: start;
  transition: all 0.25s ease;
  background: var(--bg-input);
}
.screenshot-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  border-color: var(--brand-primary);
}
.screenshot-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.screenshot-card:hover img {
  transform: scale(1.03);
}
.screenshot-zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.screenshot-card:hover .screenshot-zoom-overlay {
  opacity: 1;
}

/* Lightbox Modal */
.screenshot-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.screenshot-modal.active {
  display: flex;
}
.screenshot-modal img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  object-fit: contain;
}
.screenshot-modal-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: #FFFFFF;
  font-size: 2.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}
.screenshot-modal-close:hover {
  color: #EF4444;
}

/* ==========================================================================
   HEADER / NAVBAR
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--navbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 20px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  flex-shrink: 0;
}
.header-logo-img {
  height: 48px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-logo:hover .header-logo-img {
  transform: scale(1.03);
}
.footer-logo-img {
  height: 44px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  display: block;
}
.drawer-logo-img {
  height: 38px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}
.nav-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10B981 0%, #3B82F6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.1rem;
}
.nav-logo-text span {
  color: var(--brand-primary);
}

/* Search Bar in Header */
.header-search-wrap {
  flex: 1;
  max-width: 460px;
  position: relative;
}
.header-search-wrap input {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0 40px 0 42px;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}
.header-search-wrap input:focus {
  border-color: var(--brand-primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}
.header-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Nav Menu Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link-item {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.nav-link-item:hover, .nav-link-item.active {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

/* Header Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.action-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}
.action-icon-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}

/* 3-Line Mobile Hamburger Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
}
.mobile-menu-btn:hover, .mobile-menu-btn:active {
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
}
.mobile-menu-btn span {
  display: block;
  height: 2.5px;
  width: 22px;
  background: var(--text-main);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile Drawer & Overlay */
#mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

#mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  z-index: 2000;
  padding: 24px 20px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
#mobile-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
#mobile-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
#mobile-drawer-close:hover {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.drawer-search-wrap {
  position: relative;
  margin-bottom: 20px;
}
.drawer-search-wrap input {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0 16px 0 40px;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}
.drawer-search-wrap input:focus {
  border-color: var(--brand-primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}
.drawer-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.drawer-nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.drawer-link-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid transparent;
  transition: var(--transition);
}
.drawer-link-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}
.drawer-link-item:hover, .drawer-link-item:active {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  transform: translateX(4px);
}
.drawer-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* ==========================================================================
   CATEGORY / FILTER CHIPS BAR
   ========================================================================== */
.filter-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  margin-bottom: 24px;
}
.filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar {
  display: none;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-chip);
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.filter-chip:hover {
  background: var(--bg-chip-hover);
  color: var(--text-main);
  text-decoration: none;
}
.filter-chip.active {
  background: linear-gradient(135deg, #4F46E5 0%, #3B82F6 100%);
  color: #FFFFFF;
  border-color: #6366F1;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
  text-decoration: none;
}

/* ==========================================================================
   FEATURED SPOTLIGHT HERO BANNER
   ========================================================================== */
.hero-spotlight {
  background: linear-gradient(135deg, #1E1B4B 0%, #0F172A 60%, #0B0F19 100%);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  color: #FFFFFF;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(99, 102, 241, 0.35);
  position: relative;
  overflow: hidden;
}
.hero-spotlight::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-spotlight-left {
  max-width: 620px;
  position: relative;
  z-index: 1;
}
.spotlight-badge, .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(236, 72, 153, 0.25) 100%);
  color: #FDE68A;
  border: 1px solid rgba(245, 158, 11, 0.4);
  backdrop-filter: blur(4px);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-spotlight h1, .hero-title {
  font-size: 2rem;
  color: #FFFFFF;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.hero-spotlight p, .hero-desc {
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin-bottom: 20px;
}
.hero-spotlight-actions, .hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-spotlight-right {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.12);
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.hero-app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.hero-app-info h3 {
  font-size: 1.15rem;
  color: #FFFFFF;
  margin-bottom: 2px;
}
.hero-app-info p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 6px;
}

/* ==========================================================================
   CLEAN APP CARDS & GRID LAYOUT
   ========================================================================== */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title-row h2 {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title-row p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
}

.app-card-icon {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-input);
  margin-bottom: 10px;
}
.app-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.app-card:hover .app-card-icon img {
  transform: scale(1.04);
}

.app-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card-category {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.app-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.app-card-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 700;
  color: var(--text-main);
}
.app-card-rating svg {
  width: 13px;
  height: 13px;
  fill: var(--star-gold);
}

.btn-card-download {
  width: 100%;
  padding: 9px 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0.08) 100%);
  color: #10B981 !important;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.84rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
  transition: all 0.2s ease-in-out;
  text-decoration: none !important;
}
.app-card:hover .btn-card-download, .btn-card-download:hover {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  color: #FFFFFF !important;
  border-color: #10B981 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

/* ==========================================================================
   TOP RANKINGS LIST (TOP CHARTS)
   ========================================================================== */
.top-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.ranking-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.ranking-box-header {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.ranking-item:hover {
  background: var(--bg-input);
}
.ranking-num {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 22px;
  text-align: center;
}
.ranking-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
}
.ranking-info {
  flex: 1;
  min-width: 0;
}
.ranking-title {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranking-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.ranking-btn {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-chip);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-primary);
}
.ranking-item:hover .ranking-btn {
  background: var(--brand-primary);
  color: #FFFFFF;
}

/* ==========================================================================
   APP DETAIL PAGE (CLEAN LAYOUT)
   ========================================================================== */
.app-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.detail-header-flex {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.detail-app-icon {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}
.detail-app-meta h1 {
  font-size: 1.85rem;
  margin-bottom: 4px;
}
.detail-app-dev {
  font-size: 0.95rem;
  color: var(--brand-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  text-align: center;
}
.detail-metric-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--border-color);
}
.detail-metric-box:last-child {
  border-right: none;
}
.metric-number {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}
.metric-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Specs Table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
}
.specs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}
.specs-table tr:last-child td {
  border-bottom: none;
}
.specs-table td.lbl {
  color: var(--text-muted);
  width: 35%;
  font-weight: 600;
}
.specs-table td.val {
  color: var(--text-main);
  font-weight: 700;
}

/* ==========================================================================
   DOWNLOAD PIPELINE (CLEAN & FAST)
   ========================================================================== */
.download-box {
  max-width: 580px;
  margin: 40px auto;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.download-countdown-num {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--brand-primary);
  font-family: var(--font-heading);
  margin: 10px 0;
}

/* ==========================================================================
   FOOTER (CLEAN & SIMPLE)
   ========================================================================== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 40px 0 20px;
  margin-top: 50px;
}
.footer-simple-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.footer-simple-grid h4 {
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.footer-simple-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-simple-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-simple-links a:hover {
  color: var(--brand-primary);
}

.footer-bottom-row {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .nav-links, .header-search-wrap {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .header-logo-img {
    height: 42px;
    max-width: 220px;
  }
  .hero-spotlight {
    flex-direction: column;
    padding: 20px;
  }
  .hero-spotlight-right {
    width: 100%;
  }
  .footer-simple-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MOBILE RESPONSIVE POLISH & SLEEK COMPACT TYPOGRAPHY
   ========================================================================== */
@media (max-width: 768px) {
  /* Typography Scale Down on Mobile */
  h1, .hero-title, .app-hero-title {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
    margin-bottom: 6px !important;
  }
  h2, .section-title-row h2 {
    font-size: 1.15rem !important;
    line-height: 1.3 !important;
    margin-bottom: 2px !important;
  }
  h3 {
    font-size: 1.05rem !important;
  }
  
  .section-title-row {
    margin-bottom: 12px !important;
    flex-wrap: wrap;
    gap: 8px;
  }
  .section-title-row p {
    font-size: 0.78rem !important;
    color: var(--text-muted);
    margin-bottom: 0 !important;
  }
  .section-title-row .btn-secondary {
    font-size: 0.78rem !important;
    padding: 5px 12px !important;
  }

  /* Spacing between sections */
  main.container {
    padding-top: 16px !important;
    padding-bottom: 40px !important;
  }
  div[style*="margin-bottom: 40px"], div[style*="margin-bottom:40px"] {
    margin-bottom: 24px !important;
  }

  /* Hero Spotlight on Mobile */
  .hero-spotlight {
    padding: 16px 18px !important;
    border-radius: var(--radius-lg) !important;
    margin-bottom: 24px !important;
    gap: 16px;
  }
  .hero-badge {
    font-size: 0.68rem !important;
    padding: 3px 8px !important;
    margin-bottom: 8px !important;
  }
  .hero-desc {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
    margin-bottom: 14px !important;
  }
  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 8px !important;
    width: 100%;
  }
  .hero-actions .btn-download-hero, .hero-actions .btn-secondary {
    width: 100% !important;
    padding: 10px 18px !important;
    font-size: 0.88rem !important;
  }
  .hero-spotlight-right {
    display: none !important; /* Hide redundant duplicate box inside hero on mobile */
  }

  /* App Hero Banner on App Page Mobile */
  .app-hero-banner {
    height: auto !important;
    min-height: 220px !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
  }
  .app-hero-banner-overlay {
    padding: 16px !important;
    position: relative !important;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
  }
  .app-hero-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .app-hero-main-flex {
    gap: 14px;
    width: 100%;
  }
  .app-hero-logo {
    width: 64px !important;
    height: 64px !important;
    border-radius: 14px !important;
  }
  .app-hero-action {
    width: 100%;
  }
  .btn-download-hero {
    width: 100% !important;
    padding: 11px 20px !important;
    font-size: 0.92rem !important;
  }
  
  /* Compact App Cards on Mobile */
  .apps-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 24px !important;
  }
  .app-card {
    padding: 10px !important;
    border-radius: 12px !important;
    min-height: auto !important;
  }
  .app-card-icon {
    border-radius: 12px !important;
    margin-bottom: 8px !important;
  }
  .app-card-title {
    font-size: 0.82rem !important;
    line-height: 1.25 !important;
    margin-bottom: 2px !important;
    height: 1.25em !important;
  }
  .app-card-category {
    font-size: 0.72rem !important;
    margin-bottom: 4px !important;
  }
  .app-card-meta {
    font-size: 0.72rem !important;
    margin-bottom: 6px !important;
  }
  .btn-card-download {
    padding: 6px 10px !important;
    font-size: 0.76rem !important;
    gap: 4px;
  }

  /* Screenshots Gallery on Mobile */
  .screenshot-card {
    flex: 0 0 160px !important;
    height: 280px !important;
    border-radius: 12px !important;
  }

  /* Detail Card & Specs on Mobile */
  .app-detail-card {
    padding: 16px !important;
    border-radius: 14px !important;
    margin-bottom: 16px !important;
  }
  .detail-metrics-row {
    padding: 10px 12px !important;
    gap: 6px !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .detail-metric-box:nth-child(2) {
    border-right: none !important;
  }
  .metric-number {
    font-size: 0.95rem !important;
  }
  .metric-text {
    font-size: 0.68rem !important;
  }
}
