/* Toolbox, a container for all toolbars (toolbox#navigator-toolbox):
 * - menu bar (toolbar#toolbar-menubar)
 * - tab bar (toolbar#TabsToolbar)
 * - header bar (toolbar#nav-bar)
 * - bookmark bar (toolbar#PersonalToolbar)
 * - add-ons can add their own toolbars (toolbar) */

@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

/* Toolbox colors */
#navigator-toolbox {
	border: 0 !important;
	background: none !important;
}

#PersonalToolbar, #toolbar-menubar, #TabsToolbar, findbar {
	border: 0 !important;
	background: var(--gnome-toolbar-background) !important;
	border-bottom: 1px solid var(--gnome-toolbar-border-color) !important;
}

menubar > menu {
	color: var(--gnome-toolbar-color) !important;
}

menubar > menu:hover {
	color: var(--gnome-toolbar-color) !important;
	background: var(--gnome-flat-button-hover-background) !important;
}

menubar > menu[open] {
	color: var(--gnome-selected-color) !important;
	background: var(--gnome-selected-background) !important;
}

#nav-bar:-moz-window-inactive,
#PersonalToolbar:-moz-window-inactive,
#toolbar-menubar:-moz-window-inactive,
#TabsToolbar:-moz-window-inactive,
findbar:-moz-window-inactive,
.notificationbox-stack notification:-moz-window-inactive {
	background: var(--gnome-inactive-toolbar-background) !important;
	border-color: var(--gnome-inactive-toolbar-border-color) !important;
}

#navigator-toolbox:-moz-window-inactive label, #navigator-toolbox:-moz-window-inactive image,
#downloads-indicator-anchor:-moz-window-inactive,
findbar:-moz-window-inactive image:not(#hack),
findbar:-moz-window-inactive label,
findbar:-moz-window-inactive description,
#viewButton:-moz-window-inactive dropmarker,
.notificationbox-stack:-moz-window-inactive image:not(#hack),
.notificationbox-stack:-moz-window-inactive label {
	opacity: 0.7 !important;
}

toolbarbutton.bookmark-item:not(.subviewbutton):hover {
	fill: var(--gnome-toolbar-color) !important;
	color: var(--gnome-toolbar-color) !important;
	background: var(--gnome-flat-button-hover-background) !important;
}

toolbarbutton.bookmark-item:not(.subviewbutton):active,
toolbarbutton.bookmark-item:not(.subviewbutton)[open="true"] {
	fill: var(--gnome-toolbar-color) !important;
	color: var(--gnome-toolbar-color) !important;
	background: var(--gnome-flat-button-active-background) !important;
}

toolbarbutton.bookmark-item:not(.subviewbutton):active .toolbarbutton-icon,
toolbarbutton.bookmark-item:not(.subviewbutton)[open="true"] .toolbarbutton-icon {
	filter: invert(0%) brightness(100%) !important;
}

#toolbar-menubar:not([inactive=true]) {
	margin-bottom: 0 !important;
}
#PersonalToolbar {
	padding-top: 2px !important;
	height: 28px;
}

/* Overrides: Remove border below the menu bar / above the header bar */
#TabsToolbar:not([collapsed="true"]) + #nav-bar {
	border-top-width: 0 !important;
}
#navigator-toolbox::after {
	border-bottom-width: 0 !important;
}

/* Reorder toolbars */
#navigator-toolbox #nav-bar, findbar {
	-moz-box-ordinal-group: 0;
}
#navigator-toolbox #PersonalToolbar {
	-moz-box-ordinal-group: 1;
}
#navigator-toolbox #titlebar {
	-moz-box-ordinal-group: 2;
}
#navigator-toolbox toolbar {
	-moz-box-ordinal-group: 10;
}
#navigator-toolbox #TabsToolbar {
	-moz-box-ordinal-group: 100;
}

/* Overrides: Don't shift other toolbars on tab drag and drop */
#TabsToolbar[movingtab] {
	padding-bottom: 0 !important;
}
#TabsToolbar[movingtab] > .tabbrowser-tabs {
	padding-bottom: 0 !important;
	margin-bottom: 0 !important;
}
#TabsToolbar[movingtab] + #nav-bar {
	margin-top: 0 !important;
}

/* Content notifications */
.notificationbox-stack notification {
	border: 0 !important;
	background: var(--gnome-toolbar-background) !important;
	padding: 6px !important;
}

.notificationbox-stack[notificationside="top"] notification {
	border-bottom: 1px solid var(--gnome-toolbar-border-color) !important;
}
.notificationbox-stack[notificationside="bottom"] notification {
	border-top: 1px solid var(--gnome-toolbar-border-color) !important;
}

/* bookmark-item */
#personal-toolbar-empty-description, #PersonalToolbar .toolbarbutton-1, toolbarbutton.bookmark-item:not(.subviewbutton) {
	margin: 0 2px 2px !important;
	padding: 3px 6px !important;
}
