/* =========================
   Dark App Store UI (Mobile-first)
   Full rewrite
   ========================= */

:root{
  --bg: #0b0f17;
  --bg2:#0f1726;
  --card:#101a2b;
  --card2:#0e1625;
  --muted:#95a3b8;
  --text:#eef2ff;
  --line: rgba(255,255,255,.08);
  --accent:#6ee7ff;
  --accent2:#a78bfa;
  --shadow: 0 18px 45px rgba(0,0,0,.45);
  --radius: 18px;

  /* mobile-friendly sizing */
  --padX: 12px;
  --padY: 14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;

  background:
    radial-gradient(900px 500px at 18% -5%, rgba(110,231,255,.16), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(167,139,250,.16), transparent 55%),
    linear-gradient(180deg, var(--bg), #070a11 70%);
}

a{ color: inherit; text-decoration:none; }
img{ display:block; }

/* =========================
   Layout
   ========================= */

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px var(--padX) 34px;
}

.site-main{
  padding: 16px 0 28px;
}

/* =========================
   Section
   ========================= */

.section{
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.032), rgba(255,255,255,.014));
  box-shadow: 0 14px 34px rgba(0,0,0,.42);
  backdrop-filter: blur(10px);
}

.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title.big-title{
  margin:0;
  font-size: 16px;
  letter-spacing:.2px;
  line-height: 1.2;
}

.section-count{
  font-size: 11px;
  color: var(--muted);
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(0,0,0,.18);
}

/* =========================
   Grid (mobile-first)
   ========================= */

.grid{
  display:grid;
  grid-template-columns: 1fr; /* mobile default */
  gap: 10px;
}

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

@media (min-width: 721px){
  .grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .section{ padding: 16px; }
  .section-title.big-title{ font-size: 18px; }
  .section-count{ font-size: 12px; padding: 6px 10px; }
}

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

/* =========================
   Card
   ========================= */

.card{
  position:relative;
  overflow:hidden;

  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px;
  min-height: 72px; /* tap-friendly */

  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  box-shadow: 0 10px 26px rgba(0,0,0,.28);

  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(600px 220px at 30% 10%, rgba(110,231,255,.16), transparent 55%),
    radial-gradient(600px 220px at 80% 90%, rgba(167,139,250,.16), transparent 55%);
  opacity:0;
  transition: opacity .18s ease;
}

/* desktop hover */
@media (hover: hover) and (pointer: fine){
  .card:hover{
    transform: translateY(-2px);
    border-color: rgba(110,231,255,.35);
    box-shadow: 0 20px 55px rgba(0,0,0,.55);
  }
  .card:hover::before{ opacity:1; }
}

/* mobile press feedback */
.card:active{
  transform: scale(.99);
  border-color: rgba(110,231,255,.28);
}

.icon{
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;

  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
}

.meta{
  min-width:0;
  position:relative;
  z-index:1;
}

.title{
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing:.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slug{
  margin-top: 3px;
  font-size: 12.5px;
  color: rgba(238,242,255,.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================
   Empty state
   ========================= */

.empty{
  color: rgba(238,242,255,.62);
  padding: 16px 12px;
  text-align:center;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(0,0,0,.18);
}

/* =========================
   Live Search bar (header block)
   ========================= */

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;

  padding: 12px 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.032), rgba(255,255,255,.014));
  box-shadow: 0 14px 34px rgba(0,0,0,.42);
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 140px;
}

.brand img{
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand .name{
  font-weight: 850;
  letter-spacing:.2px;
}

.search{
  flex: 1;
  display:flex;
  align-items:center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
}

.search svg{
  width: 18px;
  height: 18px;
  opacity: .9;
  flex: 0 0 auto;
}

.search input{
  width:100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.search input::placeholder{ color: rgba(238,242,255,.55); }

.kbd{
  font-size: 12px;
  color: rgba(238,242,255,.62);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.search-status{
  font-size: 12px;
  color: rgba(238,242,255,.62);
  margin-left: 10px;
  white-space: nowrap;
  opacity: .9;
}

.hidden{ display:none !important; }

/* topbar responsive */
@media (max-width: 520px){
  .kbd{ display:none; }
  .brand{ min-width: 120px; }
}

/* =========================
   Sticky Header + Nav + Server-side search
   ========================= */

.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(11,15,23,.92), rgba(11,15,23,.72));
  backdrop-filter: blur(12px);
}

.site-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px var(--padX);
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header .brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 160px;
}

