/* =========================================================
   APKAPPS — Production styles (site.v3.css)
   Design system: light by default, Android-green accents,
   soft depth, clean typography, consistent grids.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root{
  /* Light (default) */
  --bg: #f7fafc;              /* page background */
  --panel: #ffffff;           /* panels/cards/header */
  --card: #ffffff;            /* card face */
  --text: #0f172a;            /* body text (slate-900) */
  --muted: #475569;           /* secondary text */
  --line: rgba(15,23,42,.08); /* borders */
  --shadow: 0 10px 28px rgba(2, 8, 23, .08);

  /* Brand + accents */
  --android: #3ddc84;         /* Android green */
  --android-ink: #062d12;     /* readable on green */
  --link: var(--android);     /* link color */
  --ok: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;

  /* Radii & spacing */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;

  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  --h1: 28px;
  --h2: 22px;
  --h3: 18px;
  --body: 15px;

  /* Icon size */
  --icon: 56px;
}

/* Dark theme tokens */
[data-theme="dark"]{
  --bg: #0f172a;              /* slate-900 */
  --panel: #111827;           /* gray-900 */
  --card: #0b1220;            /* deeper panel */
  --text: #e5e7eb;            /* gray-200 */
  --muted: #94a3b8;           /* slate-400 */
  --line: rgba(255,255,255,.08);
  --shadow: 0 16px 36px rgba(0,0,0,.36);
  --android: #3ddc84;
  --android-ink: #041f0c;
}

/* ---------- CSS reset-ish ---------- */
*{ box-sizing: border-box; }
html, body{ height:100%; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0; background:var(--bg); color:var(--text);
  font: 400 var(--body)/1.5 var(--font);
}

/* Links */
a{ color: var(--link); text-decoration: none; }
a:hover{ text-decoration: underline; }

/* Utilities */
.mute{ color: var(--muted); }
.hr{ height:1px; background: var(--line); margin: var(--space-4) 0; border:0; }
.shadow{ box-shadow: var(--shadow); }
.round{ border-radius: var(--r-md); }
.badge{
  display:inline-flex; align-items:center; gap:6px;
  height: 24px; padding: 0 10px;
  border-radius:999px; font-weight:700; font-size:12px;
  color: var(--text); background: rgba(0,0,0,.05);
  border:1px solid var(--line);
}
[data-theme="dark"] .badge{ background: rgba(255,255,255,.06); }

/* ---------- Layout ---------- */
.shell{ max-width: 1100px; margin: 0 auto; padding: 0 var(--space-4); }

.site-header{
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(150%) blur(8px);
  background: linear-gradient(to bottom, rgba(0,0,0,.06), transparent);
  border-bottom: 1px solid var(--line);
}
.site-header .row{
  display:flex; align-items:center; gap: var(--space-4);
  height: 64px;
}

.brand{
  font-weight: 900; letter-spacing:.2px;
  color: var(--text); text-decoration:none;
}

.nav{ margin-left:auto; display:flex; gap: var(--space-3); }
.nav a{
  color: var(--muted); padding: 8px 10px; border-radius: var(--r-sm);
}
.nav a:hover{ color: var(--text); background: rgba(0,0,0,.04); }
[data-theme="dark"] .nav a:hover{ background: rgba(255,255,255,.06); }

.theme-toggle{
  border:1px solid var(--line); background: var(--panel);
  color: var(--text); border-radius: var(--r-sm);
  padding: 8px 10px; cursor: pointer;
  box-shadow: var(--shadow);
}

main{ padding: var(--space-4) 0 var(--space-5); }
.page-title{ font-size: var(--h1); font-weight: 800; margin: 6px 0 var(--space-3); }

/* Footer */
.site-footer{
  border-top:1px solid var(--line);
  padding: var(--space-4) 0 var(--space-5);
  color: var(--muted);
}
.site-footer a{ color: var(--link); }

