/* AINext Tools Directory */
.ainext-dir {
  --ad-bg: #f5f6fb;
  --ad-surface: #ffffff;
  --ad-text: #14161f;
  --ad-muted: #667085;
  --ad-border: #e5e7f0;
  --ad-accent: #5b5bf0;
  --ad-accent-2: #8b5cf6;
  --ad-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
  --ad-shadow-hover: 0 2px 4px rgba(16, 24, 40, .06), 0 16px 36px rgba(60, 60, 200, .16);
  background: var(--ad-bg);
  color: var(--ad-text);
  line-height: 1.5;
}
html.ainext-dark .ainext-dir,
body[data-theme="dark"] .ainext-dir,
html[data-theme="dark"] .ainext-dir,
body.dark-mode .ainext-dir {
  --ad-bg: #0f1117;
  --ad-surface: #181b25;
  --ad-text: #eef0f6;
  --ad-muted: #98a2b3;
  --ad-border: #2a2e3b;
  --ad-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --ad-shadow-hover: 0 16px 36px rgba(0, 0, 0, .5);
}
.ainext-dir *, .ainext-dir *::before, .ainext-dir *::after { box-sizing: border-box; }
.ainext-dir a { text-decoration: none; }
.ainext-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.ainext-hero {
  position: relative;
  padding: 76px 0 84px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(60% 80% at 15% 0%, rgba(139, 92, 246, .55), transparent 60%),
    radial-gradient(50% 70% at 90% 100%, rgba(56, 189, 248, .35), transparent 60%),
    linear-gradient(135deg, #17104f 0%, #3a2aa8 55%, #6d3df0 100%);
}
.ainext-dir .ainext-hero__title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
}
.ainext-hero__lead { margin: 0 0 8px; font-size: clamp(1.1rem, 2.4vw, 1.5rem); font-weight: 600; color: #fff; }
.ainext-hero__sub { max-width: 620px; margin: 0 auto; color: rgba(255, 255, 255, .78); font-size: 1.02rem; }
.ainext-hero__stats { margin: 22px 0 0; font-size: .9rem; color: rgba(255, 255, 255, .7); }

.ainext-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  margin: 32px auto 0;
  padding: 7px 7px 7px 20px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 18px 50px rgba(10, 6, 60, .35);
}
.ainext-search__icon { flex: none; color: #7a7f94; }
.ainext-dir .ainext-search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 12px 6px;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: #14161f;
  font-size: 1.05rem;
  -webkit-appearance: none;
  appearance: none;
}
.ainext-dir .ainext-search input[type="search"]::placeholder { color: #8a8fa3; }
.ainext-dir .ainext-search button {
  flex: none;
  margin: 0;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2));
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.ainext-dir .ainext-search button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(91, 91, 240, .45); }

/* Sections */
.ainext-section { padding: 36px 0 8px; }
.ainext-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ainext-dir .ainext-section__title { margin: 0 0 14px; font-size: 1.35rem; font-weight: 700; color: var(--ad-text); }
.ainext-section__head .ainext-section__title { margin: 0; }
.ainext-viewall { font-weight: 600; font-size: .95rem; color: var(--ad-accent); }
.ainext-viewall:hover { text-decoration: underline; }
.ainext-count { color: var(--ad-muted); font-size: .92rem; white-space: nowrap; }

/* Category chips and pricing pills */
.ainext-chips, .ainext-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.ainext-pills { margin-bottom: 22px; }
.ainext-chip, .ainext-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--ad-border);
  border-radius: 999px;
  background: var(--ad-surface);
  color: var(--ad-text);
  font-size: .9rem;
  font-weight: 500;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.ainext-chip:hover, .ainext-pill:hover { border-color: var(--ad-accent); color: var(--ad-accent); transform: translateY(-1px); }
.ainext-chip.is-active, .ainext-pill.is-active {
  background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2));
  border-color: transparent;
  color: #fff;
}

