/* Hub-only styles */
.search-bar {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-bottom: 26px;
}

#toolSearch {
  font-size: 1.05rem;
  padding: 16px 20px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
}

#toolSearch:focus {
  background: var(--elevate);
  border-color: var(--primary);
}

.tool-section { margin-bottom: 30px; }

.group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-dark);
  margin: 0 0 14px 2px;
  font-weight: 800;
}

.group-title::before {
  content: "";
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--grad);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tool-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.18s, border-color 0.18s;
}

.tool-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: transparent;
  box-shadow: var(--shadow-lg);
}

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

.tool-icon {
  font-size: 1.5rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  border-radius: 14px;
  transition: transform 0.2s;
}

/* Colourful cycling icon badges for a more vibrant grid */
.tool-grid .tool-card:nth-child(5n + 1) .tool-icon { background: rgba(13, 148, 136, 0.15); }
.tool-grid .tool-card:nth-child(5n + 2) .tool-icon { background: rgba(99, 102, 241, 0.15); }
.tool-grid .tool-card:nth-child(5n + 3) .tool-icon { background: rgba(236, 72, 153, 0.15); }
.tool-grid .tool-card:nth-child(5n + 4) .tool-icon { background: rgba(245, 158, 11, 0.18); }
.tool-grid .tool-card:nth-child(5n + 5) .tool-icon { background: rgba(6, 182, 212, 0.16); }
.tool-card:hover .tool-icon { transform: scale(1.08) rotate(-3deg); }

.tool-title { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
.tool-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

.no-results { text-align: center; color: var(--muted); margin-top: 20px; }

/* Staggered entrance for cards */
@keyframes tb-card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.tool-card { animation: tb-card-in 0.4s ease both; }
.tool-card:nth-child(2) { animation-delay: 0.03s; }
.tool-card:nth-child(3) { animation-delay: 0.06s; }
.tool-card:nth-child(4) { animation-delay: 0.09s; }
.tool-card:nth-child(5) { animation-delay: 0.12s; }
.tool-card:nth-child(6) { animation-delay: 0.15s; }

@media (max-width: 720px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .tool-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-card { animation: none; }
}
