@import "../fonts/onest-font.css";

:root,
html,
body {
	min-height: 100vh;
	min-width: 100vw;
	max-width: 100vw;
	height: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: thin;
	display: flex;
	align-items: center;
	font-family: var(--scms-font-onest);
}

main {
	min-height: 100%;
	width: 100%;
	max-width: 100vw;
	position: relative;
}

.scrollbar {
	overflow-y: auto;
	overflow-x: hidden;

	&::-webkit-scrollbar,
	&::-webkit-scrollbar-track {
		background-color: inherit;
		border-top-left-radius: 0;
		border-top-right-radius: 0;
		-webkit-box-shadow: inset 0 0 2px var(--border);
	}
	&::-webkit-scrollbar-thumb {
		background-color: var(--mono-flat-hover);
		border: 4px solid transparent;
		background-clip: content-box;
		border-radius: var(--radius-full);
	}
	&::-webkit-scrollbar-thumb:hover {
		background-color: var(--mono-flat-active);
		cursor: default;
	}
}

.sidebar-header {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: center;
	width: 100%;
}

.sidebar-logo {
	width: 2.75rem;
	height: auto;
}

.sidebar-title {
	font-size: 1.75em;
	font-weight: 700;
}

.sidebar-subtitle {
	font-size: 1em;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	flex-direction: row;
	gap: 1rem;
	width: 100%;

	.sui-group {
		width: 100%;

		button {
			align-items: center;
		}
	}
}

.sidebar-header-text {
	display: flex;
	flex-direction: row;
	gap: 1rem;
	align-items: center;
}

.sidebar-link-group {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	width: 100%;
}

.sidebar-link-group.hidden {
	display: none;
}

.empty-placeholder-span {
	width: 100%;
	text-align: center;
	color: var(--text-muted);
	font-size: 0.875em;
}

.user-dropdown-trigger-container {
	width: calc(280px - 3rem);
	cursor: pointer;
	border: 1px solid var(--border);
	padding: 0.5rem;
	border-radius: 0.5rem;
	transition: all 0.15s ease;
}

.user-dropdown-trigger-container:hover {
	background-color: var(--background-step-2);
}

.sidebar {
	justify-content: space-between;
}

.sidebar-links-container {
	gap: 0.75rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	height: 100%;
}

.outer-sidebar-container {
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
}

.sui-modal.lg {
	width: 650px !important;
}

.dashboard-footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	padding-top: 1.25rem;
	color: var(--text-muted);
	font-size: 0.875em;
	justify-content: center;

	& a {
		color: var(--text-muted);
		text-decoration: none;
	}
}

.dashboard-footer a:hover {
	color: var(--primary-hover);
	text-decoration: underline;
}

.container {
	height: 100%;
	min-height: 100vh;
	max-height: 100vh;
	max-width: 100%;
	padding: 1.5rem;
	overflow-y: auto;
	overflow-x: hidden;

	&::-webkit-scrollbar,
	&::-webkit-scrollbar-track {
		background-color: inherit;
		border-radius: 99px;
		border-top-left-radius: 0;
		border-top-right-radius: 0;
	}
	&::-webkit-scrollbar-thumb {
		background-color: var(--default-active);
		border: 4px solid transparent;
		background-clip: content-box;
		border-radius: 99px;
	}
	&::-webkit-scrollbar-thumb:hover {
		background-color: var(--default-hover);
	}
}

.container-content {
	-webkit-box-flex: 1;
	-ms-flex-positive: 1;
	flex-grow: 1;
	margin: 0 auto;
	position: relative;
	width: 100%;
}

.dashboard-grid-container {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-auto-flow: dense;
	gap: 1rem;
	width: 100%;

	& .grid-item {
		padding: 0.5rem;
		height: unset !important;
		grid-row: auto;
	}

	& .span-2 {
		grid-column: span 2;
	}

	& .span-3 {
		grid-column: span 3;
	}

	& .grid-item-title {
		display: flex;
		gap: 1rem;
		align-items: center;
	}
}

@media (max-width: 1200px) {
	.dashboard-grid-container {
		grid-template-columns: repeat(2, 1fr);

		& .span-3 {
			grid-column: span 2;
		}

		& .span-2 {
			grid-column: span 2;
		}
	}
}

@media (max-width: 768px) {
	.dashboard-grid-container {
		grid-template-columns: 1fr;

		& .span-3 {
			grid-column: span 1;
		}

		& .span-2 {
			grid-column: span 1;
		}
	}
}

#studiocms-theme-toggle,
#studiocms-theme-toggle * {
	color: var(--text-normal);
}

#studiocms-theme-toggle #dark-content,
#studiocms-theme-toggle #light-content {
	display: none;
	width: fit-content;
	height: fit-content;
	max-height: 100%;
}

