/* ===========================================================
   VectorScaleDB — Canonical navigation + footer (scoped)

   Bridge stylesheet for index.html ONLY.

   index.html renders its bespoke hero / value-card / terminal body
   from theme.css + the Tailwind CDN, NOT from style.css. The other
   84 pages get the canonical nav + footer styling from style.css.
   This file ports the NAV-ONLY (+ canonical footer) rules out of
   style.css so index.html can present the exact same injected nav
   markup (VsdbComponents.renderNav / renderFooter) without pulling
   in style.css, whose `.section` / `.card` / `.hero` / `.container`
   selectors collide with the names index's body relies on.

   Collision handling:
   - theme.css ALSO defines `.nav`, `.nav-links`, `.nav-hamburger`,
     `.mobile-menu`, `.mobile-menu a` (used only by the bespoke nav
     this file replaces). The canonical nav element carries
     `id="nav"` and the mobile menu carries `id="mobile-menu"`, so
     the colliding top-level rules below are anchored to those ids.
     Higher id-specificity wins over theme.css's bare class rules
     regardless of stylesheet load order — no body restyle, no
     dependence on this file from the other 84 pages.
   - The canonical color tokens (`--border`, `--text`, `--text-muted`,
     `--accent`, `--accent-purple`) live in style.css's `:root`, which
     index.html does NOT load. They are re-declared LOCALLY on the nav
     + footer roots below (resolved to their style.css values) so this
     file is self-contained and the tokens never leak to the body.
   =========================================================== */

#nav,
#mobile-menu,
.footer[data-vsdb-footer] {
  --border: rgba(255, 255, 255, 0.06);
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #2563eb;
  --accent-purple: #7c3aed;
}

/* ---------------------------------------------------------------
   Navigation (id-anchored so it wins over theme.css's `.nav`)
   --------------------------------------------------------------- */

#nav.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(9, 9, 11, 0.8);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

#nav.nav.scrolled {
  background: rgba(9, 9, 11, 0.95);
}

#nav .nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
}

#nav .nav-logo {
  height: 36px;
  width: auto;
  flex-shrink: 0;
}

#nav .nav-logo-link {
  display: inline-flex;
  align-items: center;
}

#nav .nav-cta-short {
  display: none;
}

#nav .nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

@media (min-width: 1200px) {
  #nav .nav-links {
    gap: 2rem;
  }
}

#nav .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

#nav .nav-links a:hover {
  color: var(--text);
}

#nav .nav-cta {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  border: none;
  cursor: pointer;
}

#nav .nav-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #fff;
}

#nav .nav-hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  /* >=44x44 tap target */
  width: 44px;
  height: 44px;
  padding: 10px;
  margin-right: -10px;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

#nav .nav-hamburger:hover,
#nav .nav-hamburger:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

#nav .nav-hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ---------------------------------------------------------------
   Mobile menu (id-anchored so it wins over theme.css's
   `.mobile-menu` / `.mobile-menu a`)
   --------------------------------------------------------------- */

#mobile-menu.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 9, 11, 0.98);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1001;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 1.5rem 1.5rem 2.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#mobile-menu.mobile-menu.active,
#mobile-menu.mobile-menu.open {
  display: flex;
}

#mobile-menu .mobile-menu-close {
  position: absolute;
  top: 0.6rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

#mobile-menu .mobile-menu-close:hover,
#mobile-menu .mobile-menu-close:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

#mobile-menu .mobile-menu-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 3.5rem 0 0;
  padding: 0;
}

#mobile-menu .mobile-menu-links li {
  border-bottom: 1px solid var(--border);
}

#mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0.5rem 0.25rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 500;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

#mobile-menu .mobile-menu-links a:hover,
#mobile-menu .mobile-menu-links a:active {
  color: var(--accent);
}

/* The bottom CTA inside the mobile menu — full-width, tall, tappable */
#mobile-menu .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 2rem !important;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: #fff;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

/* ---------------------------------------------------------------
   Nav responsive breakpoints (id-anchored)
   --------------------------------------------------------------- */

@media (max-width: 1024px) {
  #nav .nav-links {
    display: none;
  }

  #nav .nav-hamburger {
    display: flex;
  }

  #nav .nav-container {
    min-height: 56px;
    padding: 0.5rem 1.25rem;
    gap: 0.75rem;
  }

  #nav .nav-logo {
    height: 30px;
  }
}

/* "Request Demo" -> "Demo" under 900px */
@media (max-width: 900px) {
  #nav .nav-cta-full {
    display: none;
  }

  #nav .nav-cta-short {
    display: inline;
  }

  #nav .nav-container .nav-cta {
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  #nav .nav-logo {
    height: 26px;
  }
}

@media (max-width: 480px) {
  #nav .nav-container {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }

  #nav .nav-logo {
    height: 24px;
  }

  #nav .nav-container .nav-cta {
    min-height: 38px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }

  #mobile-menu.mobile-menu {
    padding: 1.25rem 1.25rem 2.5rem;
  }
}

/* ---------------------------------------------------------------
   Canonical footer (VsdbComponents.renderFooter output).

   theme.css defines `.footer` / `.footer-grid` but NONE of the
   canonical `.footer-brand` / `.footer-heading` / `.footer-links` /
   `.footer-bottom` classes. The footer placeholder is keyed by the
   `data-vsdb-footer` attribute, so these rules are anchored to it to
   override theme.css's bare `.footer` / `.footer-grid` cleanly while
   leaving theme.css's footer rules (used nowhere else now) inert.
   --------------------------------------------------------------- */

.footer[data-vsdb-footer] {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 6rem;
}

.footer[data-vsdb-footer] .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer[data-vsdb-footer] .footer-brand p,
.footer[data-vsdb-footer] .card-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 1rem;
  line-height: 1.6;
}

.footer[data-vsdb-footer] .footer-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer[data-vsdb-footer] .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer[data-vsdb-footer] .footer-links li {
  margin-bottom: 0.5rem;
}

.footer[data-vsdb-footer] .footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer[data-vsdb-footer] .footer-links a:hover {
  color: var(--text);
}

.footer[data-vsdb-footer] .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer[data-vsdb-footer] .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer[data-vsdb-footer] .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