.brand-logo{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  object-fit: cover;
}

.brand-text{ line-height: 1.1; }
.brand-title{
  font-weight: 900;
  letter-spacing: .3px;
  color: #eef2ff;
}
.brand-sub{
  font-size: 12px;
  color: rgba(238,242,255,.62);
  margin-top: 2px;
}

/* nav */
.nav{
  display: none; /* hide on mobile by default */
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.nav a{
  padding: 8px 10px;
  border-radius: 999px;
  color: rgba(238,242,255,.85);
  border: 1px solid transparent;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}

.nav a:hover{
  border-color: rgba(110,231,255,.25);
  background: rgba(110,231,255,.08);
  transform: translateY(-1px);
}

@media (min-width: 720px){
  .nav{ display:flex; }
}

/* header search (server-side) */
.top-search{
  margin-left: auto;
  width: min(520px, 52vw);
}

.top-search input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  color: #eef2ff;
  outline: none;
  font-size: 14px;
}

.top-search input::placeholder{
  color: rgba(238,242,255,.55);
}

.top-search input:focus{
  border-color: rgba(110,231,255,.40);
  box-shadow: 0 0 0 4px rgba(110,231,255,.10);
}

/* make header search full width on small screens */
@media (max-width: 720px){
  .site-wrap{
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .site-header .brand{ min-width: 160px; }
  .top-search{
    width: 100%;
    margin-left: 0;
  }
}

/* =========================
   Footer
   ========================= */

.site-footer{
  margin-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(7,10,17,.0), rgba(7,10,17,.65));
}

.footer-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px var(--padX) 20px;

  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}

.footer-title{
  font-weight: 900;
  color: #eef2ff;
  letter-spacing:.2px;
}

.footer-sub{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(238,242,255,.60);
}

.footer-links{
  display:flex;
  flex-wrap: wrap;
  align-items:center;
  justify-content:flex-start;
  gap: 8px;
}

.footer-links a{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(238,242,255,.86);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.footer-links a:hover{
  transform: translateY(-1px);
  border-color: rgba(167,139,250,.35);
  background: rgba(167,139,250,.10);
}

@media (max-width: 640px){
  .footer-wrap{
    flex-direction: column;
    align-items:flex-start;
  }
}


/* =========================
   Clean Minimal Footer
   ========================= */

.site-footer{
  margin-top: 22px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(7,10,17,0), rgba(7,10,17,.75));
}

.footer-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px 22px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

/* left */
.footer-title{
  font-weight: 900;
  letter-spacing: .4px;
  font-size: 15px;
  color: #eef2ff;
}

.footer-copy{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(238,242,255,.55);
}

/* right buttons */
.footer-actions{
  display:flex;
  gap: 10px;
}

/* base button */
.footer-btn{
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(238,242,255,.9);
  transition: all .15s ease;
}

/* hover desktop */
@media (hover:hover){
  .footer-btn:hover{
    transform: translateY(-2px);
  }
}

/* Telegram accent */
.footer-btn.telegram{
  border-color: rgba(110,231,255,.35);
  background: rgba(110,231,255,.08);
}

.footer-btn.telegram:hover{
  background: rgba(110,231,255,.16);
  box-shadow: 0 6px 20px rgba(110,231,255,.25);
}

/* Admin subtle purple */
.footer-btn.admin{
  border-color: rgba(167,139,250,.35);
  background: rgba(167,139,250,.08);
}

.footer-btn.admin:hover{
  background: rgba(167,139,250,.16);
  box-shadow: 0 6px 20px rgba(167,139,250,.25);
}

/* mobile stack */
@media (max-width: 640px){
  .footer-wrap{
    flex-direction: column;
    align-items:flex-start;
  }

  .footer-actions{
    width: 100%;
  }

  .footer-btn{
    flex:1;
    text-align:center;
  }
}