/* ---------- Grid system ---------- */
.grid{ display:grid; gap: var(--space-3); }
.grid-cards{ grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-list{ grid-template-columns: 1fr; gap: var(--space-3); }

.two-col{ display:grid; grid-template-columns: minmax(0,1fr) 320px; gap: var(--space-4); }
@media (max-width: 1040px){
  .two-col{ grid-template-columns: 1fr; }
}

/* ---------- Card primitives ---------- */
.card{
  background: linear-gradient(180deg, var(--panel), var(--card));
  border:1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: var(--space-3);
}

/* Mini list card (home/library list row) */
.app-mini{
  display:grid; grid-template-columns: var(--icon) 1fr auto;
  align-items:center; gap: var(--space-3);
  padding: var(--space-3);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border:1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  text-decoration:none; color: var(--text);
}
.app-mini:hover{ filter: brightness(0.99); text-decoration:none; }
.app-mini .icon{
  width: var(--icon); height: var(--icon);
  border-radius: 14px; object-fit: cover;
  border:1px solid var(--line); background: rgba(0,0,0,.05);
}
.app-mini .title{
  font-weight: 800; line-height:1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.app-mini .sub{ color: var(--muted); font-size: 13px; margin-top: 2px; }
.app-mini .rating{ color: var(--ok); font-weight: 700; font-size: 14px; }
.app-mini .cta{ color: var(--link); font-weight: 800; }

/* Category card (on /categories) */
.cat-card .cat-head{
  display:flex; align-items:center; justify-content:space-between; margin-bottom: var(--space-2);
}
.cat-card .cat-name{ font-weight: 900; color: var(--text); }
.cat-card .sample{
  display:flex; gap: var(--space-3); align-items:center;
  padding-top: var(--space-2); border-top:1px dashed var(--line);
  color: var(--text); text-decoration:none;
}
.cat-card .sample .icon{
  width: var(--icon); height: var(--icon); border-radius: 12px; object-fit: cover;
  border:1px solid var(--line); background: rgba(0,0,0,.05);
}
.cat-card .sample .title{
  font-weight: 800; line-height:1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-card .sample .rating{ color: var(--ok); font-weight:700; font-size: 14px; margin-top: 2px; }
.cat-card .sample .cta{ color: var(--link); font-weight: 800; margin-top: 4px; }

/* App tile card grid (if you use grid-cards for apps) */
.app-card{
  display:flex; gap: var(--space-3); align-items:flex-start;
  padding: var(--space-3);
}
.app-card .icon{
  width: 64px; height: 64px; border-radius: 14px; object-fit: cover;
  border:1px solid var(--line); background: rgba(0,0,0,.05);
}
.app-card .title{
  font-size: var(--h3); font-weight: 900; line-height:1.2; margin-bottom: 2px;
}
.app-card .meta{ color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 10px 14px; border-radius: 12px; font-weight: 800;
  border:1px solid var(--line); background: var(--panel); color: var(--text);
  box-shadow: var(--shadow); cursor: pointer; text-decoration:none;
}
.btn:hover{ filter: brightness(0.98); text-decoration:none; }
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: var(--android); border-color: transparent; color: var(--android-ink);
}
.btn-secondary{
  background: linear-gradient(180deg, var(--panel), var(--card));
}
.btn-ghost{
  background: transparent; border-color: var(--line); color: var(--text);
}

/* Button group (e.g., on details page) */
.btn-row{ display:flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Forms / search ---------- */
.input{
  width:100%; padding: 10px 12px; border-radius: 12px;
  border:1px solid var(--line); background: var(--panel); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(0,0,0,.04);
}
.input:focus{ outline: 2px solid rgba(61,220,132,.35); }

/* ---------- Key/Value lists for details ---------- */
.kv{ display:grid; grid-template-columns: 160px 1fr; gap: 10px; margin-top: 12px; }
.kv .k{ color: var(--muted); }
.kv .v{ color: var(--text); word-break: break-word; }
@media (max-width: 640px){
  .kv{ grid-template-columns: 1fr; }
}

/* Permissions list */
.permissions{
  display:flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(0,0,0,.05); border:1px solid var(--line);
  font-size: 12px; color: var(--text);
}
[data-theme="dark"] .pill{ background: rgba(255,255,255,.06); }

/* ---------- Ads placeholders ---------- */
.ad-slot{
  display:grid; place-items:center; min-height: 90px;
  background: rgba(0,0,0,.04); border:1px dashed var(--line);
 /*border-radius: var(--r-md); color: var(--muted);*/
margin:20px;
padding:10px;
}
[data-theme="dark"] .ad-slot{ background: rgba(255,255,255,.04); }
.ad-leaderboard{ min-height: 90px; }
.ad-rectangle{ min-height: 250px; }
.ad-inline{ min-height: 120px; }

/* ---------- Hero/detail header ---------- */
.hero{
  display:flex; gap: var(--space-4); align-items:center;
  padding: var(--space-4); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border:1px solid var(--line); box-shadow: var(--shadow);
}
.hero .icon{
  width: 84px; height: 84px; border-radius: 18px; object-fit: cover;
  border:1px solid var(--line); background: rgba(0,0,0,.05);
}
.hero .title{ font-size: 30px; font-weight: 900; margin: 0; line-height: 1.1; }
.hero .sub{ color: var(--muted); margin-top: 4px; }

/* ---------- Tables (if any) ---------- */
.table{
  width:100%; border-collapse: collapse; overflow:hidden; border-radius: var(--r-md);
  background: var(--panel); box-shadow: var(--shadow);
  border:1px solid var(--line);
}
.table th, .table td{ padding: 12px 14px; border-top:1px solid var(--line); }
.table th{ text-align:left; background: rgba(0,0,0,.03); font-weight:800; }

/* ---------- Fixes / safety overrides ---------- */
/* Prevent any stray rule from re-forcing a right rail layout */
main.shell, main .shell{ display:block !important; }
/* Ensure .grid never becomes a 2-col layout accidentally */
.grid{ grid-template-columns: initial !important; }
/* Our card grid always wins */
.grid-cards{ grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; }

/* Header search tweaks */
.nav-search{ width: 320px; margin-left: 10px; }
.nav-search .input{ height: 36px; font-size: 14px; }
@media (max-width: 900px){
  .nav-search{ display:none; } /* collapse search on small screens */
}

/* ========== HOME PAGE SPECIFIC STYLES ========== */

/* Hero Home */
.hero-home{
  background: linear-gradient(135deg, var(--panel) 0%, var(--card) 100%);
  border:1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  overflow: hidden;
  margin-top: 20px;
}

.hero-content{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-4);
}

@media (min-width: 900px){
  .hero-content{
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
  }
}

.hero-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--android);
  color: var(--android-ink);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: var(--space-3);
}

