/* ==========================================================================
   NAVBAR (HEADER) - Full-Width Aggressive
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-index-nav);
  padding: 16px 32px;
  transition: all var(--transition-normal);
  
  /* Cyber Glassmorphism */
  background: rgba(5, 8, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 4px 30px rgba(0, 240, 255, 0.1);
}

.navbar.scrolled {
  padding: 12px 32px;
  background: rgba(3, 5, 10, 0.95);
  border-bottom: 1px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.2);
}

/* Ensure container doesn't restrict the capsule badly */
.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 !important; /* Override .container default padding if it exists */
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  z-index: calc(var(--z-index-nav) + 2);
}

.navbar-logo img {
  height: 32px;
  width: auto;
}

.navbar-logo-text {
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: var(--font-size-xl);
  color: var(--color-neutral-100);
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, var(--color-accent-200));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(111, 211, 251, 0.3);
}

/* Desktop Menu */
.navbar-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.nav-item {
  position: relative;
}

/* Invisible bridge to prevent hover loss between nav item and mega menu */
.nav-item::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 25px; /* Covers the 18px gap to the mega menu */
  background: transparent;
  z-index: 10;
}

/* Premium Pill Highlight for Links */
.nav-link {
  color: var(--color-neutral-300);
  font-weight: 500;
  font-size: var(--font-size-sm);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: var(--spacing-1);
  position: relative;
  z-index: 1;
  transition: color var(--transition-fast);
  border-radius: 30px;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(46, 184, 230, 0.15), rgba(111, 211, 251, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.05);
  z-index: -1;
  opacity: 0;
  transform: scale(0.85);
  transition: all var(--transition-normal);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-neutral-100);
}

.nav-link:hover::before, .nav-link.active::before {
  opacity: 1;
  transform: scale(1);
}

.nav-link-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
  opacity: 0.7;
}

.nav-item:hover .nav-link-icon {
  transform: rotate(180deg);
  opacity: 1;
}

/* Mega Menu Dropdown */
.mega-menu {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(15px);
  width: auto;
  min-width: 320px;
  background: rgba(5, 8, 15, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-top: 2px solid #00f0ff;
  border-radius: 0; /* Aggressive sharp corners */
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  pointer-events: none;
}

/* Subtle arrow pointing up to menu */
.mega-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; 
  height: 0; 
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #00f0ff;
  background: transparent;
  box-shadow: none;
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.mega-menu-section h4 {
  font-size: 11px;
  color: var(--color-neutral-400);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  padding-left: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mega-menu-section h4::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(255,255,255,0.1), transparent);
}

.mega-menu-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-neutral-300);
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: var(--font-size-sm);
  background: transparent;
  position: relative;
  overflow: hidden;
}

.mega-menu-link::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, rgba(46, 184, 230, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.mega-menu-link > * {
  position: relative;
  z-index: 1;
}

.mega-menu-link:hover {
  color: #fff;
  transform: translateX(6px);
}

.mega-menu-link:hover::before {
  opacity: 1;
}

.mega-menu-link::after {
  content: '→';
  margin-left: auto;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  color: var(--color-accent-300);
}

.mega-menu-link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: var(--color-neutral-100);
  cursor: pointer;
  z-index: calc(var(--z-index-nav) + 2);
  padding: 8px;
  transition: all 0.2s;
}

.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-toggle svg {
  width: 20px;
  height: 20px;
}

.mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-neutral-100);
  margin: 4px 0;
  transition: all 0.3s ease;
}

/* Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-1);
  color: var(--color-neutral-300);
  font-weight: 500;
  font-size: var(--font-size-xs);
  padding: 8px 12px;
  border-radius: 20px;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.lang-btn:hover {
  color: var(--color-neutral-100);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(10, 14, 39, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: var(--spacing-2);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
  min-width: 120px;
}

.lang-switcher:hover .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 8px 12px;
  color: var(--color-neutral-400);
  font-size: var(--font-size-sm);
  border-radius: 8px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.lang-option:hover, .lang-option.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-accent-300);
}

/* Responsive */
@media (max-width: 1024px) {
  .navbar {
    top: 0;
    padding: 12px 16px;
  }

  .mega-menu {
    width: 100%;
    left: 0;
    transform: none !important;
    position: static;
    display: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: var(--spacing-4) 0;
  }
  
  .mega-menu::before {
    display: none;
  }
  
  .nav-item:hover .mega-menu {
    display: none;
  }
  
  .nav-item.active .mega-menu {
    display: grid;
    grid-template-columns: 1fr;
  }
  
  .mobile-toggle {
    display: block;
  }
  
  .navbar-actions {
    display: none;
  }
  
  .navbar-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; /* fallback */
    height: 100dvh;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: flex-start;
    padding: 100px var(--spacing-6) var(--spacing-6);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
    border-radius: 0; /* Cover full screen */
  }
  
  .navbar-menu.is-open {
    transform: translateX(0);
  }
  
  .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  
  .nav-link {
    width: 100%;
    justify-content: space-between;
    font-size: var(--font-size-lg);
    padding: 16px 0;
    border-radius: 0;
  }
  
  .nav-link::before {
    display: none;
  }
}

/* Hide mobile actions on desktop */
@media (min-width: 1025px) { .mobile-actions { display: none !important; } }

.navbar-actions .btn {
  background: transparent !important;
  color: #00f0ff !important;
  border: 1px solid #00f0ff !important;
  border-radius: 0 !important;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 10px 24px;
  box-shadow: inset 0 0 10px rgba(0,240,255,0.1);
  transition: all 0.3s ease;
}

.navbar-actions .btn:hover {
  background: rgba(0, 240, 255, 0.15) !important;
  box-shadow: inset 0 0 20px rgba(0,240,255,0.4), 0 0 20px rgba(0,240,255,0.4) !important;
  color: #fff !important;
}
