$sidebar-timing: 125ms;
$sidebar-delay: 75ms;

#sidebar {
	display: flex;
	flex-direction: column;
	width: $sidebar-width;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	background-color: var(--panels-background);
	color: var(--panels-text);
	transition: width $sidebar-timing ease-in-out $sidebar-delay;
	z-index: 999;

	&:hover {
		width: 200px;
	}

	.main_tablinks {
		transition: all 500ms;

		&.active {
			background-color: var(--accent-color);
		}

		&:not(#theme_selector) {
			display: flex;
			align-items: center;
			height: 55px;
			cursor: pointer;

			&:hover {
				background-color: var(--sidebar-link-bg);

				.side_icon {
					color: var(--accent-color);
				}
			}
		}
	}

	.main_tablinks_text {
		margin-left: 20px;
		opacity: 0;
		overflow: hidden;
		text-transform: capitalize;
		letter-spacing: 1.3px;
		white-space: nowrap;
		transition: all 50ms ease-in-out 200ms;
	}

	.side_icon {
		font-size: 30px;
		padding: 9px;
		transition: all 500ms;

		&--theme {
			cursor: default;
		}

		@include remove-selection-background;
	}

	&:hover {
		.main_tablinks {
			&:hover {
				background: var(--sidebar-link-bg-20);
				filter: grayscale(0) opacity(1);
			}

			&.active {
				background: var(--sidebar-link-bg);
				filter: grayscale(1);

				// Fix for purple theme in which grayscale shows incoherent color
				html[data-theme='purple'] & {
					background: var(--sidebar-link-bg-20);
					filter: grayscale(0);
				}

				&:hover {
					background: var(--sidebar-link-bg-20);
					filter: grayscale(0);
				}
			}
		}

		.main_tablinks_text {
			opacity: 1;
		}

		#theme_togglers {
			opacity: 1;
		}
	}

	/* Theme selector */
	#theme_selector {
		margin-top: 20px;
		display: flex;
		height: 50px;
	}

	#theme_togglers {
		position: relative;
		display: flex;
		justify-content: space-evenly;
		align-items: center;
		width: 100%;
		opacity: 0;
		transition: all $sidebar-timing ease-in-out $sidebar-delay;
	}

	.theme_toggler {
		width: 25px;
		height: 25px;
		border-radius: 1000px;
		border: 1px solid var(--separator);
		cursor: pointer;
		transition: border 200ms ease-in-out;

		&--active {
			border-width: 3px;
		}

		&--light {
			background: white;
		}

		&--dark {
			background: hsl(0, 0%, 8%);
		}

		&--purple {
			background: hsl(261, 85%, 37%);
		}
	}
}