/* Grid and cards */
.ainext-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.ainext-grid--featured { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ainext-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--ad-surface);
  border: 1px solid var(--ad-border);
  border-radius: 18px;
  box-shadow: var(--ad-shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.ainext-card:hover { transform: translateY(-4px); box-shadow: var(--ad-shadow-hover); border-color: rgba(91, 91, 240, .45); }
.ainext-card.is-featured { border-color: rgba(139, 92, 246, .35); }
.ainext-card__link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.ainext-card__top { display: flex; align-items: center; gap: 14px; }
.ainext-card__logo {
  flex: none;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: hsl(var(--h, 250) 70% 94%);
  color: hsl(var(--h, 250) 60% 38%);
  font-size: 1.4rem;
  font-weight: 800;
}
.ainext-card__logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ainext-card__heading { min-width: 0; }
.ainext-dir .ainext-card__title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ad-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ainext-card__cat { display: block; margin-top: 2px; font-size: .82rem; color: var(--ad-muted); }
.ainext-card__desc { margin: 0; font-size: .92rem; color: var(--ad-muted); flex: 1; }
.ainext-card__flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ainext-card__flags li {
  margin: 0;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(91, 91, 240, .09);
  color: var(--ad-accent);
  font-size: .75rem;
  font-weight: 600;
}
.ainext-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--ad-border); }
.ainext-card__price { font-size: .85rem; font-weight: 600; color: var(--ad-muted); }

