
/* ── Dropdown Base ── */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.dropdown-arrow {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* ── Dropdown Panel ── */
.dropdown-content {
  position: absolute;
  top: calc(100% + 14px);
  left: -50%;
  transform: translateX(-50%) translateY(-8px);
  width: 300px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,0.07),
    0 20px 40px -8px rgba(0,0,0,0.15),
    0 0 0 1px rgba(0,0,0,0.05);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1),
    visibility 0.25s ease;
  z-index: 999;
}

/* Arrow tip */
.dropdown-content::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,0.05);
  border-left: 1px solid rgba(0,0,0,0.05);
  border-radius: 2px;
}

.dropdown.open .dropdown-content,
.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.dropdown-inner {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Dropdown Items ── */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  opacity: 0;
  transform: translateY(6px);
}

.dropdown.open .dropdown-item,
.dropdown:hover .dropdown-item {
  opacity: 1;
  transform: translateY(0);
  transition:
    background 0.2s ease,
    transform 0.25s cubic-bezier(0.34, 1.3, 0.64, 1) calc(var(--i) * 55ms + 60ms),
    opacity 0.25s ease calc(var(--i) * 55ms + 60ms);
}

.dropdown-item:hover {
  background: #f5f7ff;
  transform: translateX(4px) !important;
}

.item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef1ff 0%, #e8f0fe 100%);
  color: #4361ee;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.dropdown-item:hover .item-icon {
  background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
  color: #fff;
  transform: scale(1.08);
}

.item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-text strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.2;
}

.item-text small {
  font-size: 0.75rem;
  color: #888;
  font-weight: 400;
  line-height: 1.3;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .dropdown-content {
    position: static;
    width: 100%;
    transform: none !important;
    box-shadow: none;
    border-radius: 12px;
    background: #f8f9ff;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition:
      max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.25s ease,
      visibility 0.25s ease;
  }

  .dropdown-content::before {
    display: none;
  }

  .dropdown.open .dropdown-content {
    opacity: 1;
    visibility: visible;
    max-height: 400px;
    transform: none !important;
  }

  .dropdown-item {
    padding: 10px 12px;
  }

  .item-icon {
    width: 36px;
    height: 36px;
  }
}

.dropdown-content {
  top: calc(100% + 2px); /* reduce gap */
}

/* Invisible bridge between toggle and dropdown */
.dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 16px; /* covers the gap */
  background: transparent;
}