/* =========================================================
   Index Atlas — ai-category-dash.css
   Dark UI + Accent #e3ff00
   ========================================================= */

:root{
  --bg: #070707;
  --panel: rgba(255,255,255,.04);
  --panel2: rgba(255,255,255,.06);
  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.14);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --muted2: rgba(255,255,255,.55);

  --accent: #e3ff00;

  --radius: 16px;
  --shadowSoft: 0 18px 55px rgba(0,0,0,.55);
  --shadowCard: 0 14px 35px rgba(0,0,0,.55);

  --container: 1100px;

  --topbarH: 64px;
  --stickyGap: 14px;

  --bottomNavH: 78px;
}

/* Base */
*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  text-rendering: optimizeLegibility;
}

a{ color: inherit; text-decoration: none; }

.container{
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}

.page{
  padding-bottom: calc(var(--bottomNavH) + 28px);
}

/* Accessibility */
.sr-only{
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0);
  white-space:nowrap; border:0;
}

.skip-link{
  position:absolute; left:-9999px; top:8px;
  background:#111; color:#fff;
  padding:10px 12px; border-radius:12px;
}
.skip-link:focus{ left:12px; z-index:9999; }

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index: 80;
  height: var(--topbarH);
  display:flex; align-items:center;
  background: rgba(0,0,0,.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

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

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

.toplinks{
  display:flex;
  gap:16px;
}

.toplink{
  color: var(--muted);
  font-weight: 700;
}
.toplink:hover{ color: var(--text); }

/* Hero */
.hero{
  padding: 28px 0 10px;
}
.h1{
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.02em;
}
.sub{
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
}

/* Sections */
.section{
  padding: 18px 0;
}

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

.h2{
  margin:0;
  font-size: 20px;
  font-weight: 900;
}

.hint{
  margin:0;
  color: var(--muted2);
  font-size: 13px;
}

/* Ad blocks */
.ad-block{
  margin: 14px 0 18px;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  padding: 12px;
}
.ad-label{
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .22em;
  color: rgba(255,255,255,.55);
  margin-bottom: 6px;
}
.ad-box{
  border-radius: 14px;
  background: rgba(0,0,0,.35);
  padding: 18px;
  color: rgba(255,255,255,.75);
}

/* =========================================================
   Sticky Filters (GLASS BLUR — works on all devices)
   ========================================================= */
.filters{
  position: sticky;
  top: calc(var(--topbarH) + var(--stickyGap));
  z-index: 70;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  background: rgba(12,12,12,.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 44px rgba(0,0,0,.55);
  padding: 14px;
  margin: 12px 0 14px;
}

/* ✅ FIX: prevent sticky filter from covering next section (Trending) */
.filters + .section{
  padding-top: 14px;
}

/* If you want slightly more space on mobile */
@media (max-width: 720px){
  .filters + .section{
    padding-top: 18px;
  }
}

.filters-row{
  display:grid;
  grid-template-columns: 1.2fr .6fr .55fr auto;
  gap: 10px;
  align-items:center;
}

.filters-meta{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.muted{ color: var(--muted2); }

/* Search */
.search{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.search-ico{
  opacity:.8;
  color: var(--accent);
  font-weight: 900;
}
.search input{
  width:100%;
  border:0;
  outline:0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

/* Selects */
select{
  width:100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline:0;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius: 14px;
  padding: 10px 14px;
  border: 1px solid transparent;
  font-weight: 900;
  cursor:pointer;
  user-select:none;
}

.btn-accent{
  background: var(--accent);
  color: #0b0b0b;
  box-shadow: 0 10px 26px rgba(227,255,0,.22);
}
.btn-accent:hover{ filter: brightness(1.03); }

.btn-ghost{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: var(--text);
}
.btn-ghost:hover{ border-color: rgba(227,255,0,.28); }

/* Mobile: stack filters properly (no overlap) */
@media (max-width: 720px){
  .filters-row{
    grid-template-columns: 1fr 1fr;
  }
  .filters-row .search{ grid-column: 1 / -1; }
  .filters-row #cat{ grid-column: 1 / -1; }
  .filters-row #sort{ grid-column: 1 / 2; }
  .filters-row #apply{ grid-column: 2 / 3; }
}

/* =========================================================
   Trending Categories (Horizontal scroll cards like Latest)
   ========================================================= */
.featured-grid{
  display:flex;
  gap: 14px;
  overflow-x:auto;
  padding-top: 6px;      /* ✅ FIX: prevents top edge from looking cut */
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;

  /* ✅ nicer snap spacing (like Latest cards) */
  scroll-padding-inline: 12px;
}
.featured-grid::-webkit-scrollbar{ height: 6px; }
.featured-grid::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}

.feature-card{
  flex: 0 0 auto;
  width: min(320px, 84%);
  scroll-snap-align: start;

  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadowCard);
  overflow:hidden;

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

.feature-card:hover{
  transform: translateY(-3px);
  border-color: rgba(227,255,0,.45);
  box-shadow: 0 0 0 3px rgba(227,255,0,.12), 0 20px 50px rgba(0,0,0,.65);
}

.feature-link{
  display:block;
  padding: 16px;
}

.f-title{
  margin:0 0 6px;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.2;
}
.count{
  font-size: 12.5px;
  color: var(--muted2);
  margin-bottom: 10px;
}
.f-desc{
  margin:0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}
.f-cta{
  margin-top: 12px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight: 950;
}
.feature-card:hover .f-cta{
  color: var(--accent);
  text-shadow: 0 0 18px rgba(227,255,0,.25);
}

/* ✅ When user jumps to this area, don't hide under sticky */
.section[aria-label="Trending categories"]{
  scroll-margin-top: calc(var(--topbarH) + var(--stickyGap) + 120px);
}

/* Desktop: can look like row without scrolling (optional) */
@media (min-width: 980px){
  .feature-card{ width: 260px; }
}

/* =========================================================
   Explore Categories Grid
   ========================================================= */
.cat-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 980px){
  .cat-grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px){
  .cat-grid{ grid-template-columns: repeat(2, 1fr); }
}

.cat-card{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadowCard);
  overflow:hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.cat-card:hover{
  transform: translateY(-3px);
  border-color: rgba(227,255,0,.35);
  box-shadow: 0 0 0 3px rgba(227,255,0,.10), 0 20px 50px rgba(0,0,0,.65);
}

.cat-link{
  display:flex;
  flex-direction:column;
  padding: 14px;
  height: 100%;
}

.cat-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.cat-ico{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(227,255,0,.10);
  border: 1px solid rgba(227,255,0,.22);
}

.cat-badge{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(227,255,0,.10);
  border: 1px solid rgba(227,255,0,.18);
  font-size: 12px;
  font-weight: 900;
}

.cat-name{
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 950;
}

.cat-desc{
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cat-foot{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color: var(--muted2);
  font-size: 12px;
}
.cat-cta{
  font-weight: 950;
}
.cat-card:hover .cat-cta{
  color: var(--accent);
  text-shadow: 0 0 18px rgba(227,255,0,.25);
}
/* =========================================================
   Popular Tools This Week
   ========================================================= */
.tool-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 720px){
  .tool-grid{ grid-template-columns: 1fr; }
}

.tool-card{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadowCard);
  overflow:hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tool-card:hover{
  transform: translateY(-2px);
  border-color: rgba(227,255,0,.28);
  box-shadow: 0 0 0 3px rgba(227,255,0,.08), 0 20px 50px rgba(0,0,0,.65);
}

.tool-link{ display:block; padding: 16px; }

.tool-title{
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 950;
}

.tool-desc{
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.tool-foot{
  margin-top: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color: var(--muted2);
  font-size: 12px;
}
.tool-card:hover .tool-foot span:last-child{
  color: var(--accent);
}

/* =========================================================
   Premium CTA + Footer
   ========================================================= */
.premium-cta{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(227,255,0,.12), rgba(255,255,255,.04));
  box-shadow: var(--shadowSoft);
  overflow:hidden;
}
.premium-inner{ padding: 18px; }
.cta-title{
  margin:0 0 6px;
  font-size: 20px;
  font-weight: 950;
}
.cta-text{ margin:0 0 12px; color: var(--muted); }
.cta-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.cta-price{ font-weight: 900; }
.cta-note{ margin-top: 8px; color: var(--muted2); font-size: 12px; }

.footer{
  padding: 26px 0 10px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 10px;
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.footer-brand{ font-weight: 950; }
.footer-sub{ color: var(--muted2); font-size: 12px; }
.footer-copy{ color: var(--muted2); }

/* =========================================================
   No-warning clamp (replaces -webkit-line-clamp)
   Use: class="clamp2"
   ========================================================= */
.clamp2{
  overflow: hidden;
  max-height: calc(1.55em * 2);
  position: relative;
}

/* For smaller text blocks */
.cat-desc.clamp2,
.f-desc.clamp2{
  max-height: calc(1.45em * 2);
}

/* Optional fade (looks premium) */
.clamp2::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 1.25em;
  pointer-events:none;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(7,7,7,.92));
}


/* BOTTOM NAV (CRITICAL) */
.bottom-nav{
  position: fixed;
  left:0; right:0; bottom:0;
  height: 76px;
  background: rgba(0,0,0,.82);
  border-top: 1px solid var(--stroke);
  backdrop-filter: blur(12px);
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 9999;
}
.nav-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
  transition: transform .12s ease, color .12s ease;
}
.nav-ico svg{width:22px; height:22px}
.nav-item:hover{transform: translateY(-1px); color: rgba(255,255,255,.82)}
.nav-item.active{
  color: var(--accent);
}
.nav-item.active .nav-ico{
  filter: drop-shadow(0 0 10px rgba(227,255,0,.22));
}
.nav-dot{
  width:6px; height:6px;
  border-radius:999px;
  background: transparent;
}
.nav-item.active .nav-dot{
  background: var(--accent);
  box-shadow: 0 0 14px rgba(227,255,0,.35);
}

/* Reveal animation */
.reveal{
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.show{
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce){
  .reveal{opacity:1; transform:none}
  .bg-glow{animation:none}
}
.sr-only{
  position:absolute;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0);
  white-space:nowrap; border:0;
}
.accent{color: var(--accent)}