/* Popup menus and context menus */

@import "popups-contents.css";
@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

/* Style menus */
menupopup {
	-moz-appearance: none !important;
	background: var(--gnome-menu-background) !important;
	border: 1px solid var(--gnome-menu-border-color) !important;
	border-radius: 8px !important;
	padding: 4px 0 !important;
	color: var(--gnome-toolbar-color) !important;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}

menupopup menupopup {
	margin: -5px 0 0 -4px;
}

menubar>menu>menupopup {
	border-top-left-radius: 0 !important;
	border-top-right-radius: 0 !important;
}

menuitem,
menupopup menu {
	-moz-appearance: none !important;
	padding: 4px 8px !important;
}

menuitem[type="checkbox"] image,
menuitem[type="radio"] image {
	visibility: visible !important;
}

menuitem[disabled="true"]:hover,
menupopup menu[disabled="true"]:hover {
	background: transparent !important;
}

/* Adjust popovers position, includes background colour with transparency */
panel[type=arrow] {
	margin-top: 9px !important;
	max-height: 80vh !important;
	--panel-background: var(--gnome-popover-background) !important;
	font:inherit !important;
}

/* Style popovers */
.panel-arrowcontent .panel-arrowcontent,
.panel-header,
.PanelUI-subView,
.panel-subview-body,
#widget-overflow-mainView,
#protections-popup-footer,
panelview {
	border: 0 !important;
	background: transparent !important;
}

.panel-arrowcontent {
	--panel-background: var(--gnome-popover-background) !important;
	font:inherit !important;
	border-color: var(--gnome-popover-border-color) !important;
	border-radius: 9px !important;
	/* box-shadow: var(--gnome-popover-shadow) !important; */
	padding: 12px !important;
	color: var(--gnome-toolbar-color) !important;
}

.panel-arrow {
	fill: var(--gnome-popover-background) !important;
	stroke: var(--gnome-popover-border-color) !important;
}

.PanelUI-subView toolbarseparator:not([orient="vertical"]) {
	margin: 10px 2px !important;
}

.panel-header {
	padding: 10px 0 10px 0 !important;
}

.panel-footer {
	background-color: transparent !important;
	display: flex;
	justify-content: flex-end;
	padding-top: 0px !important;
}

.panel-footer toolbarseparator {
	display: none !important;
}

.panel-subview-body {
	padding: 0 !important;
}

.panel-subview-footer {
	margin-top: 10px !important;
}

/* Style popovers menu buttons */
.subviewbutton:not(.subviewbutton-back),
.toolbarbutton-1,
.protections-popup-category,
.protections-popup-category[disabled],
.identity-popup-content-blocking-category {
	border-radius: 8px !important;
	color: var(--gnome-toolbar-color) !important;
	font: menu !important;
}

.subviewbutton:not(.subviewbutton-back),
.protections-popup-category,
.identity-popup-content-blocking-category {
	padding: 5px !important;
}

.subviewbutton[disabled],
.toolbarbutton-1[disabled],
.identity-popup-content-blocking-category[disabled] {
	opacity: 0.5 !important;
	color: var(--gnome-inactive-toolbar-color) !important;
	background: none !important;
}

.subviewbutton[shortcut]:after {
	opacity: 0.5 !important;
}

.subviewbutton:not([disabled]):hover,
.toolbarbutton-1:not([disabled]):hover,
.protections-popup-category:not([disabled]):hover,
.identity-popup-content-blocking-category:not([disabled]):hover {
	background: var(--gnome-popover-button-hover-background) !important;
}

/* Style popover separators */
toolbarseparator,
menuseparator {
	border-color: var(--gnome-popover-separator-color) !important;
}

toolbarseparator:not([orient="vertical"]) {
	margin: 8px 0 !important;
}

