/* =========================================================
   ToolNest — AI Tools Directory
   Design: light "card catalog" aesthetic, warm coral accent
   ========================================================= */

:root {
  --bg: #FFFDFB;
  --bg-alt: #FFF6F2;
  --surface: #FFFFFF;
  --ink: #241C1A;
  --ink-soft: #6B5F5A;
  --line: #EDE2DC;
  --coral: #FF5A36;
  --coral-dark: #E1481F;
  --coral-tint: #FFE7DD;
  --amber: #FFB74A;
  --green: #2F9E5B;
  --green-tint: #E6F6EC;
  --blue: #3E7CB1;
  --blue-tint: #E8F1F9;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(36, 28, 26, 0.06);
  --shadow-lift: 0 10px 30px rgba(225, 72, 31, 0.14);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 251, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  transform: rotate(-6deg);
  box-shadow: var(--shadow);
}
.header-actions a {
  font-weight: 600;
  font-size: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--coral-dark); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--coral); color: var(--coral-dark); }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 300px;
  background: radial-gradient(ellipse at center, var(--coral-tint) 0%, transparent 70%);
  z-index: 0;
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--coral-dark);
  background: var(--coral-tint);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.08;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: normal;
  color: var(--coral);
  position: relative;
}
.hero p.subtitle {
  color: var(--ink-soft);
  font-size: 18px;
  max-width: 560px;
  margin: 0 auto 32px;
}

/* Search */
.search-box {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 18px 24px 18px 52px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--surface);
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-box input:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: var(--shadow-lift);
}
.search-box .icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: 18px;
}

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--coral-dark);
}
.stat-label {
  font-size: 13px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ---------- Category chips ---------- */
.category-rail {
  padding: 28px 24px 8px;
}
.chip-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--coral); color: var(--coral-dark); }
.chip.active {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}
.chip .count {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .75;
}

/* Pricing filter pills */
.filter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 6px;
  flex-wrap: wrap;
}
.pill {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Featured section ---------- */
.section {
  padding: 48px 24px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0;
}
.section-head .tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--coral-dark);
  background: var(--coral-tint);
  padding: 4px 10px;
  border-radius: 6px;
  margin-right: 10px;
}
.section-sub { color: var(--ink-soft); font-size: 14px; }

/* ---------- Tool card (card-catalog signature) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tool-card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: var(--shadow-lift);
  border-color: #FFD2C0;
}
.tool-card.featured {
  border-style: dashed;
  border-color: var(--coral);
  background: linear-gradient(180deg, var(--coral-tint) 0%, var(--surface) 90px);
}
.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.tool-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  white-space: nowrap;
}
.badge-free { background: var(--green-tint); color: var(--green); }
.badge-freemium { background: var(--blue-tint); color: var(--blue); }
.badge-paid { background: #FBEAEA; color: #C24545; }

.tool-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.tool-tagline {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
  flex-grow: 1;
}
.tool-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.tool-cat-tag {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 600;
}
.visit-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--coral-dark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.visit-link:hover { text-decoration: underline; }

.free-tier-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  margin-top: -6px;
}

/* ---------- Tool detail page ---------- */
.tool-detail-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}
.tool-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tool-detail-body h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 32px 0 12px;
}
.tool-detail-body p {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-pill {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
  grid-column: 1 / -1;
}
.empty-state .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- Submit CTA ---------- */
.cta-band {
  margin: 40px 24px;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  background: var(--ink);
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  background: var(--coral);
  opacity: .25;
  border-radius: 50%;
  filter: blur(10px);
}
.cta-band h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 10px;
  position: relative;
}
.cta-band p {
  color: #D8CFCB;
  margin: 0 0 24px;
  position: relative;
}
.cta-band .btn-primary { position: relative; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}
.site-footer a { color: var(--coral-dark); font-weight: 600; }

/* ---------- Forms (submit / admin) ---------- */
.form-card {
  max-width: 560px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.form-card h1 { font-family: var(--font-display); font-size: 24px; margin-top: 0; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--coral);
}
.field textarea { resize: vertical; min-height: 90px; }
.alert {
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 18px;
}
.alert-success { background: var(--green-tint); color: var(--green); }
.alert-error { background: #FBEAEA; color: #C24545; }

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.admin-table th {
  background: var(--bg-alt);
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.admin-actions { display: flex; gap: 8px; }
.admin-actions .btn { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: #FBEAEA; color: #C24545; border: 1px solid #F3D2D2; }
.btn-danger:hover { background: #F3D2D2; }

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.admin-wrap { padding: 28px 24px; max-width: 1100px; margin: 0 auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.tab {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--ink-soft);
  cursor: pointer;
}
.tab.active { background: var(--coral); color: #fff; }

@media (max-width: 640px) {
  .header-actions { display: flex; gap: 8px; }
  .stats-bar { gap: 28px; }
  .cta-band { padding: 32px 20px; }
}
