/* ===== HEADER ===== */

/* Base navbar — fixed, 80px tall, transparent initially */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 80px;
  display: flex;
  align-items: center;
  background: transparent;
  transition: background 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
}

/* Scrolled state — white glass */
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid #E2E8F0;
}

/* Inner container */
.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo — left */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Satoshi', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: #0B1320;
  flex-shrink: 0;
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

/* Nav links — centered */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748B;
  text-decoration: none;
  transition: color 250ms ease, background 250ms ease;
  border-radius: 8px;
  position: relative;
  white-space: nowrap;
}

/* Animated underline */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #3E7BFA;
  transition: width 250ms ease;
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav-links a:hover {
  color: #0B1320;
  background: rgba(62, 123, 250, 0.06);
}

/* Active page — blue text + underline */
.nav-links a.active {
  color: #3E7BFA;
}

.nav-links a.active::after {
  width: calc(100% - 28px); /* match horizontal padding */
}

/* CTA button — right */
.btn-cta {
  padding: 10px 20px !important;
  font-size: 0.85rem !important;
}

/* Dropdown wrapper */
.dropdown { position: relative; }

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 250ms ease;
}

.dropdown:hover .dropdown-toggle svg,
.dropdown.open .dropdown-toggle svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 250ms ease;
  padding: 8px;
  z-index: 1001;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px !important;
  font-size: 0.875rem !important;
  border-radius: 8px !important;
  color: #64748B !important;
}

.dropdown-menu a::after { display: none !important; }

.dropdown-menu a:hover {
  background: #F3F7FB !important;
  color: #0B1320 !important;
}

/* Searchable: hide dropdown arrow on standalone links */
.nav-links a:not(.dropdown-toggle)::after {
  content: '';
}

/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  z-index: 1002;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #0B1320;
  border-radius: 2px;
  transition: all 300ms ease;
}

/* Hamburger → X animation */
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile overlay */
.nav-overlay {
  display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 100px 24px 32px;
    gap: 4px;
    transition: right 300ms ease;
    z-index: 1001;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    overflow-y: auto;
  }

  .nav-links.open { right: 0; }

  .nav-links a {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .nav-links a::after { display: none; }

  /* Hamburger visible */
  .hamburger { display: flex; }

  /* Overlay */
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms ease, visibility 300ms ease;
    z-index: 1000;
  }

  .nav-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  /* Dropdowns behave like accordions on mobile */
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 16px;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease;
  }

  .dropdown.open .dropdown-menu {
    max-height: 300px;
  }
}

/* Desktop dropdown hover */
@media (min-width: 1025px) {
  .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* Body scroll lock */
body.menu-open { overflow: hidden; }
