/* Buttons */
@import "buttons-fixes.css";
@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

/* Hide buttons separator */
#nav-bar .toolbaritem-combined-buttons separator {
	display: none !important;
}

#appMenu-popup .toolbaritem-combined-buttons toolbarseparator {
	border: 0 !important;
}

/* Buttons */
/*#nav-bar toolbarbutton:not(#urlbar-zoom-button),*/
.subviewbutton.panel-subview-footer,
.panel-footer button,
#downloadsHistory,
#downloadsPanel-mainView .download-state .downloadButton,
#appMenu-popup .panel-banner-item,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton:not(#appMenu-fxa-label),
.subviewbutton-back:not(#hack),
#context-navigation menuitem,
.identity-popup-preferences-button:not(#hack),
.findbar-container toolbarbutton,
#sidebar-switcher-target,
#viewButton,
.close-icon:not(.tab-close-button),
button.close:not(.ghost-button),
.menulist-label-box,
.expander-down, .expander-up,
.notification-button,
#identity-popup-security-expander,
#protections-popup-info-button,
#PanelUI-panic-view-button,
.tracking-protection-button,
.dialog-button,
.autocomplete-richlistitem[type="loginsFooter"],
.dialog-button-box button,
.searchbar-engine-one-off-item,
.permission-popup-permission-remove-button,
.button.connect-device,
#item-choose button,
#editBMPanel_newFolderButton,
button.customizationmode-button {
	-moz-appearance: none !important;
	background-image: var(--gnome-button-background) !important;
	background-color: transparent !important;
	box-shadow: var(--gnome-button-box-shadow) !important;
	border: 1px solid var(--gnome-button-border-color) !important;
	border-bottom-color: var(--gnome-button-border-bottom-color) !important;
	border-radius: 8px !important;
	padding: 0 4px !important;
	height: 28px !important;
	max-height: 28px !important;
	min-height: 28px !important;
	min-width: 28px !important;
	color: var(--gnome-toolbar-color) !important;
	background-clip: padding-box;
	transition: all 200ms;
}

.permission-popup-permission-remove-button {
	padding: 2px 4px !important;
	align-items: center !important;
}

menulist {
	-moz-appearance: none !important;
	background-image: var(--gnome-button-background) !important;
	background-color: transparent !important;
	background-clip: padding-box;
	box-shadow: var(--gnome-button-box-shadow) !important;
	border: 1px solid var(--gnome-button-border-color) !important;
	border-bottom-color: var(--gnome-button-border-bottom-color) !important;
	border-radius: 8px !important;
	color: var(--gnome-toolbar-color) !important;
}

xul|menulist {
	padding: 0 10px !important;
	min-height: 28px !important;
}

/* Text buttons */
.subviewbutton.panel-subview-footer,
.panel-footer button,
#downloadsHistory,
#overflowMenu-customize-button,
#appMenu-popup .panel-banner-item,
#appMenu-zoomReset-button:not(#appMenu-fxa-label):not(#hack),
#appMenu-popup #appMenu-zoomReset-button2:not(#hack),
#tracking-protection-preferences-button:not(#hack),
.findbar-container toolbarbutton.findbar-button,
.notification-button,
.protections-popup-footer-button,
#PanelUI-panic-view-button,
.tracking-protection-button,
.dialog-button,
.autocomplete-richlistitem[type="loginsFooter"],
.dialog-button-box button,
.toolbaritem-combined-buttons:is(:not([cui-areatype="toolbar"]),
[overflowedItem="true"]) > #appMenu-fxa-label2:not(#hack),
.button.connect-device,
#item-choose button,
#editBMPanel_newFolderButton,
button.customizationmode-button {
	padding: 2px 10px !important;
	text-align: center !important;
}

.subviewbutton.panel-subview-footer label {
	text-align: center !important;
}

/* Drop down buttons */
#sidebar-switcher-target,
#viewButton {
	padding: 2px 16px !important;
	position: relative;
}
#sidebar-switcher-arrow,
#viewButton .button-menu-dropmarker { /* Arrow position, type b */
	transform: translate(6px, 0)
}
.menulist-label-box {
	padding: 2px 26px 2px 16px !important;
	position: relative;
}
.menulist-label-box:after { /* Arrow position */
	position: absolute !important;
	right: 8px !important;
	top: 8px !important;
}
.menulist-label-box:after { /* Create arrow if icon tag no exist */
	content: "";
}

