@use "../../abstracts/variables" as *;
@use "../../abstracts/mixins" as *;

.context-menu {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--background-color);
  backdrop-filter: blur(50px);
  color: var(--text-button-color);
  box-shadow: var(--box-shadow-light);
  border-radius: 10px;
  z-index: 1000;
  min-width: 200px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;

  .menuItem {
    position: relative;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    .submenu {
      display: none;
      min-width: 178px;
      position: absolute;
      top: 0;
      left: 100%; // place directly beside

      background: var(--background-color);
      backdrop-filter: blur(50px);
      color: var(--text-button-color);
      box-shadow: var(--box-shadow-light);
      padding: 4px;
      border-radius: 6px;
      z-index: 1000;
    }
    .value {
      display: flex;
    }
    .button {
      display: flex;
      gap: 6px;
      padding: 5px 8px;
      width: 100%;
      border-radius: 10px;
      &:hover {
        color: var(--text-button-color);
        background-color: var(--background-color-button);
      }
    }
    .button.delete {
      &:hover {
        background-color: #e02e16;
      }
    }
    .button.more {
      justify-content: space-between;
    }

    .shortcut {
      position: absolute;
      right: 8px;
      top: 6px;
      pointer-events: none;
    }

    // Keep submenu open while hovering parent OR submenu
    &:hover .submenu,
    .submenu:hover {
      display: block;
    }
  }
}
