/* ================================================================
   NAVIGATION - MOBILE FIRST
   Header, navigation menu, and mobile menu
   ================================================================ */

/* ================================================================
   HEADER - FIXED HEIGHT (Prevents expansion with logo)
   ================================================================ */

   .header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-base);
    
    /* FIXED HEIGHT - Mobile */
    height: 60px;
    min-height: 60px;
    max-height: 60px;
}

/* Fixed height for tablet and desktop */
@media (min-width: 768px) {
    .header {
        height: 70px;
        min-height: 70px;
        max-height: 70px;
    }
}

@media (min-width: 1024px) {
    .header {
        height: 75px;
        min-height: 75px;
        max-height: 75px;
    }
}

/* Scrolled state - slightly smaller but still fixed */
.header.scrolled {
    height: 55px;
    min-height: 55px;
    max-height: 55px;
    box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
    .header.scrolled {
        height: 60px;
        min-height: 60px;
        max-height: 60px;
    }
}

@media (min-width: 1024px) {
    .header.scrolled {
        height: 65px;
        min-height: 65px;
        max-height: 65px;
    }
}

/* ================================================================
   HEADER CONTAINER - Centered within fixed height
   ================================================================ */

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;              /* Fill header height */
    padding: 0 1rem;          /* Only horizontal padding */
    max-width: var(--container-wide);
    margin: 0 auto;
}

/* ================================================================
   LOGO - Constrained to fit within header
   ================================================================ */

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 1001;
    
    /* Remove padding that expands header */
    padding: 0;
    margin: 0;
    
    /* Constrain logo to header height */
    height: 100%;
    max-height: 100%;
}

.logo:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.logo:active {
    transform: scale(0.98);
}

/* ================================================================
   LOGO IMAGE - Fits within header height
   ================================================================ */

.logo-image {
    width: auto;
    /* Logo height = 90% of header height for padding */
    height: 54px;              /* 90% of 60px mobile header */
    max-height: 54px;
    max-width: 220px;
    display: block;
    object-fit: contain;
    transition: height 0.3s ease, opacity 0.3s ease;
}

/* Remove old styles */
.logo-icon,
.logo span {
    display: none !important;
}

/* ================================================================
   RESPONSIVE LOGO SIZES - Within fixed header
   ================================================================ */

/* Mobile (320px - 767px) - Header: 60px */
@media (max-width: 767px) {
    .logo-image {
        height: 50px;          /* Fits in 60px header */
        max-height: 50px;
        max-width: 200px;
    }
}

/* Tablet (768px - 1023px) - Header: 70px */
@media (min-width: 768px) and (max-width: 1023px) {
    .logo-image {
        height: 60px;          /* Fits in 70px header */
        max-height: 60px;
        max-width: 240px;
    }
}

/* Desktop (1024px+) - Header: 75px */
@media (min-width: 1024px) {
    .logo-image {
        height: 65px;          /* Fits in 75px header */
        max-height: 65px;
        max-width: 260px;
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .logo-image {
        height: 68px;
        max-height: 68px;
        max-width: 280px;
    }
}

/* ================================================================
   SCROLLED STATE - Logo shrinks within smaller header
   ================================================================ */

/* Mobile scrolled - Header: 55px */
.header.scrolled .logo-image {
    height: 45px;
    max-height: 45px;
}

/* Tablet scrolled - Header: 60px */
@media (min-width: 768px) {
    .header.scrolled .logo-image {
        height: 52px;
        max-height: 52px;
    }
}

/* Desktop scrolled - Header: 65px */
@media (min-width: 1024px) {
    .header.scrolled .logo-image {
        height: 56px;
        max-height: 56px;
    }
}



/* ================================================================
   MOBILE MENU TOGGLE - Centered in header
   ================================================================ */

.mobile-menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}




/* Desktop Navigation */
.nav {
  display: none;
}

.nav-list {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.nav-link {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

/* Underline Animation */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 6px;  /* ← CHANGE THIS LINE */
  left: 51% !important;
  transform: translateX(-50%) scaleX(0);
  width: 70%;   /* ← Optional: also change width for better look */
  height: 2px;
  background-color: var(--primary-color);
  transition: transform var(--transition-base);
}


.nav-link:hover::after,
.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* Mobile Menu Toggle (Hamburger Icon) */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 22px;
  padding: 0;
  cursor: pointer;
  z-index: 1001;
  background: transparent;
  border: none;
  position: relative;
}

/* Hamburger Lines */
.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
  transform-origin: center;
}

/* Hamburger Active State (Transforms to X) */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* Hover effect on hamburger */
.mobile-menu-toggle:hover span {
  background-color: var(--primary-light);
}


/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background-color: var(--bg-darker);
  border-left: 1px solid var(--border-color);
  padding: var(--space-3xl) var(--space-lg) var(--space-lg);
  transition: right var(--transition-slow);
  overflow-y: auto;
  z-index: 1000;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 999;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* Mobile Navigation Links - REDUCED HEIGHT */
.mobile-nav-link {
  display: block;
  padding: 10px 16px; /* REDUCED from var(--space-md) */
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

/* Hover State */
.mobile-nav-link:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Active State - FLATTER OVERLAY */
.mobile-nav-link.active {
  color: var(--primary-color);
  background: linear-gradient(
      135deg,
      rgba(0, 102, 204, 0.15) 0%,
      rgba(0, 102, 204, 0.05) 100%
  );
  border-left: 3px solid var(--primary-color);
  padding-left: 13px; /* 16px - 3px for border */
  font-weight: 600;
}



.mobile-cta {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

