/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

.react-contextmenu {
  z-index: 4; /* needs to be on a higher level than .overflowEdgeIndicatorEdge */
  display: none;
  min-width: 160px;
  max-width: 600px;
  padding: 5px 0;
  border-radius: 3px;
  margin: 2px 0 0;
  background-color: #fff;
  box-shadow:
    0 0 0 0.5px rgb(0 0 0 / 0.1),
    0 10px 12px rgb(0 0 0 / 0.3);
  color: #000;
  font-size: 12px;
  text-align: left;
  user-select: none;
}

.react-contextmenu-separator {
  border-bottom: 1px solid #ddd;
  margin: 6px 0;
}

/* max-height for context menus in the panel changed to 90vh for better zoom experience  */
.react-contextmenu.react-contextmenu--visible {
  display: block;
  max-height: 90vh;
}

.react-contextmenu-item:not(.react-contextmenu-submenu) {
  display: flex;
  overflow: hidden;
  align-items: center;
  padding: 2px 12px;
  cursor: default;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.react-contextmenu-item.react-contextmenu-item--active,
.react-contextmenu-item--selected {
  border-color: var(--blue-60);
  background-color: var(--blue-60);
  color: #fff;
  text-decoration: none;
}

.react-contextmenu-item.react-contextmenu-item--disabled,
.react-contextmenu-item.react-contextmenu-item--disabled:hover {
  background-color: transparent;
  color: #888;
}

.react-contextmenu-item--divider {
  padding: 2px 0;
  border-bottom: 1px solid rgb(0 0 0 / 0.15);
  margin-bottom: 3px;
}

/* Submenu arrow */
.react-contextmenu-item.react-contextmenu-submenu
  > .react-contextmenu-item::after {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-left-color: #000;
  content: '';
}

/* Submenu arrow highlighted color */
.react-contextmenu-item:hover.react-contextmenu-submenu
  > .react-contextmenu-item::after,
.react-contextmenu-item.react-contextmenu-submenu
  > .react-contextmenu-item--active::after {
  border-left-color: highlighttext;
}

.react-contextmenu-item.checkable {
  position: relative;
  padding-right: 21px;
}

.react-contextmenu-item.indented {
  padding-left: 35px;
}

.react-contextmenu-item.checked:not(.react-contextmenu-item--disabled)::before {
  position: absolute;
  top: 6px;
  right: 8px;
  display: block;
  width: 3px;
  height: 6px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  content: '';
  transform: rotate(45deg);
}

.react-contextmenu-item.react-contextmenu-item--active.checked,
.react-contextmenu-item--selected.checked {
  border-color: #fff;
}

.react-contextmenu-item--disabled.react-contextmenu-item--selected {
  background-color: var(--blue-50-a30);
}

.react-contextmenu-item--selected.checked:not(
    .react-contextmenu-item--disabled
  )::before {
  /* Invert the colors of the checkmark when selected */
  border-color: #fff;
}

/* Use this wrapper for a content that needs to take the available space or if
 * it contains other HTML elements (eg <strong>) */
.react-contextmenu-item-content {
  overflow: hidden;
  min-width: 0;
  flex: 1;
  text-overflow: ellipsis;
}

/* Use a span with this class to add an icon to an item. */
.react-contextmenu-icon {
  width: 16px;
  height: 16px;
  flex: none;
  background: center no-repeat;
  margin-inline-end: 8px;
  pointer-events: auto;
}

/* Soften a bit the style of highlighted words */
.react-contextmenu-item > strong {
  color: #38383d;
}

.react-contextmenu-item--selected > strong {
  color: #fff;
}

@media (forced-colors: active) {
  .react-contextmenu {
    border: 1px solid CanvasText;
  }

  .react-contextmenu-item:not(.react-contextmenu-item--disabled):hover {
    background-color: SelectedItem;
    color: SelectedItemText;
  }

  .react-contextmenu-item.react-contextmenu-item--disabled,
  .react-contextmenu-item.react-contextmenu-item--disabled:hover {
    color: GrayText;
  }
}
