/* Sidebar */

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

/* Main sidebar */
#sidebar-main {
	--button-size-icon: var(--gnome-button-size) !important;
	background-color: var(--gnome-sidebar-background) !important;
}

link[href="chrome://browser/content/sidebar/sidebar-main.css"] + .wrapper {
	.tools-and-extensions {
		align-items: center !important;
		justify-content: center !important;
		&[orientation="horizontal"] {
			padding: var(--gnome-toolbar-padding) !important;
		}
	}
	
	.actions-list {
		& > moz-button:not(.tools-overflow) {
			--button-outer-padding-inline: var(--gnome-toolbar-padding) !important;
			--button-outer-padding-block: calc(var(--gnome-toolbar-spacing) / 2) !important;
			--toolbarbutton-active-background: var(--gnome-selected-color) !important;
			
			&:last-of-type {
				--button-outer-padding-block-end: var(--gnome-toolbar-padding) !important;
			}
			&:first-of-type {
				--button-outer-padding-block-start: var(--gnome-toolbar-padding) !important;
			}
		}
	}
}

/* Sidebar content */
#sidebar-box {	
	padding: 0 !important;
}

#sidebar-box:-moz-window-inactive label, #sidebar-box:-moz-window-inactive image,
.sidebar-panel:-moz-window-inactive label, .sidebar-panel:-moz-window-inactive image,
.tools-and-extensions:-moz-window-inactive,
.sidebar-placesTreechildren:-moz-window-inactive {
	opacity: 0.7 !important;
}

#sidebar {
	background-color: var(--gnome-secondary-sidebar-background) !important;
	border: 0 !important;
	border-radius: 0 !important;;
	box-shadow: none !important;
}

#sidebar-search-container {
	padding: var(--gnome-toolbar-padding) !important;
}

/* Separator */
#sidebar-splitter,
#sidebar-launcher-splitter {
	background: var(--gnome-toolbar-background) !important;
	border: 0 !important;
	border-right: 1px solid var(--gnome-border-color) !important;
	border-color: var(--gnome-toolbar-border-color) !important;
	margin: 0 !important;
	width: 0 !important;
}

#sidebar-tools-and-extensions-splitter {
	background: transparent !important;
	margin-block: 0 !important;
}

/* Browser content */
#tabbrowser-tabbox {
	--chrome-content-separator-color: var(--gnome-toolbar-border-color);
	box-shadow: none !important;
	outline: 0 !important;
}

/* Settings lists */
/* TODO: Move to lists.css */
.customize-group .extensions,
link[href="chrome://global/content/elements/moz-fieldset.css"] ~ fieldset #inputs {
	background: var(--gnome-card-background) !important;
	border: 0 !important;
	border-radius: var(--gnome-card-radius) !important;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .03), 0 1px 3px 1px rgba(0, 0, 0, .07), 0 2px 6px 2px rgba(0, 0, 0, .03);
	margin-top: 12px !important;
	padding: 0 !important;
}

moz-checkbox, moz-radio, .customize-group .extension-item {
	display: flex !important;
	padding: 0 !important;

	&:not(:last-of-type) {
		border-bottom: 1px solid var(--gnome-card-shade-color) !important;
	}
	&[slot="nested"]:first-of-type {
		border-top: 1px solid var(--gnome-card-shade-color) !important;
	}
}
moz-checkbox, moz-radio {
	flex-direction: column;
	justify-content: center;
	margin-block-start: 0 !important;
}
.customize-group .extension-item {
	align-items: center;
	min-height: 50px !important;
	padding: 0 12px !important;
}

link[href="chrome://global/content/elements/moz-input-common.css"]:has(~ .nested) {
	& ~ .label-wrapper {
		margin-inline: 12px !important;
		& > label {
			align-items: center;
			display: flex !important;
			gap: var(--gnome-toolbar-spacing);
			min-height: 50px !important;
		}
	}

	& ~ .nested {
		gap: 0 !important;
		margin: 0 !important;
	}
}
