/* ============================================================
   AIEXPO.APP — Global Stylesheet
   Futuristic Dark-first Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* Colors - Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbff;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Brand */
  --brand: #6366f1;
  --brand-hover: #4f46e5;
  --brand-light: #eef2ff;
  --brand-glow: rgba(99, 102, 241, 0.3);
  --accent: #ec4899;
  --accent-hover: #db2777;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  --gradient-brand: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,1) 0%, rgba(248,250,252,1) 100%);
  --gradient-mesh: radial-gradient(at 40% 20%, hsla(228,100%,74%,0.15) 0, transparent 50%),
                   radial-gradient(at 80% 0%, hsla(280,100%,76%,0.1) 0, transparent 50%),
                   radial-gradient(at 0% 50%, hsla(355,100%,93%,0.1) 0, transparent 50%);
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-brand: 0 8px 30px rgba(99,102,241,0.3);
  
  /* Spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;
  
  /* Radius */
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --radius-xl: 24px; --radius-2xl: 32px; --radius-full: 9999px;
  
  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Header */
  --header-h: 72px;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-tertiary: #1a1a24;
  --bg-card: #14141e;
  --bg-card-hover: #1a1a28;
  --border: #1e1e2e;
  --border-subtle: #16161f;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-inverse: #0f172a;
  
  --brand-light: rgba(99,102,241,0.15);
  --brand-glow: rgba(99, 102, 241, 0.5);
  --gradient-card: linear-gradient(145deg, #14141e 0%, #1a1a28 100%);
  --gradient-mesh: radial-gradient(at 40% 20%, hsla(228,100%,74%,0.08) 0, transparent 50%),
                   radial-gradient(at 80% 0%, hsla(280,100%,76%,0.06) 0, transparent 50%),
                   radial-gradient(at 0% 50%, hsla(355,100%,93%,0.04) 0, transparent 50%);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.6), 0 4px 10px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.7), 0 8px 16px rgba(0,0,0,0.4);
  --shadow-brand: 0 8px 30px rgba(99,102,241,0.5);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.font-display { font-family: var(--font-display); }

h1, h2, h3, h4, h5 { 
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section { padding: var(--space-20) 0; }
.section-sm { padding: var(--space-12) 0; }
.section-lg { padding: var(--space-24) 0; }

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  background: var(--brand-light);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
#siteHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1000;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

#siteHeader .container {
  height: 100%;
}

#siteHeader.scrolled {
  background: rgba(var(--bg-primary-rgb, 255,255,255), 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] #siteHeader.scrolled {
  background: rgba(10, 10, 15, 0.85);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  background: transparent;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nav-logo-icon::before {
  content: none;
}

.nav-logo-mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.nav-logo:hover .nav-logo-icon {
  transform: translateY(-1px) rotate(-6deg) scale(1.04);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.45);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.nav-actions .btn {
  height: 38px;
}

/* Dark Mode Toggle */
#darkModeToggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  cursor: pointer;
}

#darkModeToggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 35px rgba(99,102,241,0.5);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand);
  color: var(--brand);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}

.btn-outline:hover {
  background: var(--brand-light);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   TOOL CARDS
   ============================================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

.tools-grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-slow);
  position: relative;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient-brand);
  opacity: 0;
  transition: var(--transition);
  z-index: 0;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--brand-glow);
}

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

.tool-card-inner {
  padding: var(--space-6);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
}

.tool-card-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-start;
  gap: var(--space-3);
}

.tool-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.tool-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.tool-meta {
  min-width: 0;
}

