/* Zen Context Menu v2.0 by KiKaraage */

/* Hide all separators */
@media (-moz-bool-pref: "uc.hidecontext.separators") {
  menuseparator::before {
    border-top: none !important;
  }
  menuseparator {
    padding-block: 0px !important;
  }
}
/* Hide all icons (Won't work for extension & checkbox context menu options) */
@media (-moz-bool-pref: "uc.hidecontext.optionicons") {
  :not(:not(menubar) > menu, #ContentSelectDropdown)
    > menupopup
    > menuitem:not(
      .menuitem-iconic,
      [type="checkbox"],
      [type="radio"],
      .in-menulist,
      .in-menulist menuitem,
      .unified-nav-current
    ),
  :not(:not(menubar) > menu, #ContentSelectDropdown)
    > menupopup
    > menu:not(
      .menu-iconic,
      [type="checkbox"],
      [type="radio"],
      .in-menulist,
      .in-menulist menu,
      .unified-nav-current
    ),
  :not(:not(menubar) > menu, #ContentSelectDropdown) > menupopup > menucaption {
    padding-inline-start: var(
      --fp-contextmenu-menuicon-margin-inline
    ) !important;
  }
  :not(:not(menubar) > menu, #ContentSelectDropdown)
    > menupopup
    > menuitem:not(
      .menuitem-iconic,
      [type="checkbox"],
      [type="radio"],
      .in-menulist,
      .in-menulist menuitem,
      .unified-nav-current
    ),
  :not(:not(menubar) > menu, #ContentSelectDropdown)
    > menupopup
    > menu:not(
      .menu-iconic,
      [type="checkbox"],
      [type="radio"],
      .in-menulist,
      .in-menulist menu,
      .unified-nav-current
    ),
  #toggle_toolbar-menubar,
  #PanelUI-history toolbarbutton,
  #unified-extensions-context-menu menuitem {
    background-image: none !important;
  }
}
/* Apply Zen workspace colors to all context menu, panels, and confirmation pop-ups */
@media (-moz-bool-pref: "uc.fixcontext.applyzencolors") {
  menupopup, panel {
    --panel-background: var(--zen-main-browser-background) !important;
  }
  /* Fix text color on confirmation pop-ups when applying Zen colors on light mode */
  #confirmation-hint {
    --arrowpanel-color: var(--sidebar-text-color) !important;
  }
}
@media (-moz-bool-pref: "uc.fixcontext.extensionmargins") {
  /* Fix padding for extensions-related context menu on Windows */
  menu > .menu-iconic-text,
  menuitem > .menu-iconic-text {
    padding-inline-start: calc(
      var(--fp-contextmenu-menuicon-margin-inline) - 10px
    ) !important;
  }
  /* Fix padding for "Tabs on the right" & "Compact Mode" options on Windows */
  menuitem[checked="true"] > .menu-iconic-text {
    padding-inline-start: 10px !important;
  }
  #zen-toolbar-context-tabs-right {
    padding-inline-start: 34px !important;
  }
  #zen-toolbar-context-tabs-right[checked="true"] {
    padding-inline-start: 8px !important;
  }
  #zen-context-menu-compact-mode {
    padding-inline-start: calc(
      var(--fp-contextmenu-menuitem-padding-inline) + 18px +
        var(--fp-contextmenu-menuicon-margin-inline)
    ) !important;
  }
  #zen-context-menu-compact-mode-hide-sidebar,
  #zen-context-menu-compact-mode-hide-toolbar,
  #zen-context-menu-compact-mode-hide-both {
    padding-inline-start: 40px !important;
  }
  #zen-context-menu-compact-mode-hide-sidebar[checked="true"],
  #zen-context-menu-compact-mode-hide-toolbar[checked="true"],
  #zen-context-menu-compact-mode-hide-both[checked="true"] {
    padding-inline-start: 16px !important;
    & .menu-iconic-text {
      padding-inline-start: 2px !important;
    }
  }
}
/* Only use “Copy Link Without Site Tracking” */
@media (-moz-bool-pref: "uc.hidecontext.copylink") {
  #context-copylink {
    opacity: 0 !important;
    padding: 0 !important;
    height: 2px !important;
  }
  
  #context-copylink:hover {
    opacity: 1 !important;
    padding-block: 0.5em !important;
    padding-inline-start: calc( var(--fp-contextmenu-menuitem-padding-inline) + 16px + var(--fp-contextmenu-menuicon-margin-inline) ) !important;
    height: inherit !important;
  }
}
/* Hide "Menu Bar" toggle */
@media (-moz-bool-pref: "uc.hidecontext.menubar") {
  #toggle_toolbar-menubar {
    display: none !important;
  }
}
/* Hide "Bookmark Tab/Link” */
@media (-moz-bool-pref: "uc.hidecontext.bookmark") {
  #toolbar-context-bookmarkSelectedTab,
  #toolbar-context-bookmarkSelectedTabs,
  #context_bookmarkTab,
  #context-bookmarklink {
    display: none !important;
  }
}
/* Hide "Mute Tab" option */
@media (-moz-bool-pref: "uc.hidecontext.mutetab") {
  #context_toggleMuteTab,
  #context_toggleMuteSelectedTabs,
  #context_playTab,
  #context_playSelectedTabs {
    display: none !important;
  }
}
/* Hide "New Tab" options */
@media (-moz-bool-pref: "uc.hidecontext.newtab") {
  #context_openANewTab,
  #toolbar-context-openANewTab,
  #toolbarNavigatorItemsMenuSeparator {
    display: none !important;
  }
}
/* Hide 'Add to Web Panel' option" */
@media (-moz-bool-pref: "uc.hidecontext.addtowebpanel") {
  #context-zenAddToWebPanel {
    display: none !important;
  }
}
/* Hide "Move Tab" options */
@media (-moz-bool-pref: "uc.hidecontext.movetaboptions") {
  #context_moveTabOptions {
    display: none !important;
  }
}
/* Hide “Open Tab/Link in New Container Tab” */
@media (-moz-bool-pref: "uc.hidecontext.newcontainer") {
  #context_reopenInContainer,
  #context-openlinkinusercontext-menu {
    display: none !important;
  }
}
/* Hide “Send Tab/Link to Device” */
@media (-moz-bool-pref: "uc.hidecontext.sendtodevice") {
  #context_sendTabToDevice,
  #context-sendpagetodevice,
  #context-sendlinktodevice,
  #context-sep-sendlinktodevice {
    display: none !important;
  }
}
/* Hide close tab options (Close Tabs, Close Duplicate Tabs, Close Multiple Tabs) */
@media (-moz-bool-pref: "uc.hidecontext.closetab") {
  #context_closeTab,
  #context_closeDuplicateTabs,
  #context_closeTabOptions {
    display: none !important;
  }
}
/* Hide “Search Keywords" with your preferred search engine */
@media (-moz-bool-pref: "uc.hidecontext.search") {
  #context-searchselect {
    display: none !important;
  }
}
/* Hide “Search Keywords in a Private Window” */
@media (-moz-bool-pref: "uc.hidecontext.searchinpriv") {
  #context-searchselect-private {
    display: none !important;
  }
}
/* Hide Firefox's "Translate Selection/Link" options */
@media (-moz-bool-pref: "uc.hidecontext.translate") {
  #context-translate-selection,
  #frame-sep {
    display: none !important;
  }
}
/* Hide "Print Selection” */
@media (-moz-bool-pref: "uc.hidecontext.printselection") {
  #context-print-selection {
    display: none !important;
  }
}
/* Hide “Email Image”, “Set Image as Desktop Background”, and “View Image Info” options */
@media (-moz-bool-pref: "uc.hidecontext.image") {
  #context-sendimage,
  #context-sep-setbackground,
  #context-setDesktopBackground,
  #context-sep-sharing,
  #context-viewimageinfo {
    display: none !important;
  }
}
/* Hide "Check Spelling" and "Text/Page Direction" option while typing in text fields */
@media (-moz-bool-pref: "uc.hidecontext.checkspelling") {
  #spell-separator,
  #spell-check-enabled,
  #spell-add-dictionaries-main,
  #spell-dictionaries,
  #context-sep-bidi,
  #context-bidi-text-direction-toggle,
  #context-bidi-page-direction-toggle {
    display: none !important;
  }
}
/* Hide “Select All Text” option */
@media (-moz-bool-pref: "uc.hidecontext.selectalltext") {
  #context-selectall,
  #context-sep-selectall {
    display: none !important;
  }
}
/* Hide “Select All Tabs" option */
@media (-moz-bool-pref: "uc.hidecontext.selectalltabs") {
  #context_selectAllTabs,
  #context_selectedAllTabs,
  #toolbar-context-selectAllTabs {
    display: none !important;
  }
}
/* Hide “Reload Tab” option */
@media (-moz-bool-pref: "uc.hidecontext.reloadtab") {
  #context_reloadTab,
  #context_reloadSelectedTabs,
  #toolbar-context-reloadSelectedTab,
  #toolbar-context-reloadSelectedTabs {
    display: none !important;
  }
}
/* Hide "Duplicate Tab" */
@media (-moz-bool-pref: "uc.hidecontext.duplicatetab") {
  #context_duplicateTab,
  #context_duplicateTabs {
    display: none !important;
  }
}
/* Hide “Tab Unloader Actions” */
@media (-moz-bool-pref: "uc.hidecontext.unloadactions") {
  #context_zenTabActions {
    display: none !important;
  }
}
/* Hide “View Page Source”, "View Selection Source" and “Inspect” options */
@media (-moz-bool-pref: "uc.hidecontext.inspect") {
  #context-viewsource,
  #context-inspect-a11y,
  #context-inspect,
  #inspect-separator,
  #context-media-eme-separator,
  #context-viewpartialsource-selection {
    display: none !important;
  }
}
/* Hide “Save Page As and Save Link As” */
@media (-moz-bool-pref: "uc.hidecontext.savelink") {
  #context-savepage,
  #context-savelink {
    display: none !important;
  }
}
/* Hide "Take Screenshot" option */
@media (-moz-bool-pref: "uc.hidecontext.screenshot") {
  #context-take-screenshot,
  #context-sep-screenshots,
  #frame-sep {
    display: none !important;
  }
}
/* Hide "Pin Tab" and "Add to Essentials" options */
@media (-moz-bool-pref: "uc.hidecontext.pin") {
  #context_pinTab,
  #context_unpinTab,
  #context_pinSelectedTabs,
  #context_unpinSelectedTabs,
  #context_zen-add-essential,
  #context_zen-remove-essential {
    display: none !important;
  }
}
/* Hide "This Frame" option */
@media (-moz-bool-pref: "uc.hidecontext.frame") {
  #frame-sep, #frame {
    display: none !important;
  }
}
