/* Lists */

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

/* TODO: create list color vars */
/* List container */
#permission-popup-permission-list,
richlistbox#items {
	--in-content-item-selected: var(--gnome-accent-bg) !important;
	--in-content-item-selected-text: #fff !important;
	background: var(--gnome-card-background) !important;
	border: 0 !important;
	border-radius: var(--gnome-card-radius) !important;
	padding: 0 !important;
	overflow: hidden;
}

richlistbox#items {
	box-shadow: var(--gnome-card-shadow);
}

/* List item */
.permission-popup-permission-item,
richlistbox#items richlistitem {
	padding: var(--gnome-toolbar-padding) !important;
	margin: 0 !important;
}
.permission-popup-permission-list-anchor {
	padding: 0 !important;
}
.permission-popup-permission-list-anchor:not(:has(.permission-popup-permission-item)) {
	visibility: collapse;
}
richlistbox#items richlistitem:not(:last-child) {
	border-bottom: 1px solid var(--gnome-card-shade-color);
}
.permission-popup-permission-list-anchor:not(#permission-popup-permission-list-default-anchor):has(.permission-popup-permission-item) {
	border-top: 1px solid var(--gnome-card-shade-color);
}
#permission-popup-permission-list-default-anchor:empty + .permission-popup-permission-list-anchor {
	border: 0 !important;
}

/* Fix list buttons on selected state */
@media (prefers-color-scheme: light) {
	richlistbox#items richlistitem[selected=true] button {
		filter: invert() brightness(200%) !important;
	}
}