.tool-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-category {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.tool-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.tool-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.tag:hover { background: var(--brand); color: white; }

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.tool-rating {
  display: flex;
  align-items: center;
  gap: 3px;
}

.star { font-size: 13px; }
.star.full { color: #f59e0b; }
.star.half { color: #f59e0b; opacity: 0.6; }
.star.empty { color: var(--border); }

.rating-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 4px;
}

.rating-count {
  font-size: 12px;
  color: var(--text-muted);
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-bookmark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.btn-bookmark:hover, .btn-bookmark.bookmarked {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-light);
}

.btn-visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-3);
  background: var(--gradient-brand);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-visit:hover {
  opacity: 0.9;
  transform: translateX(2px);
}

/* Mini Card */
.tool-card-mini {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
}

.tool-card-mini:hover {
  border-color: var(--brand);
  transform: translateX(4px);
  background: var(--bg-card-hover);
}

.mini-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.mini-info { flex: 1; min-width: 0; }

.mini-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-cat {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.mini-stars { margin-top: 2px; }

.mini-visit {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
}

.mini-visit:hover { background: var(--brand); color: white; }

/* ============================================================
   BADGES
   ============================================================ */
.badge-trending, .badge-new, .badge-sponsored, .pricing-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-trending { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-new { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-sponsored { background: #fdf4ff; color: #9333ea; border: 1px solid #e9d5ff; }

[data-theme="dark"] .badge-trending { background: rgba(194,65,12,0.15); color: #fb923c; border-color: rgba(194,65,12,0.3); }
[data-theme="dark"] .badge-new { background: rgba(22,163,74,0.15); color: #4ade80; border-color: rgba(22,163,74,0.3); }
[data-theme="dark"] .badge-sponsored { background: rgba(147,51,234,0.15); color: #c084fc; border-color: rgba(147,51,234,0.3); }

.price-free { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.price-paid { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.price-freemium { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

[data-theme="dark"] .price-free { background: rgba(21,128,61,0.15); color: #4ade80; border-color: rgba(21,128,61,0.3); }
[data-theme="dark"] .price-paid { background: rgba(190,18,60,0.15); color: #fb7185; border-color: rgba(190,18,60,0.3); }
[data-theme="dark"] .price-freemium { background: rgba(29,78,216,0.15); color: #60a5fa; border-color: rgba(29,78,216,0.3); }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-wrap {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: var(--space-4) var(--space-5) var(--space-4) 56px;
  font-size: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
  box-shadow: var(--shadow-md);
}

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

.search-input:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--brand-glow);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 20px;
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gradient-brand);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-5);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.search-btn:hover { opacity: 0.9; }

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-4);
  padding-bottom: 8px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: var(--transition-slow);
  gap: var(--space-3);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.category-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cat-color, var(--brand));
  transform: scaleX(0);
  transition: var(--transition);
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--cat-color, var(--brand));
  box-shadow: var(--shadow-lg);
}

.category-card:hover::after { transform: scaleX(1); }

.category-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--cat-bg, var(--brand-light));
  transition: var(--transition);
}

.category-card:hover .category-icon { transform: scale(1.1) rotate(-5deg); }

.category-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.category-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 8px;
  border-radius: var(--radius-full);
}

/* ============================================================
   FILTERS
   ============================================================ */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-select {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.filter-select:focus { border-color: var(--brand); }

.filter-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand);
}

.results-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--header-h);
}

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

.hero-bg-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% -10%, rgba(99,102,241,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at -10% 60%, rgba(236,72,153,0.13) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(139,92,246,0.12) 0%, transparent 70%);
  z-index: 1;
}

/* Canvas holds the animated neural-net particles */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0.55;
  pointer-events: none;
}
[data-theme="dark"] #hero-canvas { opacity: 0.35; }

/* Soft fade at the bottom so canvas doesn't bleed into content */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--bg-primary) 100%);
  z-index: 3;
  pointer-events: none;
}

[data-theme="dark"] .hero-bg-grid { /* same fade, dark mode handled by bg-primary var */ }

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 1;
  animation: orbFloat 12s ease-in-out infinite;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(0.96); }
}

.hero-orb-1 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(99,102,241,0.7), transparent 70%);
  top: -220px;
  right: -80px;
  animation-duration: 14s;
}

.hero-orb-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(236,72,153,0.65), transparent 70%);
  bottom: -120px;
  left: -80px;
  animation-duration: 11s;
  animation-delay: -4s;
}

.hero-orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(139,92,246,0.6), transparent 70%);
  top: 38%;
  left: 38%;
  animation-duration: 9s;
  animation-delay: -7s;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: var(--space-20) 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
  animation: fadeInDown 0.6s ease both;
}

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

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

.hero-title {
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
  animation: fadeInUp 0.6s 0.1s ease both;
}

.hero-desc {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-10);
  font-weight: 400;
  animation: fadeInUp 0.6s 0.2s ease both;
}

.hero-search {
  animation: fadeInUp 0.6s 0.3s ease both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-12);
  flex-wrap: wrap;
  animation: fadeInUp 0.6s 0.4s ease both;
}

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

.hero-stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ============================================================
   FEATURED / TRENDING SECTION
   ============================================================ */
