/* ZONFORGE ENTERPRISE HEADER REDESIGN */

:root {
  --nav-height: 88px;
}

.zf-site-nav {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(5, 9, 20, 0.55); /* Improved transparency/readability balance */
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04); /* Thin subtle separation */
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  transition: background-color 0.3s ease;
}

.zf-site-nav .nav-inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 1440px;
  min-height: var(--nav-height);
  height: var(--nav-height);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.zf-site-nav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.brand-logo {
  height: 28px; /* Balanced height, not dominating header */
  width: auto;
  max-width: 280px;
  object-fit: contain;
  filter: none; /* Removed heavy drop-shadow filter */
}

.brand-logo-mark {
  height: 28px; /* Balanced height */
  width: auto;
  object-fit: contain;
  filter: none; /* Removed heavy drop shadow */
}

.zf-site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 26px; /* Optimized spacing for mid-size laptop viewports */
  height: 100%;
  position: static;
}

.zf-site-nav .nav-item {
  position: static;
  display: flex;
  align-items: center;
  height: 100%;
}

.zf-site-nav .nav-link {
  border: 0;
  background: transparent;
  padding: 0 8px;
  color: #cbd5e1; /* slate-300 contrast */
  font-size: 13.5px; /* Refined font size */
  font-weight: 600; /* Cleaner weight */
  letter-spacing: 0.02em;
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color .2s ease;
}

.zf-site-nav .nav-link:hover,
.zf-site-nav .nav-link:focus-visible,
.zf-site-nav .nav-item.is-open > .nav-link {
  color: #ffffff; /* Crisp white on hover */
  outline: none;
}

.zf-site-nav .nav-link.active {
  color: #ffffff;
  position: relative;
}

.zf-site-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  background: #38d5ff; /* Subtle clean active indicator bar */
  border-radius: 2px;
}

.zf-site-nav .chev {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -1px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: .7;
}

.zf-site-nav .nav-item.is-open .chev {
  transform: rotate(225deg);
  margin-top: 2px;
}

/* Mega Menu Container aligned with inner content limits */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 40px; /* Align menu boundaries with nav-inner padding */
  right: 40px;
  width: auto;
  max-width: 1360px;
  padding: 32px;
  border: 1px solid rgba(56, 213, 255, 0.12);
  border-radius: 12px;
  background: rgba(6, 12, 24, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.65), 0 0 48px rgba(34, 211, 238, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), transform 220ms cubic-bezier(0.16, 1, 0.3, 1), visibility 220ms ease;
  z-index: 1001;
}

.zf-site-nav .nav-item.is-open > .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.mega-grid.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
}

.mega-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega-group-title {
  margin: 0 0 8px;
  color: #5d7890;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(148, 189, 255, 0.08);
  padding-bottom: 6px;
}

.mega-link {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #dcecff;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.mega-link:hover,
.mega-link:focus-visible {
  background: linear-gradient(135deg, rgba(125, 249, 255, 0.08), rgba(47, 128, 255, 0.04));
  border-color: rgba(125, 249, 255, 0.15);
  transform: translateY(-1.5px);
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.06);
  outline: none;
}

/* Simplified enterprise style icons */
.mega-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #94a3b8; /* Flat slate-400 color */
  background: rgba(255, 255, 255, 0.03); /* Flat subtle backdrop plate */
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.mega-link:hover .mega-icon {
  color: #38d5ff; /* Slick accent on link hover */
  background: rgba(56, 213, 255, 0.08);
  border-color: rgba(56, 213, 255, 0.25);
}

.mega-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  fill: none;
}

.mega-title {
  display: block;
  color: #eef8ff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.mega-desc {
  display: block;
  margin-top: 4px;
  color: #7590a8;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

/* Right Side Utilities */
.zf-site-nav .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0 12px;
  height: 38px;
  transition: all 0.2s ease;
}

.nav-search:focus-within {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(56, 213, 255, 0.45);
  box-shadow: 0 0 10px rgba(56, 213, 255, 0.2);
}

