.dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color 0.2s ease;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 200px;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
              0 4px 6px -2px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, 
              visibility 0.2s ease, 
              transform 0.2s ease;
  pointer-events: none;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu.hide {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
}

.dropdown-menu.wide {
  min-width: 600px;
  max-width: 900px;
}

.dropdown-menu ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

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

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: #4b5563;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background-color: #eff6ff;
  color: #2563eb;
}

.dropdown-menu a:focus {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

.dropdown-menu .dropdown-header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.5rem;
}

.dropdown-menu .dropdown-divider {
  border-top: 1px solid #e5e7eb;
  margin: 0.5rem 0;
}

.dropdown-menu .dropdown-highlight {
  color: #2563eb;
  font-weight: 600;
}

.dropdown-menu .dropdown-highlight:hover {
  background-color: #dbeafe;
}

@media (max-width: 767px) {
  /* Hide desktop dropdown menus on mobile */
  .dropdown .dropdown-menu {
    display: none !important;
  }

  /* Mobile menu styling */
  .mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 50;
    max-height: 100vh;
    background-color: white;
    display: none;
  }

  /* Mobile menu visible state */
  .mobile-menu.show {
    display: block;
  }

  /* Mobile submenu styling */
  .mobile-submenu {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
  }

  .mobile-submenu.show {
    display: block;
    max-height: 2000px;
    opacity: 1;
  }

  /* Mobile menu backdrop */
  .mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    display: none;
  }

  .mobile-menu-backdrop.show {
    display: block;
  }
}

.dropdown-arrow {
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}

.dropdown-trigger:hover .dropdown-arrow,
.dropdown-trigger:focus .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
}

.dropdown-menu.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.dropdown-menu .grid-column {
  padding: 0;
}

.dropdown-menu .grid-column h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.dropdown-menu .grid-column ul {
  padding: 0;
}

.dropdown-menu .grid-column a {
  padding: 0.5rem 0;
  white-space: normal;
}