#studiocms-theme-toggle #fallback-content {
	display: block;
	width: fit-content;
	height: fit-content;
	max-height: 100%;
}

[data-theme="dark"] #studiocms-theme-toggle #dark-content {
	display: block;
}

[data-theme="light"] #studiocms-theme-toggle #light-content {
	display: block;
}

[data-theme="dark"] #studiocms-theme-toggle #fallback-content,
[data-theme="light"] #studiocms-theme-toggle #fallback-content {
	display: none;
}

.sidebar-link {
	display: flex;
	flex-direction: row;
	gap: 0.5rem;
	align-items: center;
	border-radius: 0.5rem;
	transition: all 0.15s ease;
	width: 100%;
	padding: 0.375rem 0.5rem;
	text-decoration: none;
	color: var(--text-muted);
	cursor: pointer;
}

.sidebar-link:hover {
	background-color: var(--background-step-2);
}

.sidebar-link.active {
	color: var(--text);
}

.sidebar-link.active .sidebar-link-icon {
	color: var(--primary-base);
}

#sui-sidebar-inner {
	display: block !important;
}

.inner-sidebar-header {
	display: flex;
	width: 100%;
	gap: 1rem;
	align-items: center;

	& input {
		width: 100%;
	}

	& button {
		aspect-ratio: 1 / 1;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	& input[name="search"] {
		/* heroicons:magnifying-glass-16-solid */
		background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAndJREFUSEvFlUtoFEEQhv/qRVkvevARiM+DiOAjKooS0KCYg9EIigrGi3jzIBK8bNdsCIHt3mURET14EwQhugQRIxg8KMRHEIMGQUFyCCiBGFBE8LLsdLkTZsUkm52BZLGuXV3f/FX19xDqHFTn+vh/gO7u7sXJZPK0iFwAsAnASgBjRDTsnOsvFot9PT09LqoDVRVkMpnVSqkBAFtrFBgBcI6ZP9WCzAIYYxqI6B2AxvDiGxEZSCQS733f30lEbQD2hGcTzrnd6XR6fC7INICIUDabfQ6gBcAkgIvM/GDmZWvtKRG5RUQrAAwxc3MsgDGmlYieBslEdERrHbSpahhjjhLR4zC3Q2vdWy1xmgJr7X0AZwA8ZOYTUQO01vYDOEZE/Vrr43EAYwA2ALjMzDeiAMaYK0R0NWgnMzfEARQBLBKRNs/znkQBMplMu1LqEYAfzLw8DuALgLUAOpn5ehTAGNNJRNcAfGXmdXEAlRncYebzUQBr7d3ACwB6mbkjEvCP5N8i0ux53ocaW7SLiF4CWAKgnZmnNmpmzDJaNpsdKhtrX9kD35xzJ9Pp9OsqPthfdnkfgFXlLRpm5orxogG5XK7JOTcIYCkAR0Q3nXPBszBORGuIqElELgFQYbVJ3/cPdHV1fY6lIEgyxmwnomA71teYwysAGwEE6/ldKdWSSqU+RraoklAoFBKjo6NnlVKtIrIDwBYAPoBA3T2t9e18Pr+5VCoNhk/GTxE56HleoPZvzPt/kMvltjnnXgBYBuBXefCHtdZvK4R5A8KWBhv1LIRMaK0biUim3qmoXY97bq3dCyBw/wgzH1pQBbU+YsEUzAWpO+APfeLiGcjy+NMAAAAASUVORK5CYII=") !important;
		background-position: 9px 7px !important;
		background-repeat: no-repeat !important;
		padding: 0.5rem 0.5rem 0.5rem 2.5rem !important;
		height: 40px !important;
	}
}

.inner-sidebar-folder-child-nodes {
	margin-left: 0.5rem;
	border-left: 2px solid var(--border);
}

.inner-sidebar-link {
	display: flex;
	flex-direction: row;
	gap: 0.5rem;
	align-items: center;
	border-radius: 0.5rem;
	transition: all 0.15s ease;
	width: 100%;
	padding: 0.375rem 0.5rem;
	text-decoration: none;
	color: var(--text-muted);
}

.not-selected {
	display: block;
}

.selected {
	display: none;
}

.inner-sidebar-link:hover {
	background-color: var(--background-step-3);
}

.inner-sidebar-link.active {
	color: var(--text);
}

.inner-sidebar-link.active .sidebar-link-icon {
	color: var(--primary-base);
}

.inner-sidebar-items {
	display: flex;
	flex-direction: column !important;
	gap: 0.4rem !important;
	width: 100%;
	min-height: 100%;
	max-height: 100%;
	height: 100%;
}

.inner-sidebar-link {
	display: flex;
	flex-direction: row;
	gap: 0.5rem;
	align-items: center;
	border-radius: 0.5rem;
	transition: all 0.15s ease;
	width: 100%;
	padding: 0.375rem 0.5rem;
	text-decoration: none;
	color: var(--text-muted);
}

#search-selector {
	margin-bottom: 0.4rem;
}

