/* SquaredPancake's Zen Browser Tweaks */


/* Hides workspace button in the side bar as I don't use workspaces and it clutters up the UI */
.zen-current-workspace-indicator {
	display: none !important;
}


/* Tried to hide seperator between pinned and non-pinned tabs when only non-pinned tabs are around, but doesn't work for some reason */
/*tab.tabbrowser-tab + hbox.pinned-tabs-container-separator {
	display: none !important;
}*/


/* #region improved-collapsed-tabs MY WAY!! */

/* 
 * https://github.com/xXMacMillanXx/improved-collapsed-tabs,
 * but tweaked to MY liking!
 */

@media not (-moz-bool-pref: "zen.view.sidebar-expanded") {
	/* confine tab side indicator to rounded tab box */
	.tab-background {
		position: relative;
	}
	
	/* move tab close button to the top right to align with common UX */
	image.tab-close-button {
		inset-inline-start: unset !important;
		inset-inline-end: -2px !important;
	}
	
	/* move audio mute button to the top left */
	.tab-icon-overlay:is([soundplaying], [muted], [activemedia-blocked]) {
		inset-inline-start: -18px !important;
	}
	
	/* keep favicon visible */
	.tab-icon-image {
		opacity: 1 !important;
	}
	
	.tabbrowser-tab {
		.tab-content {
			flex-direction: column;
			
			.tab-icon-stack {
				position: none;
			}
			
			.tab-icon-stack {
				position: none;
			}
			
			/* restore tab title and show the first 4 letters */
			.tab-label-container {
				--comptitle-width: 4ch;
				overflow: hidden;
				/* position: absolute; */
				text-overflow: ellipsis;
				width: var(--comptitle-width);
				white-space: nowrap;
				/* background: var(--zen-main-browser-background); */ /* tab title bg color */
				height: 1em !important;
				opacity: 1;
				/* bottom: 5px; */
				border-radius: 5px;
				font-family: monospace;
				display: flex !important;
				mask-image: none !important;
				color: var(--text-color-deemphasized); /* tab title color */
				max-height: 1em;
				--tab-label-line-height: 1em;
			}
		}
		
		/* remove the "Playing" subtitle */
		.tab-secondary-label {
			display: none !important;
		}

		/* selected tab title */
		&[selected] .tab-label-container {
			color: var(--text-color);
			background: light-dark(var(--tab-selected-bgcolor), var(--zen-main-browser-background));
		}
				
		/* show title on pinned tabs as well */
		@media (-moz-bool-pref: "uc.theme.comptitle-enable-pinned.enabled") {
			.tab-label-container {
				width: var(--comptitle-width) !important;
			}
		}
		
		/* use active text color for all tab titles */
		@media (-moz-bool-pref: "uc.theme.comptitle-default-text.enabled") {
			.tab-label-container {
				color: var(--text-color);
			}
		}
	}
}
/* #endregion improved-collapsed-tabs MY WAY!! */