.nav-search svg {
  width: 15px;
  height: 15px;
  color: #8faac4;
  margin-right: 8px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.nav-search input {
  background: transparent;
  border: none;
  color: #f0f6ff;
  font-size: 13px;
  outline: none;
  width: 130px;
  font-family: inherit;
}

.nav-search input:focus {
  width: 130px; /* Lock width to prevent layout shifts */
}

.nav-right-link {
  color: #a6bdd2;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.18s ease;
  padding: 8px;
}

.nav-right-link:hover {
  color: #fff;
}

/* Button styles */
.zf-site-nav .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
}

.zf-site-nav .btn-demo {
  color: #f5fbff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 189, 255, 0.20);
}

.zf-site-nav .btn-demo:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(56, 213, 255, 0.35);
  transform: translateY(-1px);
}

/* Polished Start Free CTA */
.zf-site-nav .btn-start {
  background: #2f80ff; /* Solid premium corporate blue */
  color: #ffffff;
  border: 1px solid #2f80ff;
  box-shadow: none; /* Removed heavy consumer-style glow */
}

.zf-site-nav .btn-start:hover {
  background: #1d68d9; /* Subtle darken on hover */
  border-color: #1d68d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 128, 255, 0.2); /* Flat clean shadow */
}

.zf-site-nav .btn:active {
  transform: scale(0.98);
}

/* Mobile & Responsive */
.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(148, 189, 255, .16);
  background: rgba(255, 255, 255, .035);
  color: #f4fbff;
  align-items: center;
  justify-content: center;
}

.mobile-menu-button svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  stroke: currentColor;
}

.mobile-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: calc(100dvh - var(--nav-height));
  z-index: 9998;
  display: none;
  border-top: 1px solid rgba(125, 249, 255, .10);
  background: rgba(5, 9, 20, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .2s ease, opacity .2s ease;
  overflow: auto;
}

.mobile-panel-inner {
  min-height: calc(100dvh - var(--nav-height));
  padding: 18px 40px 120px;
  display: flex;
  flex-direction: column;
}

.mobile-details {
  border-bottom: 1px solid rgba(148, 189, 255, .08);
}

.mobile-details summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  color: #eff8ff;
  font-weight: 800;
  cursor: pointer;
}

.mobile-details summary::-webkit-details-marker {
  display: none;
}

.mobile-details summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: .16s;
  opacity: .65;
}

.mobile-details[open] summary::after {
  transform: rotate(225deg);
}

.mobile-link {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  padding: 13px 0 13px 12px;
  color: #8faac4;
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(99, 102, 241, 0.15);
  touch-action: manipulation;
}

.mobile-link strong {
  display: block;
  color: #dcecff;
  font-size: 14px;
}

.mobile-link span {
  display: block;
  margin-top: 2px;
  color: #6f899f;
  font-size: 12px;
  line-height: 1.35;
}

.mobile-ctas {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: auto;
  padding: 18px 0 0;
  background: linear-gradient(180deg, rgba(5, 9, 20, 0), rgba(5, 9, 20, .98) 24%);
}

.mobile-ctas .btn {
  width: 100%;
}

@media(max-width: 1120px) {
  .zf-site-nav .nav-links,
  .zf-site-nav .nav-right {
    display: none;
  }
  .mobile-menu-button {
    display: inline-flex;
  }
  .zf-site-nav .nav-inner {
    height: 72px;
    min-height: 72px;
    display: flex;
    justify-content: space-between;
    padding-left: 32px;
    padding-right: 32px;
  }
  .zf-site-nav .brand {
    min-width: 0;
    width: auto;
  }
  .brand-logo {
    height: 40px;
    min-height: 40px;
    max-width: 260px;
  }
  .brand-logo-mark {
    height: 40px;
  }
  .mobile-panel {
    display: block;
    height: calc(100dvh - 72px);
  }
  .mobile-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
}

@media(max-width: 560px) {
  .zf-site-nav .brand span:not(.sr-only) {
    display: none;
  }
  .zf-site-nav .nav-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
  .brand-logo {
    height: 36px;
    min-height: 36px;
    max-width: 220px;
  }
  .brand-logo-mark {
    height: 36px;
  }
  .mobile-panel-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media(prefers-reduced-motion: reduce) {
  .mega-menu,
  .mega-link,
  .zf-site-nav .nav-link,
  .zf-site-nav .btn {
    transition: none;
  }
}
