/* ========================================
   DROPDOWNS.CSS - Dropdown Menu Styles
   ======================================== */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: block;
  background-color: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background-color: var(--color-bg-elevated);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-sm) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s;
  z-index: var(--z-index-dropdown);
}

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

/* Show dropdown on hover with delay */
.navbar-item.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0.15s;
}

/* ===== DROPDOWN ITEMS ===== */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text);
  text-align: left;
  text-decoration: none;
  background-color: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color var(--transition-fast);
  outline: none;
}

.dropdown-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Remove default focus styles */
.dropdown-item:focus,
.dropdown-item:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Compact blue highlight background */
.dropdown-item::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0%;
  height: 60%;
  background-color: rgba(74, 198, 255, 0.15);
  border-radius: var(--radius-sm);
  transition: width 0.2s ease-out;
  z-index: -1;
}

.dropdown-item:hover::before {
  width: 85%;
}

.dropdown-item:hover {
  color: var(--color-primary);
}

/* Click flash effect - compact */
.dropdown-item:active::before {
  animation: flash-compact 0.3s ease-out;
}

.dropdown-item:active,
.dropdown-item:focus {
  color: var(--color-primary);
}

/* Compact blue flash animation */
@keyframes flash-compact {
  0% {
    width: 85%;
    background-color: rgba(74, 198, 255, 0.15);
  }
  50% {
    width: 70%;
    background-color: rgba(74, 198, 255, 0.4);
    box-shadow: 0 0 8px rgba(74, 198, 255, 0.3);
  }
  100% {
    width: 85%;
    background-color: rgba(74, 198, 255, 0.15);
  }
}

/* Divider */
.dropdown-divider {
  height: var(--border-width);
  background-color: var(--color-border);
  margin: var(--spacing-sm) 0;
}

/* Header */
.dropdown-header {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* ===== MOBILE CONSIDERATIONS ===== */
@media (max-width: 767px) {
  .dropdown-menu {
    position: static;
    min-width: 100%;
    box-shadow: none;
    border: none;
    border-top: var(--border-width) solid var(--color-border);
    border-radius: 0;
    margin-top: var(--spacing-sm);
    padding-left: var(--spacing-lg);
  }
}