.hero-title{
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 var(--space-3) 0;
  letter-spacing: -0.02em;
}

@media (max-width: 768px){
  .hero-title{ font-size: 32px; }
}

.hero-description{
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 var(--space-4) 0;
  max-width: 540px;
}

.hero-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-lg{
  padding: 14px 24px;
  font-size: 16px;
}

/* Hero Visual Showcase */
.hero-app-showcase{
  position: relative;
  height: 280px;
  display: none;
}

@media (min-width: 900px){
  .hero-app-showcase{ display: block; }
}

.showcase-item{
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 28px;
  box-shadow: 0 12px 32px rgba(0,0,0,.15);
  border: 3px solid var(--panel);
  overflow: hidden;
  background: var(--card);
}

.showcase-item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-1{
  top: 0;
  right: 120px;
  z-index: 3;
  animation: float 6s ease-in-out infinite;
}

.showcase-2{
  top: 60px;
  right: 20px;
  z-index: 2;
  width: 120px;
  height: 120px;
  animation: float 6s ease-in-out infinite 1s;
}

.showcase-3{
  top: 140px;
  right: 160px;
  z-index: 1;
  width: 100px;
  height: 100px;
  animation: float 6s ease-in-out infinite 2s;
}

@keyframes float{
  0%, 100%{ transform: translateY(0px); }
  50%{ transform: translateY(-20px); }
}

