/* ============================================================
   TOOLS PAGE — Search, Filter Tabs, Catalog
   ============================================================ */

/* ── HERO ────────────────────────────────────────────────── */
.tools-hero {
  padding: var(--space-16) 0 var(--space-10);
  text-align: center;
}
.tools-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  line-height: var(--leading-snug);
}
.tools-hero-sub {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.tools-hero-search {
  max-width: 560px;
  margin: 0 auto;
}
.tools-search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
}
.tools-search-bar:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow-sm), var(--shadow-md);
}
.tools-search-icon {
  padding: 0 var(--space-4);
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
}
.tools-search-input {
  flex: 1;
  height: 52px;
  padding: 0 var(--space-4) 0 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--text-primary);
}
.tools-search-input::placeholder { color: var(--text-disabled); }
.tools-search-count {
  padding: 0 var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── FILTER TABS ─────────────────────────────────────────── */
.tools-page-section { padding: var(--space-4) 0 var(--space-24); }
.tools-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}
.tools-filter-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-1);
}
.filter-tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text-secondary); background: var(--bg-overlay); }
.filter-tab.active {
  background: var(--bg-overlay);
  color: var(--text-primary);
}
.filter-tab-count {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  background: var(--bg-base);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}
.filter-tab.active .filter-tab-count {
  background: var(--accent-dim);
  color: var(--accent-light);
}
.tools-sort-select {
  height: 36px;
  padding: 0 var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
}

/* ── TOOLS CATALOG ───────────────────────────────────────── */
.tools-catalog { display: flex; flex-direction: column; gap: var(--space-10); }
.catalog-category {}
.catalog-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.catalog-category-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.catalog-category-icon {
  width: 32px; height: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.catalog-category-count {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  background: var(--bg-overlay);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}
.catalog-tool-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}
.catalog-tool-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-light);
  transform: translateY(-1px);
}
.catalog-tool-card:hover .catalog-tool-icon { background: var(--accent-dim); }
.catalog-tool-icon {
  width: 40px; height: 40px;
  background: var(--bg-overlay);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.catalog-tool-body { flex: 1; min-width: 0; }
.catalog-tool-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.catalog-tool-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}
.catalog-tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}
.catalog-tool-tag {
  font-size: 11px;
  color: var(--text-disabled);
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}
.catalog-tool-arrow {
  color: var(--text-disabled);
  flex-shrink: 0;
  font-size: 18px;
  margin-top: 2px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.catalog-tool-card:hover .catalog-tool-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* No results */
.tools-no-results {
  text-align: center;
  padding: var(--space-16) 0;
  display: none;
}
.tools-no-results.visible { display: block; }
.tools-no-results-icon { font-size: 3rem; margin-bottom: var(--space-4); }
.tools-no-results h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.tools-no-results p { font-size: var(--text-sm); color: var(--text-muted); }

/* Hidden by filter */
.catalog-category.hidden { display: none; }
.catalog-tool-card.hidden { display: none; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .tools-hero { padding: var(--space-12) 0 var(--space-8); }
  .tools-filter-bar { flex-direction: column; align-items: stretch; }
  .tools-filter-tabs { overflow-x: auto; }
  .catalog-tool-card { flex-wrap: wrap; }
}
