/* AgentStack — Clean, professional AI tools directory */

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

:root {
  --blue: #2563EB;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --max-w: 1200px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout helpers ─────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ── Nav ───────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo span { color: var(--blue); }
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
  transition: color .15s;
}
.nav-links a:hover { color: var(--gray-900); text-decoration: none; }
.btn-nav {
  background: var(--blue);
  color: var(--white) !important;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background .15s;
}
.btn-nav:hover { background: var(--blue-dark); text-decoration: none; }

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.hero-eyebrow {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: .02em;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  color: var(--gray-900);
  margin-bottom: 16px;
  letter-spacing: -.02em;
}
.hero-sub {
  font-size: 18px;
  color: var(--gray-500);
  max-width: 560px;
  margin: 0 auto 40px;
}
.hero-search {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}
.hero-search input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.hero-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.hero-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  pointer-events: none;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
}
.hero-stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ── Categories ─────────────────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  cursor: pointer;
}
.category-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.category-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--blue);
}
.category-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.category-count {
  font-size: 13px;
  color: var(--gray-500);
}
.category-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Section headers ───────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: clamp(28px, 4vw, 36px);
  color: var(--gray-900);
  margin-bottom: 12px;
  letter-spacing: -.01em;
}
.section-header p {
  font-size: 16px;
  color: var(--gray-500);
  max-width: 480px;
  margin: 0 auto;
}

/* ── Featured tools ────────────────────────────────────── */
.featured-section { background: var(--gray-50); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .2s, transform .2s;
}
.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.tool-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--blue);
  flex-shrink: 0;
  overflow: hidden;
}
.tool-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tool-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-verified { background: #d1fae5; color: #065f46; }
.badge-free { background: #ecfdf5; color: #065f46; }
.badge-freemium { background: #eff6ff; color: #1d4ed8; }
.badge-paid { background: #fef3c7; color: #92400e; }
.badge-featured { background: var(--blue); color: white; }
.tool-name { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.tool-name:hover { color: var(--blue); }
.tool-desc { font-size: 14px; color: var(--gray-500); line-height: 1.5; flex: 1; }
.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
}
.tool-price { font-size: 14px; font-weight: 600; color: var(--gray-700); }
.tool-category-label {
  font-size: 12px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 3px 8px;
  border-radius: 100px;
}
.tool-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  margin-top: auto;
}
.tool-link:hover { text-decoration: underline; }

/* ── CTA Banner ─────────────────────────────────────────── */
.cta-section { background: var(--blue); color: white; }
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-text h2 {
  font-size: 28px;
  color: white;
  margin-bottom: 8px;
}
.cta-text p { font-size: 16px; opacity: .85; }
.btn-white {
  display: inline-block;
  background: white;
  color: var(--blue);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius-lg);
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
}
.btn-white:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--blue-dark);
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 48px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand { font-size: 18px; font-weight: 800; color: var(--white); margin-bottom: 12px; }
.footer-brand span { color: var(--blue); }
.footer-tagline { font-size: 14px; line-height: 1.5; color: var(--gray-500); }
.footer-col-title { font-size: 13px; font-weight: 600; color: var(--gray-300); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: var(--gray-500); transition: color .15s; }
.footer-links a:hover { color: var(--white); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid #2d2d2d;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--gray-600);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { color: var(--gray-500); }
.footer-bottom a:hover { color: var(--white); text-decoration: none; }

/* ── Submit Modal ───────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { font-size: 22px; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--gray-700); }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  outline: none;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-error { color: #dc2626; font-size: 13px; margin-top: 4px; display: none; }
.form-error.show { display: block; }
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--blue);
  color: white;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { background: var(--gray-300); cursor: not-allowed; }
.btn-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 1;
}
.btn-close:hover { color: var(--gray-700); }
.success-msg {
  text-align: center;
  padding: 20px 0;
}
.success-msg svg { margin-bottom: 16px; }
.success-msg h3 { font-size: 20px; margin-bottom: 8px; }
.success-msg p { color: var(--gray-500); font-size: 14px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .categories-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 56px 0; }
  .cta-inner { flex-direction: column; text-align: center; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── SVG Icons (inline) ─────────────────────────────────── */
.icon { display: inline-block; width: 24px; height: 24px; }
.icon-sm { display: inline-block; width: 18px; height: 18px; }