/* ================================================================
   AI Tools Hub — Public CSS Design System
   ================================================================ */

/* ─── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────────── */
:root {
  --accent:        #7c3aed;
  --accent-light:  #9f5cf7;
  --accent2:       #06b6d4;
  --accent2-light: #22d3ee;
  --pink:          #ec4899;
  --amber:         #f59e0b;
  --green:         #10b981;
  --red:           #ef4444;
  --blue:          #3b82f6;

  --bg:            #070711;
  --bg-alt:        #0d0d1c;
  --surface:       #111126;
  --surface2:      #181832;
  --surface3:      #1e1e3a;
  --border:        rgba(255,255,255,0.07);
  --border2:       rgba(255,255,255,0.12);

  --text:          #f1f5f9;
  --text-2:        #cbd5e1;
  --muted:         #64748b;
  --muted2:        #94a3b8;

  --font:          'Inter', -apple-system, sans-serif;
  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  --transition:    all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow:        0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.4);
  --shadow-accent: 0 8px 30px rgba(124,58,237,0.35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Noise Texture Overlay ─────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ─── Layout ─────────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ─── Navbar ─────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
  background: rgba(7,7,17,0.85);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  height: 68px;
  display: flex;
  align-items: center;
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
}

.nav-logo span {
  background: linear-gradient(135deg, var(--accent-light), var(--accent2-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-search {
  flex: 1;
  max-width: 380px;
}

.nav-search-inner {
  position: relative;
}

.nav-search-inner i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted2);
  font-size: 16px;
  pointer-events: none;
}

.nav-search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}

.nav-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
  background: var(--surface3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted2);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-link.active {
  color: var(--accent-light);
  background: rgba(124,58,237,0.1);
}

.btn-nav {
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(124,58,237,0.3);
  white-space: nowrap;
}

.btn-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.45);
}

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 80px 24px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.25) 0%, transparent 70%);
  top: -150px; left: -100px;
}

.hero-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(6,182,212,0.18) 0%, transparent 70%);
  bottom: -100px; right: -80px;
}

.hero-orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(236,72,153,0.12) 0%, transparent 70%);
  top: 40%; left: 60%;
}

/* Grid lines */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 0%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: 28px;
  animation: fadeSlideUp 0.6s ease both;
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--accent-light);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  animation: fadeSlideUp 0.7s 0.1s ease both;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent2-light) 50%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--muted2);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 48px;
  font-weight: 400;
  animation: fadeSlideUp 0.7s 0.2s ease both;
}

.hero-search-box {
  max-width: 580px;
  margin: 0 auto 40px;
  animation: fadeSlideUp 0.7s 0.3s ease both;
}

.hero-search-wrap {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(124,58,237,0.1), var(--shadow-lg);
  transition: var(--transition);
}

.hero-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15), var(--shadow-lg);
}

.hero-search-wrap input {
  flex: 1;
  padding: 18px 20px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  outline: none;
}

.hero-search-wrap input::placeholder { color: var(--muted); }

.hero-search-btn {
  padding: 12px 24px;
  margin: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  flex-shrink: 0;
}

.hero-search-btn:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-accent);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  animation: fadeSlideUp 0.7s 0.4s ease both;
}

.hero-tag {
  padding: 6px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px;
  color: var(--muted2);
  transition: var(--transition);
}

.hero-tag:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(124,58,237,0.08);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 64px;
  animation: fadeSlideUp 0.7s 0.5s ease both;
}

.hero-stat-item { text-align: center; }

.hero-stat-number {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--muted2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Section ────────────────────────────────────────────────────── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

.section-header {
  margin-bottom: 40px;
}

.section-header .label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-header p {
  color: var(--muted2);
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.65;
}

/* ─── Categories Strip ───────────────────────────────────────────── */
.categories-strip {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.cat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
}

.cat-pill:hover {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.cat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.cat-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.3;
}

.cat-count {
  font-size: 11px;
  color: var(--muted);
}

/* ─── Tool Cards ─────────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(124,58,237,0.05), rgba(6,182,212,0.03));
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.tool-card:hover {
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35), 0 0 0 1px rgba(124,58,237,0.1);
}

.tool-card:hover::before { opacity: 1; }

.tool-card-header {
  padding: 20px 20px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.tool-logo {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}

.tool-logo img { width: 100%; height: 100%; object-fit: contain; }

.tool-card-meta { flex: 1; min-width: 0; }

.tool-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.tool-category {
  font-size: 11px;
  color: var(--muted2);
  font-weight: 500;
}

.badge-pricing {
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-free     { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-freemium { background: rgba(6,182,212,0.15);  color: var(--accent2); }
.badge-paid     { background: rgba(124,58,237,0.15); color: var(--accent-light); }
.badge-contact  { background: rgba(245,158,11,0.15); color: #fcd34d; }

.tool-card-body {
  padding: 16px 20px;
  flex: 1;
}

.tool-tagline {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.tool-stat { display: flex; align-items: center; gap: 5px; }

.btn-visit {
  padding: 7px 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-visit:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-accent);
}

.badge-featured {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 10px;
  background: linear-gradient(135deg, var(--amber), #d97706);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(124,58,237,0.45);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text-2);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(124,58,237,0.08);
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--surface3);
  color: var(--text);
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .brand-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-top: 14px;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
  margin-bottom: 16px;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  font-size: 14px;
  color: var(--muted);
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: var(--accent-light);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 13px;
  color: var(--muted);
}

/* ─── Utilities ──────────────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-8 { margin-bottom: 32px; }
.text-muted { color: var(--muted2); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none; }

/* ─── Pagination ─────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted2);
}

.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.page-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-accent);
}

/* ─── Breadcrumb ─────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.breadcrumb a { color: var(--muted); transition: var(--transition); }
.breadcrumb a:hover { color: var(--accent-light); }
.breadcrumb .sep { color: var(--muted); opacity: 0.4; }

/* ─── Tool Single ────────────────────────────────────────────────── */
.tool-hero {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--surface) 0%, var(--bg) 100%);
}

.tool-hero-inner {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.tool-logo-lg {
  width: 88px; height: 88px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}

.tool-hero-info { flex: 1; }

.tool-hero-info h1 {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.tool-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tool-hero-tagline {
  font-size: 17px;
  color: var(--muted2);
  line-height: 1.65;
  margin-bottom: 24px;
}

/* ─── Filter Bar ─────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-chip {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted2);
  transition: var(--transition);
  cursor: pointer;
}

.filter-chip:hover, .filter-chip.active {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(124,58,237,0.08);
}

/* ─── Loading / Skeleton ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-shine {
  to { background-position: -200% 0; }
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero-stats { gap: 24px; }
  .nav-search { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .tool-hero-inner { flex-direction: column; }
  .tools-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-stats { flex-direction: column; gap: 20px; }
  .hero-title { font-size: 32px; }
}
