/* ============================================================
   Dropdown — "more actions" (three dots) menu
   ============================================================ */

.dropdown {
  position: relative;
}

.dropdown__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.dropdown__trigger:hover {
  background-color: var(--color-surface-container);
  color: var(--color-primary);
}

.dropdown__menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: max-content;
  min-width: 9rem;
  margin-top: var(--space-1);
  padding: var(--space-2);
  background-color: var(--color-surface-container-lowest);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Inline variant for showing the menu in the design system, outside of an absolute positioned dropdown */
.dropdown__menu--static {
  position: static;
  margin-top: 0;
}

.dropdown__item {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--leading-sm);
  text-align: right;
  text-decoration: none;
  white-space: nowrap;
  color: var(--color-on-surface);
  cursor: pointer;
}

.dropdown__item--positive {
  color: var(--color-success);
}

.dropdown__item--danger {
  color: var(--color-error-focus);
}

.dropdown__form {
  width: 100%;
}

.dropdown__item:hover {
  background-color: var(--color-surface-container);
}

/* The destroy-with-confirmation partial renders its own button: restyle it as a menu item */
.dropdown__menu .form-submit--danger-outline {
  justify-content: flex-end;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--color-error-focus);
}

.dropdown__menu .form-submit--danger-outline:hover {
  filter: none;
  background-color: var(--color-surface-container);
}
