/* =========================================
   NAV.CSS - COMPLETE REPLACEMENT
   ========================================= */

/* --- Base Nav Structure --- */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: 80px; /* Fixed height to prevent layout shifts */
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
}

.logo img {
  height: 45px; /* Consistent logo size */
  width: auto;
  display: block;
}

/* --- Navigation Links (Desktop) --- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 100%;
}

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

/* Base Link Style */
.nav a {
  color: #334155; /* Dark slate text */
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--primary);
}

/* Dropdown Arrow Styling */
.nav-item > a::after {
  content: '▾';
  font-size: 0.8em;
  margin-left: 6px;
  display: inline-block;
  transition: transform 0.2s ease;
}
.nav-item:hover > a::after {
  transform: rotate(180deg);
}

/* --- Desktop Dropdowns --- */
.dropdown {
  display: block; /* We control visibility with opacity/visibility for animation */
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #ffffff;
  min-width: 240px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 8px;
  padding: 0.8rem 0;
  transition: all 0.2s ease;
  z-index: 1100;
}

/* Show Dropdown on Hover */
.nav-item:hover .dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dropdown a {
  display: block;
  padding: 0.8rem 1.5rem;
  font-size: 0.9rem;
  color: #475569;
  border-bottom: 1px solid transparent;
}

.dropdown a:hover {
  background: #f8fafc;
  color: var(--primary);
  padding-left: 1.8rem; /* Subtle slide effect */
}

/* --- Special Buttons in Nav --- */

/* Login Link */
.login-link {
  font-weight: 600;
  margin-left: 1rem;
}

/* CTA Button Specifics - FORCING WHITE TEXT */
.nav .cta {
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav .cta.primary {
  background-color: var(--primary) !important;
  color: #ffffff !important; /* Force white text */
  border: 1px solid var(--primary);
}

.nav .cta.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(28, 63, 120, 0.25);
  background-color: #163260 !important; /* Darker blue on hover */
}

/* --- Burger Menu (Mobile Toggle) --- */
.burger {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #334155;
  cursor: pointer;
  padding: 0;
}

/* =========================================
   MOBILE / TABLET VIEW (Max-Width 1024px)
   ========================================= */
@media (max-width: 1024px) {
  .nav-inner {
    padding: 0 1.5rem;
  }

  .burger {
    display: block; /* Show burger */
  }

  .nav-links {
    position: absolute;
    top: 80px; /* Push below navbar */
    left: 0;
    width: 100%;
    height: auto;
    background: #ffffff;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);

    /* Hide by default */
    display: none;
    max-height: 80vh;
    overflow-y: auto; /* Scrollable if too long */
  }

  /* When JS adds .active class */
  .nav-links.active {
    display: flex;
  }

  .nav-item {
    width: 100%;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid #f1f5f9;
  }

  /* Main Links in Mobile */
  .nav-links > a,
  .nav-item > a {
    width: 100%;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 600;
  }

  /* Remove arrow rotation on mobile, just hide it */
  .nav-item > a::after {
    display: none;
  }

  /* Mobile Submenus - Always Visible (Stacked) */
  .dropdown {
    position: static; /* No absolute positioning */
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    width: 100%;
    padding: 0;
    background: #f8fafc; /* Slight grey background to distinguish */
    display: block;
  }

  .dropdown a {
    padding: 1rem 3rem; /* Indented */
    font-size: 1rem;
    color: #64748b;
    border-bottom: 1px solid #eef2f6;
  }

  /* Mobile Buttons */
  .nav .cta.primary {
    margin: 1.5rem 2rem;
    width: calc(100% - 4rem);
    text-align: center;
    justify-content: center;
    display: flex;
  }

  .login-link {
    margin: 0 2rem 2rem 2rem;
    display: block;
  }
}