/* Stats Bar */
.stats-bar{
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: var(--space-4);
  background: rgba(0,0,0,.02);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

[data-theme="dark"] .stats-bar{
  background: rgba(255,255,255,.03);
}

.stat-item{
  text-align: center;
}

.stat-value{
  font-size: 24px;
  font-weight: 900;
  color: var(--android);
  line-height: 1;
}

.stat-label{
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.stat-divider{
  width: 1px;
  height: 32px;
  background: var(--line);
}

@media (max-width: 640px){
  .stats-bar{ flex-wrap: wrap; gap: var(--space-3); }
  .stat-divider{ display: none; }
}

/* Home Sections */
.home-section{
  margin-bottom: var(--space-5);
}

.section-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title{
  font-size: 24px;
  font-weight: 900;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title.centered{
  text-align: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.title-icon{
  font-size: 24px;
}

.section-subtitle{
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 0 0;
}

.section-link{
  color: var(--android);
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}

.section-link-sm{
  color: var(--android);
  font-weight: 700;
  font-size: 14px;
}

/* Categories Grid */
.categories-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}

.category-tile{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.category-tile:hover{
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  text-decoration: none;
}

.category-icon{
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.category-name{
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}

.category-count{
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* Dual Section Layout */
.dual-section{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (min-width: 900px){
  .dual-section{
    grid-template-columns: 1fr 1fr;
  }
}

/* Compact App List */
.app-compact-list{
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.app-compact{
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.app-compact:hover{
  transform: translateX(4px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.app-compact-icon{
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.05);
  flex-shrink: 0;
}

.app-compact-info{
  flex: 1;
  min-width: 0;
}

.app-compact-title{
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-compact-meta{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rating-sm{
  color: var(--ok);
  font-weight: 700;
}

.sep{
  color: var(--line);
}

.rank-badge{
  width: 28px;
  height: 28px;
  background: var(--android);
  color: var(--android-ink);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}

.badge-new{
  background: var(--ok);
  color: white;
  font-size: 10px;
  padding: 4px 8px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

/* Features Grid */
.features-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.feature-card{
  padding: var(--space-4);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: center;
  box-shadow: var(--shadow);
}

.feature-icon{
  font-size: 48px;
  margin-bottom: var(--space-3);
}

.feature-title{
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 var(--space-2) 0;
}

.feature-text{
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Empty States */
.empty-state{
  text-align: center;
  padding: var(--space-5);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
}

.empty-icon{
  font-size: 48px;
  margin-bottom: var(--space-2);
  opacity: 0.5;
}

.empty-text{
  color: var(--muted);
  font-size: 15px;
}

.empty-state-sm{
  text-align: center;
  padding: var(--space-4);
  color: var(--muted);
  font-size: 14px;
}

/* Enhanced app-mini for home */
.app-mini-info{
  flex: 1;
  min-width: 0;
}

.app-mini .cta{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--android);
  color: var(--android-ink);
  flex-shrink: 0;
}

.app-mini .cta svg{
  flex-shrink: 0;
}



/* ========== UPDATED HOME PAGE STYLES ========== */

/* Hero Illustration */
.hero-illustration{
  position: relative;
  height: 280px;
  display: none;
}

@media (min-width: 900px){
  .hero-illustration{ display: block; }
}

.android-graphic{
  width: 200px;
  height: 240px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 16px rgba(61, 220, 132, 0.2));
}

/* Floating Elements */
.float-element{
  position: absolute;
  animation: gentle-float 4s ease-in-out infinite;
}

.float-1{
  top: 20px;
  right: 40px;
  animation-delay: 0s;
}

.float-2{
  bottom: 60px;
  right: 120px;
  animation-delay: 1.5s;
}

.float-3{
  top: 140px;
  right: 20px;
  animation-delay: 3s;
}

@keyframes gentle-float{
  0%, 100%{ transform: translateY(0px) rotate(0deg); }
  50%{ transform: translateY(-15px) rotate(5deg); }
}

/* Placeholder Icons */
.placeholder-icon{
  width: var(--icon);
  height: var(--icon);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--android) 0%, var(--ok) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--android-ink);
  opacity: 0.9;
}

.placeholder-icon-sm{
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--android) 0%, var(--ok) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--android-ink);
  opacity: 0.9;
  flex-shrink: 0;
}

/* Category Icon Placeholders */
.category-icon-placeholder{
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--android) 0%, var(--ok) 100%);
  color: white;
}

[data-category="game"] .category-icon-placeholder{
  background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
}

[data-category="social"] .category-icon-placeholder{
  background: linear-gradient(135deg, #4ECDC4 0%, #44A8A0 100%);
}

[data-category="tools"] .category-icon-placeholder{
  background: linear-gradient(135deg, #95E1D3 0%, #7BC9BB 100%);
}

[data-category="entertainment"] .category-icon-placeholder{
  background: linear-gradient(135deg, #F38181 0%, #E66767 100%);
}

[data-category="productivity"] .category-icon-placeholder{
  background: linear-gradient(135deg, #AA96DA 0%, #9580C4 100%);
}

[data-category="education"] .category-icon-placeholder{
  background: linear-gradient(135deg, #FCBAD3 0%, #F5A4C7 100%);
}

/* Google AdSense Placeholder Styling */
.adsense-placeholder{
  position: relative;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--card) 0%, var(--panel) 100%);
}

.ad-label{
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  opacity: 0.6;
  font-weight: 700;
}

/* AdSense responsive styling */
.adsbygoogle{
  display: block;
  width: 100%;
  min-height: inherit;
  background: transparent;
}

/* Ad slot specific heights */
.ad-leaderboard .adsense-placeholder{
  min-height: 90px;
}

.ad-rectangle .adsense-placeholder{
  min-height: 250px;
}

.ad-inline .adsense-placeholder{
  min-height: 120px;
}

@media (max-width: 768px){
  .ad-leaderboard .adsense-placeholder{
    min-height: 50px;
  }
  
  .ad-rectangle .adsense-placeholder{
    min-height: 250px;
  }
}

/* Feature Icons SVG styling */
.feature-icon svg{
  filter: drop-shadow(0 4px 8px rgba(61, 220, 132, 0.2));
}

/* Enhanced empty state */
.empty-state{
  background: linear-gradient(135deg, var(--panel) 0%, var(--card) 100%);
}

/* Improved app-mini for missing icons */
.app-mini .icon{
  background: linear-gradient(135deg, var(--panel) 0%, var(--card) 100%);
}

/* Dark mode adjustments for placeholders */
[data-theme="dark"] .placeholder-icon,
[data-theme="dark"] .placeholder-icon-sm{
  opacity: 0.8;
}

[data-theme="dark"] .adsense-placeholder{
  background: linear-gradient(135deg, var(--panel) 0%, var(--card) 100%);
}


/* Three-column section (responsive) */
.triple-section{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (max-width: 1100px){
  .triple-section{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px){
  .triple-section{ grid-template-columns: 1fr; }
}

/* Consistent section header link size */
.section-link-sm{
  color: var(--android);
  font-weight: 700;
  font-size: 14px;
}

/* Tighten card spacing in columns */
.triple-section .app-compact-list{ gap: 10px; }


/* Header actions */
.search-toggle{
  display:none;
  border:1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* Desktop search input */
.nav-search{ width: 360px; margin-left: 10px; }
.nav-search .input{ height: 36px; font-size: 14px; }

/* Mobile search panel (hidden by default) */
.mobile-search-panel{
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--card));
  box-shadow: var(--shadow);
}
.mobile-search-panel.open{ display:block; }
.mobile-search-form{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 0;
}

/* Responsive behavior */
@media (max-width: 900px){
  .nav-search{ display:none; }       /* hide desktop search */
  .search-toggle{ display:inline-flex; align-items:center; gap:6px; }
  .mobile-search-panel[hidden]{ display:none; }
}


/* === Navbar Logo === */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-strong);
  text-decoration: none;
}

.site-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  filter: drop-shadow(0 0 4px rgba(0, 255, 0, 0.2));
  transition: transform 0.2s ease, filter 0.3s ease;
}

.site-logo:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 6px rgba(0, 255, 0, 0.4));
}

.brand-text {
  color: inherit;
  font-family: 'Inter', sans-serif;
}

[data-theme="dark"] .site-logo {
  filter: drop-shadow(0 0 5px rgba(0, 255, 0, 0.4));
}


/* Visibility helpers */
.hide-mobile { display: none; }
.show-mobile { display: flex; }
@media (min-width: 900px){
  .hide-mobile { display: initial; }
  .show-mobile { display: none; }
}

/* Mobile icon buttons */
.icon-btn{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  box-shadow: var(--shadow);
}

/* Keep header row tidy on mobile */
.mobile-controls{ gap: 10px; margin-left: auto; }
.brand{ min-width: 0; } .brand-text{ white-space: nowrap; }

/* Panels */
.mobile-search-panel,
.mobile-menu{
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--card));
}

/* Full-width button in menu */
.w-full{ width: 100%; }

/* (Optional) prevent page jump when panels open/close */
body.nav-open, body.search-open { overflow: hidden; }


/* ---- Mobile overflow fixes (details page + globals) ---- */

/* 1) Never let the page scroll horizontally due to tiny overshoots */
html, body { overflow-x: hidden; }

/* 2) Shrink container padding on small screens */
@media (max-width: 640px){
  .shell { padding-left: 12px; padding-right: 12px; }
}

/* 3) Make hero block wrap nicely and icons scale down */
@media (max-width: 720px){
  .hero { flex-wrap: wrap; padding: 14px; }
  .hero .icon { width: 64px; height: 64px; border-radius: 14px; }
  .hero .title { font-size: 22px; }
}

/* 4) Details key/value: force long values to break */
.kv .v,
.kv .v * {
  overflow-wrap: anywhere;     /* preferred modern */
  word-break: break-word;      /* fallback */
}

/* If you show hashes/long IDs inside <code>, force a break */
.kv .v code { word-break: break-all; }

/* 5) Images/SVGs must never overflow their parent */
img, svg, video { max-width: 100%; height: auto; }

/* 6) Buttons/links shouldn’t force wide rows on mobile */
@media (max-width: 640px){
  .btn-row { gap: 8px; }
  .btn { white-space: normal; }
}

/* 7) Tables: allow horizontal scroll instead of forcing page overflow */
.table { display: block; overflow-x: auto; }

/* 8) Side rail (ads/extra) should stack on small screens — already handled by .two-col,
   but this ensures no rogue widths cause overflow */
@media (max-width: 1040px){
  .two-col { grid-template-columns: 1fr; }
}

/* 9) Ad slots fit narrow screens without pushing layout */
.ad-slot { width: 100%; }

/* 10) Mobile search/menu panels must not create overflow */
.mobile-search-form { grid-template-columns: 1fr auto; }
.mobile-search-panel, .mobile-menu { width: 100%; }

/* 11) Prevent long app titles or package names from pushing width */
.app-compact-title,
.app-mini .title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 640px){
  .app-mini { grid-template-columns: 48px 1fr auto; }
}


/* ========== APP DETAIL PAGE ENHANCEMENTS ========== */

/* Breadcrumb styling */
.crumbs {
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.crumbs a:hover {
  color: var(--android) !important;
  text-decoration: none;
}

/* Hero icon placeholder */
.hero .placeholder-icon {
  background: linear-gradient(135deg, var(--android) 0%, var(--ok) 100%);
  color: var(--android-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Package name styling */
.pkg {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--r-xs);
  font-size: 13px;
}

[data-theme="dark"] .pkg {
  background: rgba(255, 255, 255, 0.06);
}

/* Enhanced button for downloads */
.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
}

/* Key-value grid improvements */
.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-2) var(--space-3);
  row-gap: var(--space-3);
}

.kv .k {
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}

.kv .v {
  color: var(--text);
  font-size: 14px;
}

@media (max-width: 768px) {
  .kv {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
  
  .kv .k {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
}

/* Permissions list improvements */
.permissions {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.permissions .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .permissions .pill {
  background: rgba(255, 255, 255, 0.06);
}

.permissions .pill:hover {
  background: var(--android);
  color: var(--android-ink);
  border-color: var(--android);
  transform: translateY(-1px);
}

/* Sidebar improvements */
.sidebar .panel {
  position: sticky;
  top: 84px;
}

/* Two-column responsive behavior */
@media (max-width: 1024px) {
  .two-col {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    margin-top: var(--space-5);
  }
  
  .sidebar .panel {
    position: static;
  }
}

/* Code blocks */
code.mono {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
}

/* Enhanced badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge svg {
  flex-shrink: 0;
}

/* Star rating display */
.star-rating {
  display: inline-flex;
  gap: 2px;
}


/* ========== CATEGORIES PAGE STYLING ========== */

/* Categories Showcase Grid */
.categories-showcase {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

@media (min-width: 640px) {
  .categories-showcase {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .categories-showcase {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Category Card */
.category-card {
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--android);
  text-decoration: none;
}

.category-card-inner {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  position: relative;
  min-height: 200px;
}

/* Category Icon */
.category-icon-large {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  transition: all 0.3s ease;
}

.category-card:hover .category-icon-large {
  transform: scale(1.1) rotate(5deg);
}

/* Category-specific colors */
[data-category="game"] .category-icon-large,
[data-category="games"] .category-icon-large {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
  color: white;
}

[data-category="social"] .category-icon-large,
[data-category="communication"] .category-icon-large {
  background: linear-gradient(135deg, #4ECDC4 0%, #44A8A0 100%);
  color: white;
}

[data-category="tools"] .category-icon-large,
[data-category="productivity"] .category-icon-large {
  background: linear-gradient(135deg, #95E1D3 0%, #7BC9BB 100%);
  color: white;
}

[data-category="entertainment"] .category-icon-large,
[data-category="media"] .category-icon-large {
  background: linear-gradient(135deg, #F38181 0%, #E66767 100%);
  color: white;
}

[data-category="education"] .category-icon-large,
[data-category="books"] .category-icon-large {
  background: linear-gradient(135deg, #FCBAD3 0%, #F5A4C7 100%);
  color: white;
}

[data-category="music"] .category-icon-large,
[data-category="audio"] .category-icon-large {
  background: linear-gradient(135deg, #AA96DA 0%, #9580C4 100%);
  color: white;
}

[data-category="shopping"] .category-icon-large,
[data-category="business"] .category-icon-large {
  background: linear-gradient(135deg, #FFA07A 0%, #FF7F50 100%);
  color: white;
}

/* Default category color */
.category-icon-large:not([data-category*="game"]):not([data-category*="social"]):not([data-category*="tool"]):not([data-category*="entertainment"]):not([data-category*="education"]):not([data-category*="music"]):not([data-category*="shopping"]) {
  background: linear-gradient(135deg, var(--android) 0%, var(--ok) 100%);
  color: var(--android-ink);
}

/* Category Content */
.category-card-content {
  flex: 1;
}

.category-card-title {
  font-size: var(--h2);
  font-weight: 900;
  color: var(--text);
  margin: 0 0 var(--space-2) 0;
  line-height: 1.2;
}

.category-card-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.category-card-description {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Category Arrow */
.category-card-arrow {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  width: 36px;
  height: 36px;
  background: var(--android);
  color: var(--android-ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.category-card:hover .category-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Featured Categories Grid */
.featured-categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .featured-categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Featured Category Card */
.featured-category-card {
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.featured-category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--android);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.featured-category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  border-color: var(--android);
  text-decoration: none;
}

.featured-category-card:hover::before {
  transform: scaleX(1);
}

/* Rank Badge */
.featured-category-rank {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  background: var(--android);
  color: var(--android-ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(61, 220, 132, 0.3);
}

.featured-category-card.rank-1 .featured-category-rank {
  background: linear-gradient(135deg, #FFD700, #FFA500);
}

.featured-category-card.rank-2 .featured-category-rank {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
}

.featured-category-card.rank-3 .featured-category-rank {
  background: linear-gradient(135deg, #CD7F32, #B8860B);
}

/* Featured Category Icon */
.featured-category-icon {
  width: 88px;
  height: 88px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3) auto;
  transition: transform 0.3s ease;
}

.featured-category-card:hover .featured-category-icon {
  transform: scale(1.1);
}

/* Inherit colors from category-icon-large */
.featured-category-icon[data-category] {
  background: inherit;
}

[data-category="game"] .featured-category-icon,
[data-category="games"] .featured-category-icon {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
  color: white;
}

[data-category="social"] .featured-category-icon,
[data-category="communication"] .featured-category-icon {
  background: linear-gradient(135deg, #4ECDC4 0%, #44A8A0 100%);
  color: white;
}

/* Featured Category Content */
.featured-category-content {
  text-align: center;
}

.featured-category-title {
  font-size: var(--h2);
  font-weight: 900;
  color: var(--text);
  margin: 0 0 var(--space-2) 0;
}

.featured-category-stats {
  margin-bottom: var(--space-3);
  font-size: 14px;
  color: var(--muted);
}

.featured-category-stats .stat-item strong {
  color: var(--android);
  font-weight: 900;
}

.featured-category-cta {
  color: var(--android);
  font-weight: 800;
  font-size: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .category-card-inner {
    min-height: 160px;
  }
  
  .category-icon-large {
    width: 56px;
    height: 56px;
  }
  
  .category-card-title {
    font-size: 18px;
  }
  
  .featured-category-icon {
    width: 72px;
    height: 72px;
  }
}


/* ========== SINGLE CATEGORY PAGE ========== */

/* Category Header */
.category-header {
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow);
}

.category-header-content {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.category-header-icon {
  width: 88px;
  height: 88px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Category-specific colors */
[data-category="game"] .category-header-icon,
[data-category="games"] .category-header-icon {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
  color: white;
}

[data-category="social"] .category-header-icon,
[data-category="communication"] .category-header-icon {
  background: linear-gradient(135deg, #4ECDC4 0%, #44A8A0 100%);
  color: white;
}

[data-category="tools"] .category-header-icon,
[data-category="productivity"] .category-header-icon {
  background: linear-gradient(135deg, #95E1D3 0%, #7BC9BB 100%);
  color: white;
}

[data-category="entertainment"] .category-header-icon,
[data-category="media"] .category-header-icon {
  background: linear-gradient(135deg, #F38181 0%, #E66767 100%);
  color: white;
}

/* Default */
.category-header-icon:not([data-category*="game"]):not([data-category*="social"]):not([data-category*="tool"]):not([data-category*="entertainment"]) {
  background: linear-gradient(135deg, var(--android) 0%, var(--ok) 100%);
  color: var(--android-ink);
}

.category-header-info {
  flex: 1;
  min-width: 200px;
}

.category-header-title {
  font-size: 32px;
  font-weight: 900;
  margin: 0 0 6px 0;
  color: var(--text);
  line-height: 1.1;
}

.category-header-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

.category-header-back {
  margin-left: auto;
}

.category-back-text {
  display: none;
}

@media (min-width: 640px) {
  .category-back-text {
    display: inline;
  }
}

@media (max-width: 768px) {
  .category-header {
    padding: var(--space-4);
  }
  
  .category-header-icon {
    width: 64px;
    height: 64px;
  }
  
  .category-header-title {
    font-size: 24px;
  }
  
  .category-header-back {
    width: 100%;
    justify-content: center;
  }
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.filter-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.filter-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4L6 8L10 4' stroke='%23475569' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-select:focus {
  outline: 2px solid var(--android);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-bar-left,
  .filter-bar-right {
    width: 100%;
  }
  
  .filter-select {
    width: 100%;
  }
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

@media (min-width: 480px) {
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .apps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .apps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .apps-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* App Grid Item */
.app-grid-item {
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-3);
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.app-grid-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--android);
  text-decoration: none;
}

/* App Icon */
.app-grid-icon {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto;
}

.app-grid-icon img {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--card);
}

/* App Icon Placeholder */
.app-icon-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--android) 0%, var(--ok) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--android-ink);
  border: 1px solid var(--line);
}

/* App Info */
.app-grid-info {
  text-align: center;
  flex: 1;
}

.app-grid-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.app-grid-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.app-grid-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--warn);
  font-weight: 700;
}

.app-grid-installs {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.app-grid-developer {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* App Action */
.app-grid-action {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  width: 32px;
  height: 32px;
  background: var(--android);
  color: var(--android-ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.app-grid-item:hover .app-grid-action {
  opacity: 1;
  transform: scale(1);
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  padding: var(--space-4) 0;
}

/* Empty State */
.empty-state-large {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  margin: var(--space-5) 0;
}

.empty-icon-large {
  margin-bottom: var(--space-4);
}

.empty-title {
  font-size: 24px;
  font-weight: 900;
  margin: 0 0 var(--space-2) 0;
  color: var(--text);
}

.empty-message {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  max-width: 400px;
  margin: 0 auto;
}

/* Related Categories Grid */
.related-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}

.related-category-card {
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-3);
  text-decoration: none;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.related-category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--android);
  text-decoration: none;
}

.related-category-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-2) auto;
  background: linear-gradient(135deg, var(--android) 0%, var(--ok) 100%);
  color: var(--android-ink);
}

.related-category-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.related-category-count {
  font-size: 12px;
  color: var(--muted);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
  .apps-grid {
    gap: var(--space-2);
  }
  
  .app-grid-item {
    padding: var(--space-2);
  }
  
  .app-grid-icon {
    width: 56px;
    height: 56px;
  }
  
  .app-grid-icon img,
  .app-icon-placeholder {
    border-radius: 12px;
  }
  
  .app-icon-placeholder svg {
    width: 24px;
    height: 24px;
  }
  
  .app-grid-title {
    font-size: 14px;
    min-height: auto;
    -webkit-line-clamp: 1;
  }
  
  .app-grid-meta {
    font-size: 11px;
  }
  
  .app-grid-developer {
    font-size: 11px;
  }
  
  .app-grid-action {
    width: 28px;
    height: 28px;
    bottom: var(--space-2);
    right: var(--space-2);
  }
  
  .app-grid-action svg {
    width: 16px;
    height: 16px;
  }
}

/* Touch device improvements */
@media (hover: none) {
  .app-grid-action {
    opacity: 1;
    transform: scale(1);
  }
}

/* Loading skeleton animation
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
*/

.app-icon-placeholder {
  animation: skeleton-pulse 2s ease-in-out infinite;
}

/* Focus states for accessibility */
.app-grid-item:focus-visible {
  outline: 2px solid var(--android);
  outline-offset: 2px;
}

.filter-select:focus-visible {
  outline: 2px solid var(--android);
  outline-offset: 2px;
}



/* ========== HOME PAGE V2 REDESIGN ========== */

/* Hero Section V2 */
.hero-home-v2 {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: var(--space-8) 0;
  margin-bottom: var(--space-5);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}

[data-theme="dark"] .hero-home-v2 {
  background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content-wrapper {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  text-align: center;
}

.hero-badge-line {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border-radius: var(--r-full);
  color: white;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.3);
}

.hero-main-title {
  font-size: 48px;
  font-weight: 900;
  color: white;
  margin: 0 0 var(--space-3) 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-main-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.9);
  margin: 0 0 var(--space-5) 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .hero-home-v2 {
    padding: var(--space-5) 0;
  }
  
  .hero-main-title {
    font-size: 32px;
  }
  
  .hero-main-subtitle {
    font-size: 16px;
  }
}

/* Hero Search V2 */
.hero-search-v2 {
  display: flex;
  align-items: center;
  background: white;
  border-radius: var(--r-full);
  padding: 6px 6px 6px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  margin-bottom: var(--space-4);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.search-icon {
  display: flex;
  align-items: center;
  color: var(--muted);
  margin-right: 12px;
}

.hero-search-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 16px;
  color: var(--text);
  outline: none;
  padding: 12px 0;
}

.hero-search-input::placeholder {
  color: var(--muted);
}

.hero-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--android);
  color: var(--android-ink);
  border: none;
  border-radius: var(--r-full);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-search-btn:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(61, 220, 132, 0.4);
}

@media (max-width: 640px) {
  .hero-search-v2 {
    padding: 4px 4px 4px 16px;
  }
  
  .hero-search-btn span {
    display: none;
  }
  
  .hero-search-btn {
    padding: 12px;
  }
}

/* Hero Stats Row */
.hero-stats-row {
  display: flex;
  justify-content: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.hero-stat svg {
  opacity: 0.8;
}

/* Section Header V2 */
.section-header-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
  flex-wrap: wrap;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--android), var(--ok));
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.section-title-v2 {
  font-size: 24px;
  font-weight: 900;
  margin: 0;
  color: var(--text);
}

.section-subtitle-v2 {
  font-size: 14px;
  color: var(--muted);
  margin: 2px 0 0 0;
}

.section-link-v2 {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--android);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.section-link-v2:hover {
  gap: 10px;
}

.section-title-centered {
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  margin: 0 0 var(--space-5) 0;
}

/* Featured Cards V2 */
.horizontal-scroll-v2 {
  margin: 0 calc(-1 * var(--space-4));
  padding: 0 var(--space-4);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.horizontal-scroll-v2::-webkit-scrollbar {
  height: 6px;
}

.horizontal-scroll-v2::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.scroll-container-v2 {
  display: flex;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
}

.featured-card-v2 {
  flex: 0 0 200px;
}

.featured-card-link {
  display: block;
  text-decoration: none;
}

.featured-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-md) var(--r-md) 0 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
}

.featured-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: var(--android);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--android-ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.featured-card-body {
  padding: var(--space-3);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
}

.featured-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.featured-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rating-badge-v2 {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--warn);
}

.genre-badge-v2 {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

/* Category Grid Compact */
.category-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.category-item-compact {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.category-item-compact:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--android);
}

.category-compact-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--android), var(--ok));
  color: white;
  flex-shrink: 0;
}

[data-category="game"] .category-compact-icon,
[data-category="games"] .category-compact-icon {
  background: linear-gradient(135deg, #FF6B6B, #FF5252);
}

[data-category="social"] .category-compact-icon {
  background: linear-gradient(135deg, #4ECDC4, #44A8A0);
}

.category-compact-info {
  flex: 1;
  min-width: 0;
}

.category-compact-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.category-compact-count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.category-compact-arrow {
  color: var(--android);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.2s ease;
}

.category-item-compact:hover .category-compact-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* App List V2 */
.app-list-v2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 768px) {
  .app-list-v2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.app-list-item-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all 0.2s ease;
}

.app-list-item-v2:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--android);
}

.app-list-rank {
  width: 32px;
  height: 32px;
  background: var(--android);
  color: var(--android-ink);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  flex-shrink: 0;
}

.app-list-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.app-list-icon img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.app-icon-placeholder-sm {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--android), var(--ok));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--android-ink);
}

.app-list-info {
  flex: 1;
  min-width: 0;
}

.app-list-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-list-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.meta-divider {
  opacity: 0.5;
}

.meta-item.rating {
  color: var(--warn);
  font-weight: 700;
}

.app-list-action {
  color: var(--android);
  flex-shrink: 0;
}

/* Apps Grid V2 */
.apps-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
}

@media (max-width: 640px) {
  .apps-grid-v2 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
}

.app-card-v2 {
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-3);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.app-card-v2:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--android);
}