toolbarseparator[orient="vertical"] {
	margin: 0 3px !important;
}
#contentAreaContextMenu menuitem image,
#contentAreaContextMenu menu image {
	visibility: visible !important;
}
/* Webchat e.g. google meet share screen display select*/
#webRTC-selectWindow-menulist{
	color: var(--gnome-inactive-urlbar-color) !important;
	background: var(--gnome-button-hover-background) !important;
	border-radius: 5px;
}
/* Proton right click menu*/
@media (-moz-proton) {
	#context-navigation>.menuitem-iconic[_moz-menuactive="true"]:not([disabled="true"])>.menu-iconic-left>.menu-iconic-icon {
		background-color: transparent !important;
	}
}

/* fix padding for menu items*/
#appMenu-popup panelview,
#PanelUI-fxa {
	padding: 8px !important;
}
/* fix menu button padding and alignment*/
#PanelUI-menu-button {
	padding-inline-end: 0px !important;
	padding-left: 0px !important;
}
/* Fix alignment of menu*/
panel[type="arrow"][side="top"],
panel[type="arrow"][side="bottom"] {
	margin-inline: -20px !important;
}

/* Fix bookmarks v92 */
menuseparator {
	-moz-appearance: none !important;
	padding-top: 0px !important;
	padding-bottom: 0px !important;
	margin-top: 3px !important;
	margin-bottom: 2px !important;
}
menupopup>menuitem,
menupopup>menu {
	padding-block: 2px !important;
	min-height: unset !important;
}
#PlacesToolbar menupopup,
#PlacesToolbar menu:not([disabled], :active) {
	--arrowpanel-background: transparent !important;
	--arrowpanel-border-radius: 0px !important;
}
#PlacesToolbar menu:[_moz-menuactive],
#PlacesToolbar menu:active,
toolbarbutton.bookmark-item[open="true"] {
	background-color: var(--gnome-button-active-background) !important;
}
.bookmark-item:hover {
	background-color: var(--gnome-popover-button-hover-background) !important;

}
#PlacesToolbar menuitem:hover{
	color: var(--gnome-button-menulist-color) !important;
} 

#PlacesToolbar menupopup[placespopup="true"] {
    border: none !important;
}
#PlacesToolbar menupopup[placespopup="true"]::part(arrowscrollbox) {
    background: transparent !important;
}
.menupopup-arrowscrollbox{
	background: transparent !important;
	border: 0 !important;
}

/* Update close button styling */
:root[dialogroot], :host(dialog) {
	--in-content-page-background: var(--gnome-menu-background) !important;
  }
  /* Cancel or secondary */
  .dialog-button-box>button{
	background-color: var(--gnome-button-active-background-alt) !important;
	color: var(--gnome-button-menulist-color) !important;
	border: 1px solid var(--gnome-button-active-background-alt-border);
  }
  xul|button:not([disabled="true"]):hover{
  	background-color: var(--gnome-button-active-background-alt-hover) !important;
	color: var(--gnome-button-menulist-color) !important;
	border: 1px solid var(--gnome-button-active-background-alt-border);
	border-color: var(--gnome-button-active-border-color) !important;
  }
  /* Quit or primary button */
  xul|button[default]{
	background-color: var(--gnome-button-suggested-action-background) !important;
	color: var(--gnome-button-menulist-color) !important;
	border-color: var(--gnome-button-suggested-action-border-color) !important;
  }
  xul|button[default]:not([disabled="true"]):hover{
	background-color: var(--gnome-button-suggested-action-hover-background) !important;
	color: var(--gnome-button-menulist-color) !important;
	border-color: var(--gnome-button-suggested-action-border-color) !important;
  }
  button:focus-visible{
	outline: 2px solid var(--theme-primary-color) !important;
  }
/*  checkbox */
.checkbox-check[checked]{
	background-color: var(--theme-primary-color) !important;
	color: var(--theme-alt-color) !important;
}
  checkbox:not([disabled="true"]):hover > .checkbox-check[checked] {
	background-color: var(--gnome-switch-active-background, color-mix(in srgb, currentColor 12.5%, var(--theme-primary-color))) !important;
  }
browser[primary="true"][tabDialogShowing="true"],
#main-window[window-modal-open="true"] > body > #browser{
  filter: blur(5px)
}