/* Hover buttons */
menulist:hover,
/*#nav-bar toolbarbutton:not(#urlbar-zoom-button):not([open]):not([disabled]):not([checked]):hover,*/
.subviewbutton.panel-subview-footer:hover,
.panel-footer button:hover,
#downloadsHistory:hover,
#downloadsPanel-mainView .download-state .downloadButton:hover,
#overflowMenu-customize-button:hover,
#appMenu-popup .panel-banner-item:hover,
.subviewbutton-back:not(#hack):hover,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton:not(#appMenu-fxa-label):not([disabled]):hover,
#context-navigation menuitem:not([disabled]):hover,
.identity-popup-preferences-button:not(#hack):hover,
.findbar-container toolbarbutton:hover,
.findbar-closebutton .toolbarbutton-icon:hover,
#sidebar-switcher-target:hover,
#viewButton:hover,
.close-icon:not(.tab-close-button):hover,
button.close:not(.ghost-button):hover,
menulist:hover .menulist-label-box,
.expander-down:hover, .expander-up:hover,
.notification-button:hover,
.protections-popup-footer-button:hover,
#identity-popup-security-expander:hover,
#protections-popup-info-button:hover,
.tracking-protection-button:hover,
.dialog-button:hover,
.autocomplete-richlistitem[type="loginsFooter"]:hover,
.dialog-button-box button:hover,
.searchbar-engine-one-off-item:hover,
.permission-popup-permission-remove-button:hover,
button.customizationmode-button:hover {
	outline: 0 !important;
	background-image: var(--gnome-button-hover-background) !important;
	background-color: transparent !important;
}

/* Active buttons */
menulist[open],
/*#nav-bar toolbarbutton:not(#urlbar-zoom-button):not([disabled]):not(#hack):active,*/
/*#nav-bar toolbarbutton:not(#urlbar-zoom-button):not([disabled])[open],*/
/*#nav-bar toolbarbutton:not(#urlbar-zoom-button):not([disabled])[checked],*/
.subviewbutton.panel-subview-footer:active,
.panel-footer button:active,
#downloadsHistory:active,
#downloadsPanel-mainView .download-state .downloadButton:active,
#overflowMenu-customize-button:active,
#appMenu-popup .panel-banner-item:active,
.subviewbutton-back:not(#hack):active,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton:not([disabled]):not(#appMenu-fxa-label):active,
#context-navigation menuitem:active:not([disabled]),
.identity-popup-preferences-button:not(#hack):active,
.findbar-container toolbarbutton[checked],
.findbar-container toolbarbutton:active,
#sidebar-switcher-target:active, #sidebar-switcher-target.active,
#viewButton[open],
.close-icon:not(.tab-close-button):active,
button.close:not(.ghost-button):active,
menulist[open] .menulist-label-box,
.expander-down:active, .expander-up:active,
.notification-button:active,
.protections-popup-footer-button:not(#hack):active,
#identity-popup-security-expander:active,
#protections-popup-info-button:not(#hack):active,
#protections-popup-info-button:not(#hack)[checked],
.tracking-protection-button:active,
.dialog-button:active,
.autocomplete-richlistitem[type="loginsFooter"]:active,
.dialog-button-box button:active,
.permission-popup-permission-remove-button:active,
button.customizationmode-button:active {
	background-image: var(--gnome-button-active-background) !important;
	background-color: transparent !important;
	box-shadow: var(--gnome-button-active-box-shadow) !important;
	border-color: var(--gnome-button-active-border-color) !important;
}

/* Disabled buttons */
/*#nav-bar toolbarbutton:not(#urlbar-zoom-button)[disabled],*/
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton[disabled],
#context-navigation menuitem[disabled],
button.customizationmode-button[disabled] {
	background-image: var(--gnome-button-disabled-background) !important;
	background-color: transparent !important;
	border-color: var(--gnome-button-disabled-border-color) !important;
	box-shadow: var(--gnome-button-disabled-box-shadow) !important;
	opacity: 1 !important;
}

#nav-bar toolbarbutton:not(#urlbar-zoom-button)[disabled] image,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton[disabled] image,
#context-navigation menuitem[disabled] image {
	opacity: .4 !important;
}

#nav-bar toolbarbutton:not(#urlbar-zoom-button)[disabled]:hover,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton[disabled]:hover {
	background: none !important;
}

/* Inactive window buttons */
/*#nav-bar toolbarbutton:not(#urlbar-zoom-button):-moz-window-inactive,*/
.findbar-container toolbarbutton:-moz-window-inactive,
#sidebar-switcher-target:-moz-window-inactive,
#viewButton:-moz-window-inactive,
.notification-button:-moz-window-inactive {
	background-image: var(--gnome-inactive-button-background) !important;
	background-color: transparent !important;
	box-shadow: var(--gnome-inactive-button-box-shadow) !important;
	border-color: var(--gnome-inactive-button-border-color) !important;
}

/* Flat buttons */
.subviewbutton-back:not(#hack),
.close-icon:not(.tab-close-button),
button.close:not(.ghost-button),
#protections-popup-info-button,
.permission-popup-permission-remove-button {
	background: none !important;
	box-shadow: none !important;
	border-color: transparent !important;
	border-radius: 8px !important;
	border: none !important;
}

.subviewbutton-back:not(#hack):not(:active):hover,
.close-icon:not(.tab-close-button):not(:active):hover,
button.close:not(.ghost-button):not(:active):hover,
#protections-popup-info-button:hover,
.permission-popup-permission-remove-button:not(:active):hover {
	background-color: var(--gnome-headerbar-button-hover-background) !important;
	background-image: none !important;
	box-shadow: none !important;
	border-color: var(--gnome-button-border-color) !important;
	border-bottom-color: var(--gnome-button-border-bottom-color) !important;
}

.subviewbutton-back:not(#hack):active,
.close-icon:not(.tab-close-button):active,
button.close:not(.ghost-button):active,
#protections-popup-info-button:active,
.permission-popup-permission-remove-button:active {
	box-shadow: none !important;
	background-color: var(--gnome-headerbar-button-active-background) !important;
	background-image: none !important;
}

button.close,
.close-icon:not(.tab-close-button) {
	box-shadow: none !important;
	border: none !important;
	border-radius: 100% !important;
}

/* Circle buttons */
#downloadsPanel-mainView .download-state .downloadButton,
.identity-popup-permission-remove-button:not(#hack) {
	padding: 0 0 !important;
	height: 32px !important;
	width: 32px !important;
	min-height: 32px !important;
	min-width: 32px !important;
	border-radius: 100% !important;
}

/* Combined buttons */
#nav-bar .toolbaritem-combined-buttons:not(.unified-extensions-item) toolbarbutton:not(:last-of-type):not(#hack),
#appMenu-popup .toolbaritem-combined-buttons:not(.unified-extensions-item) toolbarbutton:not(:last-of-type):not(#appMenu-zoomEnlarge-button),
#context-navigation menuitem:not(:last-of-type),
.findbar-container toolbarbutton.findbar-find-previous,
.findbar-button:not(:last-of-type) {
	border-top-right-radius: 0 !important;
	border-bottom-right-radius: 0 !important;
	border-right-width: 1px !important;
	margin-right: 0 !important;
}

#nav-bar .toolbaritem-combined-buttons:not(.unified-extensions-item) toolbarbutton:not(:first-of-type):not(#hack),
#appMenu-popup .toolbaritem-combined-buttons:not(.unified-extensions-item) toolbarbutton:not(:first-of-type):not(#appMenu-fullscreen-button),
#context-navigation menuitem:not(:first-of-type),
.findbar-container toolbarbutton.findbar-find-previous,
.findbar-container toolbarbutton.findbar-find-next,
.findbar-button:not(:first-of-type) {
	border-top-left-radius: 0 !important;
	border-bottom-left-radius: 0 !important;
	border-left-width: 0 !important;
	margin-left: 0 !important;
}

/* Buttons with suggested action */
xul|button[default], button.primary,
.dialog-button-box button[default="true"],
#appMenu-popup .panel-banner-item[notificationid="update-restart"],
button.popup-notification-primary-button,
#editBookmarkPanelDoneButton,
#tracking-action-block {
	color: white !important;
	background-image: var(--gnome-button-suggested-action-background) !important;
	background-color: transparent !important;
	border-color: var(--gnome-button-suggested-action-border-color) !important;
	border-bottom-color: var(--gnome-button-suggested-action-border-bottom-color) !important;
	box-shadow: var(--gnome-button-suggested-action-box-shadow) !important;
	text-shadow: 0 -1px rgba(0, 0, 0, 0.5) !important;
}

xul|button[default]:hover, button.primary:hover,
.dialog-button-box button[default="true"]:hover,
#appMenu-popup .panel-banner-item[notificationid="update-restart"]:hover,
button.popup-notification-primary-button:hover,
#editBookmarkPanelDoneButton:hover {
	background-image: var(--gnome-button-suggested-action-hover-background) !important;
	background-color: transparent !important;
}

xul|button[default]:active, button.primary:active,
.dialog-button-box button[default="true"]:active,
#appMenu-popup .panel-banner-item[notificationid="update-restart"]:active,
button.popup-notification-primary-button:active,
#editBookmarkPanelDoneButton:active {
	background-image: var(--gnome-button-suggested-action-active-background) !important;
	background-color: transparent !important;
	border-color: var(--gnome-button-suggested-action-active-border-color) !important;
	box-shadow: var(--gnome-button-suggested-action-active-box-shadow) !important;
	text-shadow: none !important;
	transition: none !important;
}

/* Buttons with destructive action */
#editBookmarkPanelRemoveButton,
.identity-popup-permission-remove-button,
#PanelUI-panic-view-button {
	color: white !important;
	background-image: var(--gnome-button-destructive-action-background) !important;
	background-color: transparent !important;
	border-color: var(--gnome-button-destructive-action-border-color) !important;
	border-bottom-color: var(--gnome-button-destructive-action-border-bottom-color) !important;
	box-shadow: var(--gnome-button-destructive-action-box-shadow) !important;
	text-shadow: 0 -1px rgba(0, 0, 0, 0.5) !important;
}

#editBookmarkPanelRemoveButton:hover,
.identity-popup-permission-remove-button:not(#hack):hover,
#PanelUI-panic-view-button:hover {
	background-image: var(--gnome-button-destructive-action-hover-background) !important;
	background-color: transparent !important;
}

#editBookmarkPanelRemoveButton:active,
.identity-popup-permission-remove-button:not(#hack):active,
#PanelUI-panic-view-button:active {
	background-image: var(--gnome-button-destructive-action-active-background) !important;
	background-color: transparent !important;
	border-color: var(--gnome-button-destructive-action-active-border-color) !important;
	box-shadow: var(--gnome-button-destructive-action-active-box-shadow) !important;
}

.identity-popup-permission-remove-button:not(#hack):hover { /* Is flat */
	border-color: var(--gnome-button-destructive-action-border-color) !important;
	border-bottom-color: var(--gnome-button-destructive-action-border-bottom-color) !important;
	box-shadow: var(--gnome-button-destructive-action-box-shadow) !important;
}
.identity-popup-permission-remove-button:not(#hack):hover .button-icon {
	filter: invert(100%) brightness(200%);
}
