/* ==========================================================================
   The OSINT Vault - Experience Layer
   Additive presentation upgrades only. Uses existing design tokens.
   ========================================================================== */

html { scroll-behavior: smooth; }

/* ---------- Sticky category filter bar ---------- */
.category-nav {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(5, 5, 8, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.category-nav.is-stuck {
  background: rgba(5, 5, 8, 0.96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* ---------- Category buttons: clearer states ---------- */
.category-button {
  position: relative;
  transition: color 0.18s ease, background 0.18s ease;
}
.category-button::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  background: var(--copper);
  transform: translateX(-50%);
  transition: width 0.22s ease;
}
.category-button:hover::after { width: 40%; }
.category-button.active { color: var(--copper); }
.category-button.active::after { width: 70%; }
.category-button.is-spy:not(.active) { color: var(--copper-light, #e09a63); }
.category-button.is-spy:not(.active)::after { width: 40%; opacity: 0.5; }

/* ---------- Search bar: primary control treatment ---------- */
.search-bar {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.search-bar:focus-within {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(212, 133, 78, 0.16), 0 8px 28px rgba(0, 0, 0, 0.45);
  background: var(--surface2);
}
.search-bar:focus-within i { color: var(--copper); }

.search-feedback {
  margin: 0.75rem auto 0;
  max-width: var(--max-w);
  padding: 0 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-light);
  min-height: 1.1em;
}
.search-feedback strong { color: var(--copper); font-weight: 600; }

/* ---------- Section headers: label + count ---------- */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.section-count {
  font-family: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--slate-light);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  transform: translateY(-2px);
  white-space: nowrap;
}

/* ---------- Tool cards: depth and response ---------- */
.tool-card {
  transition: background 0.18s ease, border-left-color 0.18s ease,
              transform 0.18s ease, box-shadow 0.18s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-left-color: var(--copper);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 133, 78, 0.07) 0%, transparent 42%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.tool-card:hover::before { opacity: 1; }

.tool-card h3 { transition: color 0.18s ease; }
.tool-card:hover h3 { color: var(--copper-light, #e09a63); }

.tool-tag { transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease; }
.tool-card:hover .tool-tag { border-color: rgba(212, 133, 78, 0.28); }

.tool-url a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.16s ease, letter-spacing 0.16s ease;
}
.tool-url a::after {
  content: '\2192';
  transition: transform 0.18s ease;
}
.tool-url a:hover::after { transform: translateX(4px); }

/* ---------- Quick links: pill response ---------- */
.quick-link { transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease; }
.quick-link:hover {
  color: var(--copper);
  border-color: rgba(212, 133, 78, 0.4);
  background: rgba(212, 133, 78, 0.06);
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 400;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--copper);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s,
              border-color 0.16s ease, background 0.16s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { border-color: var(--copper); background: var(--surface3, #101018); }

/* ---------- Page scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: #26262f; border: 2px solid var(--surface); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 133, 78, 0.55); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tool-card, .tool-card::before, .category-button::after { transition: none; }
  .tool-card:hover { transform: none; }
}