.app-card-icon-v2 {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-2) auto;
}

.app-card-icon-v2 img {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.new-badge-overlay {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  background: var(--ok);
  color: white;
  border-radius: var(--r-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.app-card-body-v2 {
  padding: var(--space-2) 0 0 0;
}

.app-card-title-v2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.app-card-meta-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
}

.rating-v2 {
  color: var(--warn);
  font-weight: 700;
}

.genre-v2 {
  color: var(--muted);
  font-size: 11px;
}

/* Top Charts Grid V2 */
.top-charts-grid-v2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 768px) {
  .top-charts-grid-v2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chart-item-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.chart-item-v2:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--android);
}

.chart-rank-v2 {
  width: 36px;
  height: 36px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: var(--text);
  flex-shrink: 0;
}

.chart-rank-v2.rank-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
}

.chart-rank-v2.rank-2 {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: white;
}

.chart-rank-v2.rank-3 {
  background: linear-gradient(135deg, #CD7F32, #B8860B);
  color: white;
}

.chart-icon-v2 {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.chart-icon-v2 img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.chart-info-v2 {
  flex: 1;
  min-width: 0;
}

.chart-title-v2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-meta-v2 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.installs-v2 {
  font-weight: 600;
}

.top-medal {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-medal.medal-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
}

.top-medal.medal-2 {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: white;
}

.top-medal.medal-3 {
  background: linear-gradient(135deg, #CD7F32, #B8860B);
  color: white;
}

/* Features Section V2 */
.features-section-v2 {
  background: linear-gradient(180deg, var(--panel), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-8) var(--space-5);
  margin-top: var(--space-5);
}

.features-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
}

.feature-box-v2 {
  text-align: center;
}

.feature-icon-v2 {
  margin-bottom: var(--space-3);
  filter: drop-shadow(0 4px 8px rgba(61, 220, 132, 0.2));
}

.feature-title-v2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 var(--space-2) 0;
  color: var(--text);
}

.feature-text-v2 {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* Empty States */
.empty-scroll-v2,
.empty-state-sm {
  text-align: center;
  padding: var(--space-4);
  color: var(--muted);
  font-size: 14px;
  width: 100%;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
  .section-header-v2 {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .section-link-v2 {
    align-self: stretch;
    justify-content: center;
    padding: var(--space-2);
    background: var(--surface-2);
    border-radius: var(--r-sm);
  }
  
  .category-grid-compact {
    grid-template-columns: 1fr;
  }
  
  .features-grid-v2 {
    grid-template-columns: 1fr;
  }
}
