/* ========================================
   NAVIGATION STYLES
   ======================================== */

/* Desktop Navigation Header */
.desktop-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255, 248, 244, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(242, 138, 99, 0.1);
  z-index: 1000;
  display: none; /* Hide on mobile by default */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.desktop-nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.desktop-nav-logo {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--deep-blue);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0; /* Never shrink the logo */
}

.desktop-nav-logo img {
  height: 35px;
  width: auto;
}

.desktop-nav-links {
  display: flex;
  align-items: center;
  gap: 35px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto; /* Can grow and shrink as needed */
  justify-content: center;
  min-width: 0; /* Allow shrinking below content size */
}

.desktop-nav-links li {
  margin: 0;
}

.desktop-nav-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  position: relative;
}

.desktop-nav-links a:hover {
  color: var(--bright-orange);
}

.desktop-nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--bright-orange);
  transition: width 0.3s ease;
}

.desktop-nav-links a:hover::after {
  width: 100%;
}

.desktop-nav-cta {
  background: var(--bright-orange);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(242, 138, 99, 0.2);
  margin-left: 20px; /* Ensure minimum gap from nav items */
  flex-shrink: 0; /* Never shrink, always maintain full size */
}

.desktop-nav-cta:hover {
  background: var(--dark-orange);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(242, 138, 99, 0.3);
}

/* More Dropdown Styles */
.more-dropdown {
  position: relative;
}

.more-toggle {
  cursor: pointer;
  user-select: none;
  padding: 8px 0; /* Add padding for easier hover area */
  white-space: nowrap; /* Prevent arrow from wrapping below text */
}

/* Invisible bridge between button and menu to prevent jumpiness */
.more-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px; /* Bridge the gap */
  background: transparent;
  pointer-events: auto;
  z-index: 1000;
}

.more-menu {
  position: absolute;
  top: calc(100% + 8px); /* Small gap for visual separation */
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background: rgba(255, 248, 244, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(242, 138, 99, 0.15);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  padding: 8px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 1001;
  pointer-events: none; /* Prevent interaction when hidden */
}

.more-dropdown:hover .more-menu,
.more-dropdown.active .more-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto; /* Allow interaction when visible */
}

.more-menu li {
  margin: 0;
  padding: 0;
}

.more-menu a {
  display: block;
  padding: 12px 20px;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap; /* Prevent text wrapping */
}

.more-menu a:hover {
  background-color: rgba(242, 138, 99, 0.1);
  color: var(--bright-orange);
}

.more-menu a::after {
  display: none; /* Remove underline effect in dropdown */
}

html.dark-mode .more-menu {
  background: rgba(26, 26, 26, 0.98);
  border: 1px solid rgba(255, 154, 112, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

html.dark-mode .more-menu a {
  color: #e4e4e4;
}

html.dark-mode .more-menu a:hover {
  background-color: rgba(255, 154, 112, 0.15);
  color: #ff9a70;
}

/* ========================================
   MOBILE NAVIGATION (Hamburger & Side Nav)
   ======================================== */

/* Mobile Logo */
.mobile-nav-logo {
  position: absolute;
  top: 18px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--deep-blue);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-decoration: none;
  z-index: 2001;
}

.mobile-nav-logo img {
  height: 30px;
  width: auto;
}

/* Hamburger Icon */
.hamburger-container {
  position: absolute;
  top: 24px;
  right: 25px;
  width: 30px;
  height: 24px;
  z-index: 2001;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.hamburger-bar {
  height: 4px;
  width: 100%;
  background-color: var(--deep-blue);
  border-radius: 2px;
}

/* Slide-Out Nav */
.side-nav {
  position: fixed;
  top: 24px;
  right: -200px;
  width: 180px;
  max-height: 90vh;
  height: auto;
  background: linear-gradient(145deg, #fef7f3, #fff2e3);
  box-shadow: -6px 8px 24px rgba(0, 0, 0, 0.08);
  padding: 40px 20px;
  transition: right 0.3s ease;
  z-index: 2000;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  height: 100%;
}

.side-nav li {
  width: 100%;
  text-align: left;
}

.side-nav a {
  display: block;
  width: 100%;
  padding: 8px 0;
  font-weight: bold;
  color: var(--dark-orange);
  text-decoration: none;
  transition: color 0.2s ease;
}

.side-nav a:hover {
  color: var(--bright-orange);
}

/* Active Toggle Class */
.nav-open .side-nav {
  right: 0;
}

.nav-open .hamburger-container {
  transform: translateX(-180px);
}

@media (max-width: 400px) {
  .side-nav {
    width: 155px;
    right: -185px;
  }

  .nav-open .hamburger-container {
    transform: translateX(-155px);
  }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Show desktop nav on larger screens */
@media (max-width: 900px) {
  .footer-demo-group {
    display: none;
  }
}

@media (max-width: 768px) {
  #sideNav li:has(a.scroll-to-demo) {
    display: none;
  }
}

@media (min-width: 769px) {
  .desktop-nav {
    display: block;
  }
  
  /* Hide hamburger, side nav, and mobile logo on desktop */
  .hamburger-container,
  .side-nav,
  .mobile-nav-logo {
    display: none;
  }
  
  /* Adjust hero section for fixed nav */
  .hero {
    padding-top: 70px;
  }
  
  /* Adjust beta icon for desktop nav */
  .beta-icon {
    top: 85px; /* Below the desktop nav */
  }
}

/* Responsive adjustments for medium screens */
@media (min-width: 769px) and (max-width: 1030px) {
  .desktop-nav-container {
    gap: 25px; /* Reduce gap slightly on medium screens */
  }
  
  .desktop-nav-links {
    gap: 25px; /* Reduce gap between nav items */
  }
  
  /* Ensure More dropdown is visible and properly positioned */
  .more-dropdown {
    margin-left: auto; /* Push to the end of centered items */
  }
}

/* ========================================
   DARK MODE NAVIGATION STYLES
   ======================================== */
html.dark-mode .desktop-nav {
  background: rgba(26, 26, 26, 0.95);
  border-bottom: 1px solid rgba(255, 154, 112, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

html.dark-mode .desktop-nav-links a {
  color: #e4e4e4;
}

html.dark-mode .desktop-nav-links a:hover {
  color: #ff9a70;
}

html.dark-mode .side-nav {
  background-color: #1a1a1a;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.5);
}

html.dark-mode .side-nav a {
  color: #e4e4e4;
}

html.dark-mode .side-nav a:hover {
  background-color: #2a2a2a;
  color: #ff9a70;
}