.featured-strip {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  overflow-y: visible;
  padding: 6px 4px 14px;
  margin: -6px -4px -14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.featured-strip::-webkit-scrollbar { display: none; }

.featured-strip .tool-card {
  min-width: 280px;
  scroll-snap-align: start;
}

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.newsletter-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.newsletter-title {
  font-size: clamp(24px, 3vw, 36px);
  margin-bottom: var(--space-3);
}

.newsletter-desc {
  color: var(--text-secondary);
  font-size: 15px;
}

.newsletter-form {
  display: flex;
  gap: var(--space-3);
}

.newsletter-input {
  flex: 1;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}

.newsletter-input::placeholder { color: var(--text-muted); }
.newsletter-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid var(--border);
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: var(--space-3);
  max-width: 280px;
  line-height: 1.6;
}

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

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer-links a:hover { color: var(--brand); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

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

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.social-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
  color: var(--text-secondary);
}

.social-link:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }

/* ============================================================
   PAGE HEADER (Inner Pages)
   ============================================================ */
.page-header {
  padding: calc(var(--header-h) + var(--space-12)) 0 var(--space-12);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
}

.page-header-inner {
  position: relative;
  z-index: 1;
}

.page-header h1 { font-size: clamp(32px, 5vw, 56px); }
.page-header p { font-size: 17px; color: var(--text-secondary); margin-top: var(--space-3); }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.breadcrumb a { color: var(--text-muted); transition: var(--transition); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { color: var(--text-secondary); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-8);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}

.sidebar-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-4);
}

/* ============================================================
   COMPARE TABLE
   ============================================================ */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
}

.compare-table th {
  background: var(--bg-tertiary);
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.compare-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  color: var(--text-primary);
}

.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: var(--bg-tertiary); }

/* ============================================================
   TOOL DETAIL PAGE
   ============================================================ */
.tool-detail-hero {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-12);
  align-items: start;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 14px;
  color: var(--text-secondary);
}

.feature-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8) 0;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover, .page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.page-dots { color: var(--text-muted); padding: 0 var(--space-2); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

textarea.form-control { resize: vertical; min-height: 120px; }

/* ============================================================
   AD / SPONSOR BANNERS
   ============================================================ */
.ad-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, var(--brand-light), rgba(236,72,153,0.05));
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-lg);
  font-size: 13px;
}

.ad-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
#navToggle {
  display: none;
  width: 38px;
  height: 38px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

#navToggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

#mobileNav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4);
  z-index: 999;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-xl);
}

#mobileNav.open { display: flex; }

.mobile-nav-link {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
}

.mobile-nav-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }

@media (max-width: 1240px) {
  .nav-inner { gap: var(--space-5); }
  .nav-logo { font-size: 20px; }
  .nav-link {
    font-size: 13px;
    padding: var(--space-2) var(--space-2);
  }
  .nav-actions .btn-sm {
    padding: var(--space-2) var(--space-4);
  }
}

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-actions .btn-primary { display: none; }
  #navToggle { display: flex; }
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .tool-detail-hero { grid-template-columns: 1fr; }
  .newsletter-inner { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .container { padding: 0 var(--space-4); }
  #hero-canvas { opacity: 0.28; }
  .tools-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .hero-stats { gap: var(--space-5); }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .newsletter-form { flex-direction: column; }
  .compare-table { font-size: 12px; }
  .compare-table th, .compare-table td { padding: var(--space-3); }
}

@media (max-width: 480px) {
  .hero-title { letter-spacing: -0.02em; }
  .tools-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   SELECTION
   ============================================================ */
::selection { background: var(--brand); color: white; }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: var(--space-8) auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state-icon { font-size: 48px; margin-bottom: var(--space-4); }
.empty-state h3 { font-size: 20px; margin-bottom: var(--space-2); }
.empty-state p { color: var(--text-secondary); }

/* ============================================================
   SUBMIT PAGE
   ============================================================ */
.submit-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-12);
  align-items: start;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.info-card h3 {
  font-size: 16px;
  margin-bottom: var(--space-4);
}

.step-list {
  list-style: none;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.step-list li {
  counter-increment: steps;
  display: flex;
  gap: var(--space-3);
  font-size: 14px;
  color: var(--text-secondary);
}

.step-list li::before {
  content: counter(steps);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   BEST TOOLS CARDS
   ============================================================ */
.best-list-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.best-list-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.best-list-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.best-list-title {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
}

.best-list-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.best-list-count {
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
}

/* ============================================================
   TRENDING RANK
   ============================================================ */
.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #f97316); color: white; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.rank-3 { background: linear-gradient(135deg, #cd7c54, #a0522d); color: white; }
.rank-other { background: var(--bg-tertiary); color: var(--text-muted); border: 1px solid var(--border); }