.ainext-badge { padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eef0f6; color: #475467; }
.ainext-badge--free { background: #dcfce7; color: #15803d; }
.ainext-badge--freemium { background: #dbeafe; color: #1d4ed8; }
.ainext-badge--paid { background: #fef3c7; color: #b45309; }
.ainext-badge--free-trial { background: #f3e8ff; color: #7e22ce; }

/* Pagination */
.ainext-pagination { margin: 34px 0 10px; }
.ainext-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ainext-pagination li { margin: 0; }
.ainext-pagination .page-numbers {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--ad-border);
  border-radius: 12px;
  background: var(--ad-surface);
  color: var(--ad-text);
  font-weight: 600;
  transition: border-color .15s, color .15s;
}
.ainext-pagination a.page-numbers:hover { border-color: var(--ad-accent); color: var(--ad-accent); }
.ainext-pagination .page-numbers.current { background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2)); border-color: transparent; color: #fff; }

/* Empty state */
.ainext-empty { padding: 56px 20px; text-align: center; background: var(--ad-surface); border: 1px dashed var(--ad-border); border-radius: 18px; }
.ainext-empty__icon { font-size: 2.2rem; }
.ainext-dir .ainext-empty h3 { margin: 10px 0 6px; font-size: 1.2rem; color: var(--ad-text); }
.ainext-empty p { margin: 0 0 18px; color: var(--ad-muted); }
.ainext-reset { display: inline-block; padding: 10px 20px; border-radius: 999px; background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2)); color: #fff; font-weight: 600; }

/* Live loading */
.ainext-dynamic { padding-bottom: 72px; transition: opacity .15s; }
.ainext-dynamic.is-loading { opacity: .45; pointer-events: none; }

/* Responsive */
@media (max-width: 1100px) {
  .ainext-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .ainext-grid, .ainext-grid--featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ainext-container { padding: 0 16px; }
  .ainext-hero { padding: 52px 0 60px; }
  .ainext-search { padding-left: 14px; }
  .ainext-dir .ainext-search button { padding: 12px 18px; }
  .ainext-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none; }
  .ainext-chips::-webkit-scrollbar { display: none; }
  .ainext-chip { flex: none; }
}
@media (max-width: 520px) {
  .ainext-grid, .ainext-grid--featured { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ainext-dir * { transition: none !important; }
}

/* ===== Single AI Tool ===== */
.ainext-single { padding-bottom: 72px; }
.ainext-hero--tool { text-align: left; padding: 30px 0 54px; }
.ainext-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; padding: 0; list-style: none; font-size: .85rem; color: rgba(255, 255, 255, .7); }
.ainext-crumbs li { margin: 0; }
.ainext-crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.ainext-crumbs a { color: rgba(255, 255, 255, .88); }
.ainext-crumbs a:hover { color: #fff; text-decoration: underline; }

.ainext-tool-head { display: flex; align-items: center; gap: 24px; }
.ainext-tool-head .ainext-card__logo { width: 92px; height: 92px; border-radius: 22px; font-size: 2.4rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.ainext-dir .ainext-tool-title { margin: 0 0 10px; font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 800; line-height: 1.15; color: #fff; }
.ainext-tool-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ainext-tool-cat { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font-size: .82rem; font-weight: 600; }
.ainext-tool-lead { max-width: 760px; margin: 22px 0 0; font-size: 1.08rem; color: rgba(255, 255, 255, .85); }
.ainext-tool-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.ainext-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 13px 26px; border-radius: 999px; font-size: .97rem; font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s; }
.ainext-btn:hover { transform: translateY(-1px); }
.ainext-btn--primary { background: #fff; color: #3a2aa8; box-shadow: 0 8px 24px rgba(10, 6, 60, .3); }
.ainext-btn--ghost { background: rgba(255, 255, 255, .14); color: #fff; }
.ainext-btn--ghost:hover { background: rgba(255, 255, 255, .24); }
.ainext-btn--block { display: flex; width: 100%; margin-top: 20px; }
.ainext-facts-card .ainext-btn--primary { background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2)); color: #fff; box-shadow: none; }
.ainext-facts-card .ainext-btn--primary:hover { box-shadow: 0 8px 20px rgba(91, 91, 240, .4); }

.ainext-tool-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; padding: 36px 0 8px; }
.ainext-panel { padding: 30px; background: var(--ad-surface); border: 1px solid var(--ad-border); border-radius: 18px; box-shadow: var(--ad-shadow); }
.ainext-facts-card { position: sticky; top: 96px; padding: 24px; }
.ainext-facts-card .ainext-section__title { font-size: 1.1rem; margin-bottom: 8px; }

.ainext-facts { margin: 0; }
.ainext-facts__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--ad-border); }
.ainext-facts__row:last-child { border-bottom: 0; }
.ainext-facts dt { margin: 0; color: var(--ad-muted); font-size: .9rem; }
.ainext-facts dd { margin: 0; text-align: right; font-weight: 600; font-size: .92rem; color: var(--ad-text); }
.ainext-yes { color: #15803d; }
.ainext-no { color: #b42318; }
.ainext-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ainext-tag { padding: 3px 10px; border-radius: 8px; background: rgba(91, 91, 240, .09); color: var(--ad-accent); font-size: .8rem; font-weight: 600; }
.ainext-tag:hover { background: rgba(91, 91, 240, .18); }

.ainext-prose { font-size: 1.04rem; line-height: 1.8; color: var(--ad-text); }
.ainext-prose > *:first-child { margin-top: 0; }
.ainext-prose h2, .ainext-prose h3, .ainext-prose h4 { margin: 1.8em 0 .6em; line-height: 1.3; color: var(--ad-text); }
.ainext-prose p, .ainext-prose ul, .ainext-prose ol { margin: 0 0 1.2em; }
.ainext-prose a { color: var(--ad-accent); text-decoration: underline; }
.ainext-prose img { max-width: 100%; height: auto; border-radius: 12px; }
.ainext-prose ul, .ainext-prose ol { padding-left: 1.4em; }

.ainext-related { padding-top: 44px; }

@media (max-width: 900px) {
  .ainext-tool-body { grid-template-columns: 1fr; }
  .ainext-facts-card { position: static; }
}
@media (max-width: 640px) {
  .ainext-tool-head { align-items: flex-start; gap: 16px; }
  .ainext-tool-head .ainext-card__logo { width: 64px; height: 64px; border-radius: 16px; font-size: 1.7rem; }
  .ainext-panel { padding: 22px; }
}

/* ===== Tool Category / taxonomy pages ===== */
.ainext-term .ainext-hero { padding: 40px 0 70px; }
.ainext-crumbs--center { justify-content: center; margin-bottom: 22px; }
.ainext-eyebrow { display: inline-block; margin-bottom: 14px; padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ainext-backlink { margin: 34px 0 0; text-align: center; }
.ainext-backlink a { color: var(--ad-accent); font-weight: 600; }
.ainext-backlink a:hover { text-decoration: underline; }
