/* ==========================================================================
   Shared site navigation — used by index.html and every /tools/*.html page.
   Colors are scoped here (not reusing each tool page's --navy/--gold) so
   this file behaves identically no matter which page includes it.
   ========================================================================== */

:root {
  --primary: #1d3e6c;
  --secondary: #5287b9;
  --accent: #e78c4f;
}

nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: #fff;
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 0.75rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: none;
  transition: all 0.3s;
}

.logo { display: flex; align-items: center; }
.logo a { display: flex; align-items: center; }
.logo img { max-width: 280px; height: auto; }
.logo .logo-dark { display: block; }
.logo .logo-white { display: none; }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--primary);
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.3s;
  font-size: 1.1rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary);
}

/* Scrolled state (also the permanent state once past the header/hero) */
nav.nav-scrolled {
  background: linear-gradient(380deg, var(--secondary) 0%, var(--primary) 100%);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}
nav.nav-scrolled .nav-links a { color: rgba(255, 255, 255, 0.9); }
nav.nav-scrolled .nav-links a:hover { color: var(--accent); }
nav.nav-scrolled .nav-links a::after { background: var(--accent); }
nav.nav-scrolled .mobile-toggle { color: #fff; }
nav.nav-scrolled .logo-dark { display: none; }
nav.nav-scrolled .logo-white { display: block; }

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 2rem;
    gap: 1rem;
    transform: translateY(-150%);
    transition: transform 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }
  .nav-links.active { transform: translateY(0); }
  nav.nav-scrolled .nav-links { background: #fff; }
  nav.nav-scrolled .nav-links a { color: var(--primary); }
  .mobile-toggle { display: block; }
}

/* ==========================================================================
   Tool-page header extras: back-to-tools pill + 3-tier title block.
   These reference each tool page's OWN --gold/--navy/etc. variables so
   they inherit that page's palette automatically.
   ========================================================================== */

.hd-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #c3d2e8;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  margin-bottom: 18px;
  transition: all 0.2s;
}
.hd-back:hover {
  background: var(--gold, #c9a227);
  border-color: var(--gold, #c9a227);
  color: var(--navy-2, #16304f);
}
.hd-back i { font-size: 0.82rem; }

.hd-tagline {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: clamp(1.02rem, 2.3vw, 1.28rem);
  color: #e3c979;
  margin-top: 8px;
  max-width: 760px;
  line-height: 1.35;
}

/* ==========================================================================
   Unified floating-button (FAB) system — used by index.html and, via the
   chatbot bubble, every /tools/*.html page. JS positioning lives in
   initFabs() in script.js; this file only handles appearance/animation.
   Prefix is "fabtn" (not "fab") — Font Awesome already owns the literal
   class "fab" for its brand icons (fab fa-whatsapp etc.).
   ========================================================================== */

:root {
  --fabtn-right: 30px;
}

.fabtn {
  position: fixed;
  right: var(--fabtn-right);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              transform 0.3s ease,
              visibility 0.3s;
}

.fabtn.fabtn-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* WhatsApp */
.fabtn-whatsapp {
  width: 50px;
  height: 50px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}
.fabtn-whatsapp:hover {
  background: #1ebe5d;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* Back to top */
.fabtn-backtotop {
  width: 50px;
  height: 50px;
  background: var(--primary, #1d3e6c);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.0rem;
  box-shadow: 0 4px 15px rgba(29, 62, 108, 0.3);
}
.fabtn-backtotop:hover {
  background: var(--secondary, #5287b9);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(29, 62, 108, 0.4);
}

/* Close-all / restore controls (created by initFabs()) */
.fabtn-close,
.fabtn-restore {
  position: fixed;
  right: var(--fabtn-right);
  z-index: 1000;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  background: #fff;
  color: #5c6b80;
  border: 1px solid #dde4ee;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease, visibility 0.25s, transform 0.2s ease;
}
.fabtn-close.fabtn-visible,
.fabtn-restore.fabtn-visible {
  opacity: 1;
  visibility: visible;
}
.fabtn-close:hover,
.fabtn-restore:hover {
  background: #eef2f8;
  color: #1d3e6c;
  transform: scale(1.08);
}
.fabtn-restore {
  bottom: 30px;
}

@media (max-width: 480px) {
  :root { --fabtn-right: 16px; }
}