.inner-sidebar-link:hover {
	background-color: var(--background-step-3);
	cursor: pointer;
}

.text-h3 {
	font-size: 1.25em;
	font-weight: 700;
}

.inner-user-sidebar-header {
	display: flex;
	width: 100%;
	align-items: center;
	padding-bottom: 1.5rem;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	gap: 1rem;

	& input {
		width: 100%;
	}

	& button {
		aspect-ratio: 1 / 1;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	& input[name="search"] {
		/* heroicons:magnifying-glass-16-solid */
		background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAndJREFUSEvFlUtoFEEQhv/qRVkvevARiM+DiOAjKooS0KCYg9EIigrGi3jzIBK8bNdsCIHt3mURET14EwQhugQRIxg8KMRHEIMGQUFyCCiBGFBE8LLsdLkTZsUkm52BZLGuXV3f/FX19xDqHFTn+vh/gO7u7sXJZPK0iFwAsAnASgBjRDTsnOsvFot9PT09LqoDVRVkMpnVSqkBAFtrFBgBcI6ZP9WCzAIYYxqI6B2AxvDiGxEZSCQS733f30lEbQD2hGcTzrnd6XR6fC7INICIUDabfQ6gBcAkgIvM/GDmZWvtKRG5RUQrAAwxc3MsgDGmlYieBslEdERrHbSpahhjjhLR4zC3Q2vdWy1xmgJr7X0AZwA8ZOYTUQO01vYDOEZE/Vrr43EAYwA2ALjMzDeiAMaYK0R0NWgnMzfEARQBLBKRNs/znkQBMplMu1LqEYAfzLw8DuALgLUAOpn5ehTAGNNJRNcAfGXmdXEAlRncYebzUQBr7d3ACwB6mbkjEvCP5N8i0ux53ocaW7SLiF4CWAKgnZmnNmpmzDJaNpsdKhtrX9kD35xzJ9Pp9OsqPthfdnkfgFXlLRpm5orxogG5XK7JOTcIYCkAR0Q3nXPBszBORGuIqElELgFQYbVJ3/cPdHV1fY6lIEgyxmwnomA71teYwysAGwEE6/ldKdWSSqU+RraoklAoFBKjo6NnlVKtIrIDwBYAPoBA3T2t9e18Pr+5VCoNhk/GTxE56HleoPZvzPt/kMvltjnnXgBYBuBXefCHtdZvK4R5A8KWBhv1LIRMaK0biUim3qmoXY97bq3dCyBw/wgzH1pQBbU+YsEUzAWpO+APfeLiGcjy+NMAAAAASUVORK5CYII=") !important;
		background-position: 9px 7px !important;
		background-repeat: no-repeat !important;
		padding: 0.5rem 0.5rem 0.5rem 2.5rem !important;
		height: 40px !important;
	}
}

.inner-sidebar-users {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
}

.sidebar-user {
	padding: 1rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	text-decoration: none;
	color: var(--text-normal);
	transition: all 0.15s ease;
}

.sidebar-user:hover {
	background-color: var(--background-step-1);
}

.sidebar-user.active {
	background-color: var(--background-step-2);
}

.sui-accordion-details .astro-code {
	background-color: var(--background-step-2) !important;
	border: 1px solid var(--border) !important;
	border-radius: 0.25rem;
	padding: 1rem;
	margin-bottom: 1rem;
	margin-right: 1rem;
	box-sizing: border-box;
}

.mobile-btn {
	display: none !important;
	aspect-ratio: 1 / 1;
	align-items: center;
	justify-content: center;
}

.mid-size-btn {
	display: none !important;
}

@media screen and (max-width: 1200px) {
	.mid-size-btn {
		display: flex !important;
	}
}

@media screen and (max-width: 840px) {
	.sidebar-links-container {
		align-items: flex-start;
	}

	.sidebar-header {
		width: 100%;
	}

	.sidebar-header-text {
		flex-direction: row;
		width: 100%;
		justify-content: space-between;
	}

	.dashboard-footer {
		text-align: left;
	}

	#sui-sidebar > div,
	.user-dropdown-trigger-container {
		width: 100%;
	}

	.mobile-btn {
		display: flex !important;
	}
}

@media screen and (max-width: 440px) {
	.sidebar-header-text {
		flex-direction: column;
		width: fit-content;
	}
}

#search-form {
	width: 100%;
}

#sui-sidebar-inner > div:has(> .inner-sidebar-container) {
	height: 100%;
}
