/**
 * Dropdown Navigation for Features/Guides/Comparisons
 * Clean, professional mega-menu style navigation
 */

/* Dropdown Container */
.nav-dropdown {
  position: relative;
}

/* Dropdown Button */
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-dropdown-toggle i {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.nav-dropdown.active .nav-dropdown-toggle i {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
  padding-top: 0.75rem;
  min-width: 240px;
  max-width: 280px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

/* Dropdown Menu Inner Container - for styling */
.nav-dropdown-menu::after {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: -1;
}

.nav-dropdown.active .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Dark mode dropdown background */
html.dark .nav-dropdown-menu::after {
  background: rgba(17, 24, 39, 0.98);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(129, 140, 248, 0.2);
}

/* Dropdown Link */
.nav-dropdown-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  margin: 0.125rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
  z-index: 1;
}

.nav-dropdown-link:hover {
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
  transform: translateX(2px);
}

html.dark .nav-dropdown-link {
  color: #e5e7eb;
}

html.dark .nav-dropdown-link:hover {
  background: rgba(129, 140, 248, 0.15);
  color: #c4b5fd;
}

/* Dropdown Link Icon */
.nav-dropdown-link i {
  width: 1.25rem;
  text-align: center;
  font-size: 0.9375rem;
  opacity: 0.7;
}

.nav-dropdown-link:hover i {
  opacity: 1;
}

/* Dropdown Divider */
.nav-dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0.5rem 0.25rem;
}

html.dark .nav-dropdown-divider {
  background: rgba(255, 255, 255, 0.1);
}

/* Dropdown Section Title */
.nav-dropdown-title {
  padding: 0.5rem 0.875rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9ca3af;
  opacity: 0.8;
}

html.dark .nav-dropdown-title {
  color: #9ca3af;
}

/* Mobile & Tablet: Hide dropdown (use mobile menu instead) */
@media (max-width: 767px) {
  .nav-dropdown-menu {
    display: none !important;
  }
  
  /* Keep toggle visible but non-functional on mobile */
  .nav-dropdown-toggle {
    pointer-events: none;
    opacity: 0.7;
  }
}

/* Tablet Landscape & Small Desktop */
@media (min-width: 768px) and (max-width: 1023px) {
  .nav-dropdown-menu {
    min-width: 220px;
    max-width: 260px;
  }
  
  .nav-dropdown-link {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Desktop: Hover behavior */
@media (min-width: 768px) {
  .nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  
  .nav-dropdown:hover .nav-dropdown-toggle i {
    transform: rotate(180deg);
  }
}

/* Large Desktop: Increase dropdown size */
@media (min-width: 1440px) {
  .nav-dropdown-menu {
    min-width: 260px;
    max-width: 300px;
  }
  
  .nav-dropdown-link {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
}

/* Accessibility: Focus states */
.nav-dropdown-link:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
  background: rgba(102, 126, 234, 0.08);
}

html.dark .nav-dropdown-link:focus {
  outline-color: #a78bfa;
  background: rgba(129, 140, 248, 0.15);
}
