/* CSS for UI elements (a.k.a. chrome) */

@import "variables.css";

::-webkit-scrollbar {
	background: var(--card-bg);
}

::-webkit-scrollbar-thumb {
	background: var(--card-hover);
}

html {
	scrollbar-color: var(--card-hover) var(--card-bg);
}

/* ===== Page Layout ===== */
.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Content Card ===== */
.content-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.content-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.content-card h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.content-card h3:first-of-type {
    margin-top: 20px;
}

.content-card ul,
.content-card ol {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
    padding-left: 24px;
}

.content-card li {
    margin-bottom: 12px;
}

.content-card ol ol {
    margin-top: 12px;
    list-style-type: lower-alpha;
}

.content-card a {
    color: var(--link-color);
    text-decoration: none;
}

.content-card a:hover {
    opacity: 0.85;
}

.content-card code {
    background: rgba(102, 126, 234, 0.15);
    color: var(--link-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.content-card em {
    color: var(--text-primary);
    font-style: italic;
}

.intro-text {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.third-party-box {
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.third-party-box p {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 500;
}

.third-party-box ul {
    margin-bottom: 0;
}

/* ===== Buttons ===== */
.btn-primary {
    padding: 16px 32px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    padding: 16px 32px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    text-decoration: none;
}

/* ===== Legacy Card Styles ===== */
.commandCard {
    display: flex;
    flex-direction: row;
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 4px 16px;
    transition: 0.1s all ease;
    color: white;
    text-decoration: none;
    margin-bottom: 16px;
}

.commandDetails {
    display: flex;
    flex-direction: column;
}

.commandControls {
    display: flex;
    flex-direction: row;
    font-size: 50px;
}

.commandCard:hover {
    background-color: var(--card-hover);
    color: white;
    text-decoration: none;
}

.commandTitle {
    color: whitesmoke;
}

.commandDesc {
    color: var(--text-secondary);
}

.commandIconAlign {
    align-content: center;
    display: flex;
    flex-direction: row;
    margin-left: 12px;
}

.botCard {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 2px 16px;
    transition: 0.1s all ease;
    color: white;
    text-decoration: none;
    margin-bottom: 16px;
}

.botCard:hover {
    background-color: var(--card-hover);
    color: white;
    text-decoration: none;
}

.mailChip {
    word-break: break-all;
    text-wrap: wrap;
}

/* Tags */

.functionTags {
	user-select: none;
	-webkit-user-select: none;
	margin-top: -1rem;
}

.functionTags span {
	user-select: none;
	-webkit-user-select: none;
	position: relative;
	border: solid;
	border-width: 1px;
	border-radius: 10px;
	font-size: 1.5rem;
	font-weight: bold;
	padding: 0.25rem 0.5rem 0.25rem 0.5rem;
	transition: 0.3s;
	border-color: var(--link-color);
	color: var(--link-color);
}

.functionTags #PremiumTag {
	border-color: #e5e501;
	color: #e5e501;
}
.functionTags #DangerousTag {
	color: #ff0000;
	border-color: #ff0000;
}

.functionTags #PremiumTag:before {
	content: "💰 ";
}
.functionTags #CallbackTag:before {
	content: "⚡ ";
}
.functionTags #FlowchartTag:before {
	content: "🤖 ";
}
.functionTags #DeprecatedTag:before {
	content: "⌛ ";
}
.functionTags #ExperimentTag:before {
	content: "📢 ";
}
.functionTags #DangerousTag:before {
	content: "❗ ";
}

.functionTags span:hover {
	border-radius: 12.5px;
	transition: 0.3s;
}

/* Playground */

.function-playground {
	background: var(--card-bg);
	border-radius: 10px;
	padding-left: 1rem;
	padding-right: 1rem;
	padding-bottom: 1rem;
}

.function-input,
.function-output {
	border-radius: 10px;
	background: hsl(0deg 0% 100% / 5%);
	padding-left: 1rem;
	padding-right: 1rem;
	padding-bottom: 1rem;
}

.function-input p,
.function-output p {
	padding-top: 1rem;
	font-weight: bold;
	margin-bottom: 0.2em;
}

.function-playground h3 {
	padding-top: 1rem;
}

.function-playground h3:after {
	content: "BETA";
	margin-left: 0.5rem;
	background: rgb(255 255 255 / 10%);
	padding: 0.3rem;
	padding-left: 0.6rem;
	padding-right: 0.6rem;
	border-radius: 10px;
}

.function-input #play-code,
.function-output #play-output {
	display: inline-block;
	background: hsl(0deg 0% 0% / 65%);
	padding: 0.5rem;
	padding-left: 0.75rem;
	border-radius: 10px;
	color: var(--link-color);
	width: 97.75%;
}

.function-output #play-output {
	color: #c1c1c1;
	word-break: break-all;
	max-width: 97%;
	min-height: 2.2rem;
}

.function-input textarea {
	background: hsl(0deg 0% 100% / 5%);
	width: fit-content;
	margin-bottom: -0.7rem;
	border-color: var(--card-hover);
	padding-left: 0.5rem;
	padding-right: 0.5rem;
	max-width: 97%;
	font-size: 90%;
	resize: none;
	border-radius: 5px;
	outline: none;
	color: var(--link-color);
	height: 1.75rem;
	overflow: hidden;
	field-sizing: content;
	min-width: 1rem;
}

#errorFunctionName,
#errorLineNumber {
	display: inline;
	font-weight: 400;
	border-radius: 4.3px;
	background: #191919;
	color: #d5d3d1;
	border: 0.1px solid #1e1f22;
	padding: 0.1rem;
	padding-left: 0.4rem;
	padding-right: 0.4rem;
	box-shadow: none;
}

/* Links */

#searchresults a,
.content a:link,
a:visited,
a > .hljs {
	color: var(--link-color);
	position: relative;
	text-decoration: none;
}

.discord-message-markup a:link:hover,
.discord-embed-grid a:link:hover {
	text-decoration: underline;
}

/* Menu Bar */

#menu-bar {
	user-select: none;
	-webkit-user-select: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	padding: 16px 24px;
	background: rgba(13, 13, 13, 0.8);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	transition: all 0.3s ease;
}

#menu-bar > #menu-bar-sticky-container {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
}

.js #menu-bar > #menu-bar-sticky-container {
	transition: none;
}

#menu-bar i,
#menu-bar .icon-button {
	position: relative;
	padding: 0 8px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.icon-button {
	border: 0;
	background: none;
	color: rgba(255, 255, 255, 0.7);
	padding: 10px 12px;
	border-radius: 8px;
}

.icon-button:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.1);
}

#menu-bar:not(:hover).folded > #menu-bar-sticky-container {
	transform: none;
}

.navbar-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: #ffffff;
	font-weight: 700;
	font-size: 1.1rem;
	transition: opacity 0.3s ease;
	flex: 1;
}

.navbar-brand:hover {
	opacity: 0.8;
	text-decoration: none;
	color: #ffffff;
}

.navbar-brand-icon {
	width: 36px;
	height: 36px;
	background: var(--primary-gradient);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.navbar-brand-icon i {
	color: white;
	font-size: 16px;
}

.navbar-brand-text {
	font-weight: 600;
	font-size: 1.6rem;
	color: #ffffff;
}

.menu-buttons {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Sidebar toggle positioned on the left */
#menu-bar > #menu-bar-sticky-container > #sidebar-toggle {
	order: -1;
	margin-right: 12px;
}

.menu-title {
	display: none;
}

.js .menu-title {
	cursor: pointer;
}

.menu-bar,
.menu-bar:visited,
.nav-chapters,
.nav-chapters:visited,
.mobile-nav-chapters,
.mobile-nav-chapters:visited,
.menu-bar .icon-button,
.menu-bar a i {
	color: rgba(255, 255, 255, 0.7);
}

.menu-bar i:hover,
.menu-bar .icon-button:hover,
.nav-chapters:hover {
	color: #ffffff;
}

#sidebar-toggle,
#search-toggle {
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.05);
}

#sidebar-toggle:hover,
#search-toggle:hover {
	background: rgba(255, 255, 255, 0.1);
}

#search-toggle i,
#sidebar-toggle i {
	font-size: 14px !important;
	color: rgba(255, 255, 255, 0.7);
}

#sidebar-toggle:hover i,
#search-toggle:hover i {
	color: #ffffff;
}

/* Navbar spacer to prevent content from going under fixed navbar */
.navbar-spacer {
	height: 70px;
}

/* Hide sidebar button for PC & Add text in the menu bar */

@media (min-width: 750px) {
	#sidebar-toggle {
		display: none;
	}

	#search-toggle {
		width: 40px;
		height: 40px;
	}
}

/* Mobile responsive navbar */
@media (max-width: 749px) {
	#menu-bar {
		padding: 12px 16px;
	}

	#menu-bar > #menu-bar-sticky-container > #sidebar-toggle {
		display: flex;
		margin-right: 12px;
	}

	.navbar-brand {
		flex: 1;
		justify-content: flex-start;
	}

	.navbar-brand-text {
		font-size: 1.6rem;
	}

	.navbar-brand-icon {
		width: 32px;
		height: 32px;
	}

	.navbar-brand-icon i {
		font-size: 14px;
	}

	.navbar-spacer {
		height: 60px;
	}

	.sidebar {
		top: 60px;
		height: calc(100vh - 60px);
	}
}

/* Edit Page */

.editPage {
	user-select: none;
	-webkit-user-select: none;
	border: solid;
	border-width: 1px;
	border-radius: 10px;
	border-color: var(--card-hover);
	color: var(--link-color);
	width: fit-content;
	padding: 5px;
	text-decoration: none;
	margin-top: -2.2rem;
	text-align: center;
	display: block;
	margin-left: auto;
	margin-right: 5px;
	font-size: 85%;
	transition: 0.3s;
}

.editPage:hover {
	font-size: 87.5%;
	border-radius: 8px;
	border-color: var(--link-color);
	transition: 0.3s;
}

@media (min-width: 750px) {
	.editPage:after {
		content: "Edit this page";
	}

	#editPageIcon {
		padding-right: 0.4rem;
	}
}

@media (max-width: 750px) {
	.editPage {
		visibility: hidden;
	}
}

/* Nav Icons */

.nav-chapters {
	font-size: 2.5em;
	text-align: center;
	text-decoration: none;

	position: fixed;
	top: 0;
	bottom: 0;
	margin: 0;
	max-width: 150px;
	min-width: 90px;

	display: flex;
	justify-content: center;
	align-content: center;
	flex-direction: column;

	transition: 0.5s;
}

.nav-chapters:hover {
	text-decoration: none;
	background: rgba(0, 0, 0, 0.2);
	transition: 0.5s;
}

.nav-wrapper {
	margin-top: 20px;
	display: none;
}

.mobile-nav-chapters {
	font-size: 2.5em;
	text-align: center;
	text-decoration: none;
	width: 60px;
	border-radius: 10px;
	background-color: var(--card-bg) !important;
	color: var(--link-color) !important;
}

.mobile-nav-chapters:hover i {
	color: #ded;
	transform: scale(1.05);
	transition: 0.2s;
}

.previous {
	float: left;
}

.next {
	float: right;
	right: var(--page-padding);
}

@media only screen and (max-width: 1080px) {
	.nav-wide-wrapper {
		display: none;
	}
	.nav-wrapper {
		display: block;
	}
}

@media only screen and (max-width: 1380px) {
	.sidebar-visible .nav-wide-wrapper {
		display: none;
	}
	.sidebar-visible .nav-wrapper {
		display: block;
	}
}

/* Inline code */

:not(pre) > .hljs {
	display: inline;
	padding: 0.1em 0.3em !important;
	border-radius: 5px !important;
	box-shadow: none;
}

:not(pre):not(a) > .hljs:not(.discord-message code) {
	color: var(--link-color);
	overflow-x: initial;
}

a:hover > .hljs {
	text-decoration: underline;
}

pre {
	position: relative;
	word-break: break-all;
}

code.hljs:not(.discord-message code) {
	background: var(--card-bg);
	padding: 0.8em;
	margin-bottom: -0.5rem;
}

.nostyle {
	/* Disabled Code HL style */
	color: inherit !important;
	font-weight: inherit !important;
	font-style: normal !important;
}

/* Warnings */

:is(.admonition) {
	background-color: var(--card-bg) !important;
	border-radius: 0 10px 10px 0 !important;
}

.admonition-title,
summary.admonition-title {
	border-top-right-radius: 10px !important;
}

.admonition-title {
	background: hsl(0deg 0% 100% / 0%) !important;
	font-size: 1.55rem;
	margin-bottom: -1.75rem !important;
}

/* Summary */

summary {
	user-select: none;
	-webkit-user-select: none;
	outline: none;
	background-color: var(--card-bg);
	padding: 10px;
	border-radius: 10px;
	cursor: pointer;
	font-weight: bold;
	margin-top: 1rem;
}

details > h2 {
	margin-top: 2rem;
}

details:hover {
	border-color: var(--card-hover);
	transition: 0.3s;
}

details {
	border: solid;
	margin-top: 1rem;
	border-color: var(--card-bg);
	border-radius: 10px;
	padding: 0 10px 10px 10px;
	transition: 0.3s;
}
/* Code Block Buttons */

pre:hover > .buttons {
	visibility: visible;
	opacity: 1;
}

pre > .buttons {
	position: absolute;
	z-index: 100;
	right: -3px;
	margin: 1px;
	padding: 1px;
	visibility: hidden;
	opacity: 0;
	transition: visibility 0.1s linear, opacity 0.1s linear;
	cursor: pointer;
}

pre > .buttons :hover {
	color: var(--link-color);
	border-color: var(--link-color);
	border-radius: 9px;
	opacity: 0.9;
	transition: 0.2s;
}

pre > .buttons button {
	user-select: none;
	-webkit-user-select: none;
	touch-action: manipulation;
	outline: none;
	color: #fff;
	margin: 1.5px 5px;
	padding: 5px;
	cursor: inherit;
	width: 3.2rem;
	height: 3.2rem;
	font-size: 1.5rem;
	border-style: solid;
	border-width: 1px;
	border-radius: 10px;
	border-color: #aeaeae;
	background: rgb(255 255 255 / 10%);
	opacity: 0.8;
	transition: 0.2s;
}

pre > .result {
	margin-top: 10px;
}

/* Search */

#searchresults a {
	text-decoration: none;
	color: var(--link-color);
}

mark {
	border-radius: 10px;
	padding: 0 5px;
	margin: 0 -5px -1px -5px;
	background-color: var(--link-color);
	color: var(--card-bg);
	transition: background-color 300ms linear;
	cursor: pointer;
}

mark.fade-out {
	background-color: rgba(0, 0, 0, 0) !important;
	cursor: auto;
}

/* Search Overlay */
#search-wrapper {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(13, 13, 13, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-top: 15vh;
	opacity: 1;
	visibility: visible;
	transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

#search-wrapper.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.searchbar-outer {
	width: 100%;
	max-width: 700px;
	padding: 0 20px;
	animation: searchSlideDown 0.25s ease-out;
}

@keyframes searchSlideDown {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

#searchbar {
	width: 100%;
	height: 70px;
	padding: 0 28px;
	font-size: 1.75rem;
	color: var(--text-primary);
	background: var(--card-bg);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--border-radius);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
	            0 0 0 1px rgba(102, 126, 234, 0.1);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#searchbar:focus {
	border-color: var(--link-color);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
	            0 0 0 2px rgba(102, 126, 234, 0.3);
}

#searchbar::placeholder {
	color: var(--text-muted);
	font-style: normal;
}

.search-hint {
	text-align: center;
	margin-top: 16px;
	font-size: 1.25rem;
	color: var(--text-muted);
	opacity: 0.7;
}

.search-hint kbd {
	display: inline-block;
	padding: 4px 12px;
	font-size: 1.1rem;
	font-family: inherit;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	border: 1px solid rgba(255, 255, 255, 0.15);
}

#search-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	color: var(--text-secondary);
	font-size: 1.5rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

#search-close:hover {
	background: rgba(255, 255, 255, 0.12);
	color: var(--text-primary);
	transform: scale(1.05);
}

#search-close:active {
	transform: scale(0.95);
}

/* Search Results */
.searchresults-outer {
	width: 100%;
	max-width: 700px;
	max-height: 55vh;
	overflow-y: auto;
	margin-top: 16px;
	padding: 0 20px;
	scrollbar-width: thin;
	scrollbar-color: var(--card-hover) transparent;
	animation: searchSlideDown 0.2s ease-out;
}

.searchresults-outer::-webkit-scrollbar {
	width: 6px;
}

.searchresults-outer::-webkit-scrollbar-track {
	background: transparent;
}

.searchresults-outer::-webkit-scrollbar-thumb {
	background: var(--card-hover);
	border-radius: 3px;
}

.searchresults-header {
	font-size: 1.1rem;
	font-weight: 500;
	text-align: left;
	padding: 16px 4px;
	color: var(--text-muted);
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

ul#searchresults {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

ul#searchresults li {
	background: var(--card-bg);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 12px;
	padding: 0;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

ul#searchresults li a {
	display: block;
	padding: 20px;
	color: var(--text-primary);
	text-decoration: none;
	cursor: pointer;
}

ul#searchresults .search-result-title {
	display: block;
	font-weight: 500;
	font-size: 1.4rem;
}

ul#searchresults li:hover {
	background: var(--card-hover);
	border-color: rgba(255, 255, 255, 0.1);
	transform: translateY(-1px);
}

ul#searchresults li.focus {
	background: var(--card-hover);
	border-color: var(--link-color);
	box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
	outline: none;
}

ul#searchresults span.teaser {
	display: block;
	margin-top: 10px;
	font-size: 1.15rem;
	color: var(--text-secondary);
	line-height: 1.6;
	opacity: 0.85;
}

ul#searchresults span.teaser em {
	font-weight: 600;
	font-style: normal;
	color: var(--link-color);
}

/* Sidebar */

.sidebar {
	position: fixed;
	left: 0;
	top: 70px; /* Account for fixed navbar height */
	bottom: 0;
	width: var(--sidebar-width);
	font-size: 95%;
	box-sizing: border-box;
	height: calc(100vh - 70px);
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: none;
	background: rgba(26, 26, 46, 0.85);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-right: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
	scrollbar-color: var(--card-hover) rgba(255, 0, 0, 0) !important;
	z-index: 999;
}

.sidebar code {
	line-height: 2em;
}

.sidebar .sidebar-scrollbox {
	overflow-y: auto;
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px 16px;
}

.sidebar-hidden .sidebar {
	transform: translateX(calc(-1 * var(--sidebar-width)));
	transition: transform 0.3s ease;
}

.sidebar-visible .sidebar {
	transform: translateX(0);
	transition: transform 0.3s ease;
}

.sidebar-visible .page-wrapper {
	margin-left: var(--sidebar-width);
	transition: margin-left 0.3s ease;
}

.sidebar-hidden .page-wrapper {
	margin-left: 0;
	transition: margin-left 0.3s ease;
}

@media only screen and (min-width: 620px) {
	.sidebar-visible .page-wrapper {
		transform: none;
		margin-left: var(--sidebar-width);
	}
}

/* Fixed sidebar for desktop */
@media only screen and (min-width: 750px) {
	.sidebar-hidden .sidebar {
		transform: translateX(0);
	}

	.sidebar-hidden .page-wrapper,
	.sidebar-visible .page-wrapper {
		margin-left: var(--sidebar-width);
	}
}

.chapter {
	list-style: none outside none;
	padding-left: 0;
	line-height: 2.1em;
}

.chapter ol {
	width: 100%;
}

.chapter li {
	display: flex;
}

.chapter li a {
	display: block;
	padding: 0;
	color: hsl(0deg 0% 100% / 85%);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	transition: color 0.15s ease;
}

.chapter li a:not(a.toggle) {
	width: 100%;
}

.chapter li a:hover {
	color: var(--link-color) !important;
}

.chapter li a.active {
	color: var(--link-color) !important;
	font-weight: 600;
	background: rgba(102, 126, 234, 0.1);
	border-radius: 8px;
	padding-left: 10px;
	margin-left: -2px;
	border-left: 2px solid var(--link-color);
}

.chapter li > a.toggle {
	cursor: pointer;
	display: block;
	margin-left: auto;
	padding: 0 10px;
	user-select: none;
	opacity: 0.58;
}

.chapter li > a.toggle div {
	transition: transform 0.2s ease;
}

/* collapse the section */
.chapter li:not(.expanded) + li > ol {
	display: none;
}

.chapter li.expanded > a.toggle div {
	transform: rotate(90deg);
}

.chapter-item:not(.section .chapter-item, .chapter-item.affix) {
	user-select: none;
	-webkit-user-select: none;
	border-radius: 12px;
	padding: 12px;
	margin-bottom: 10px;
	font-weight: bold;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.04);
	cursor: pointer;
}

.chapter-item:not(.section .chapter-item, .chapter-item.affix):hover {
	background: rgba(255, 255, 255, 0.06);
}

.functions-section + li .section li.chapter-item > div:first-child {
	user-select: none;
	width: 100%;
	-webkit-user-select: none;
	border-radius: 10px;
	padding: .2rem 1rem .2rem 1rem;
	margin-bottom: .5rem;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.04);
	cursor: pointer;
}

.functions-section + li .section li.chapter-item > div:first-child:hover {
	background: rgba(255, 255, 255, 0.06);
}

/* Deprecated function tag */
/* $ <- ITS IMPORTANT! */
.chapter-item a[href$="bdscript/mute.html"]:after,
.chapter-item a[href$="bdscript/unmute.html"]:after,
.chapter-item a[href$="bdscript/modifyChannelPerms.html"]:after,
.chapter-item a[href$="bdscript/channelIDFromName.html"]:after,
.chapter-item a[href$="bdscript/giveRole.html"]:after,
.chapter-item a[href$="bdscript/takeRole.html"]:after,
.chapter-item a[href$="bdscript/serverRegion.html"]:after,
.chapter-item a[href$="bdscript/userJoinedDiscord.html"]:after {
	content: "DEPRECATED";
	color: hsl(0deg 0% 100% / 75%);
	font-size: 60%;
	margin-left: 1rem;
	background: var(--card-hover);
	padding-left: 0.5rem;
	padding-right: 0.5rem;
	border-radius: 10px;
}

.spacer {
	width: 100%;
	height: 2px;
	margin: 8px 0px;
	border-radius: 10px;
}

@media (-moz-touch-enabled: 1), (pointer: coarse) {
	.chapter li a {
		padding: 5px 0;
	}
	.spacer {
		margin: 10px 0;
	}
}

.section {
	border-width: 1px !important;
	border-top-width: 0 !important;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
	margin-top: -20px;
	list-style: none outside none;
	padding-left: 20px;
	padding-bottom: 1.25rem;
	padding-top: 2rem;
	line-height: 1.9em;
}

/* Selection */

::selection {
	background: hsl(0deg 0% 100% / 8%);
}
::-moz-selection {
	background: hsl(0deg 0% 100% / 8%);
}

/* Snowflake animation | Winter event */

.snowflakes {
	z-index: 1000;
	visibility: hidden;
	width: 200%;
	height: 100%;
	position: fixed;
	top: -150px;
	left: -350px;
	pointer-events: none;
}

.snowflakes i,
.snowflakes i:after,
.snowflakes i:before {
	background: white;
}

.snowflakes i:after,
.snowflakes i:before {
	height: 100%;
	width: 100%;
	content: ".";
	position: absolute;
	top: 0px;
	left: 0px;
	-webkit-transform: rotate(120deg);
}

.snowflakes i:before {
	-webkit-transform: rotate(240deg);
}

@-webkit-keyframes snowflakes {
	0% {
		-webkit-transform: translate3d(0, 0, 0) rotate(0deg) scale(0.6);
	}
	100% {
		-webkit-transform: translate3d(15px, 1200px, 0px) rotate(360deg)
			scale(0.6);
	}
}

.snowflakes i {
	display: inline-block;
	-webkit-animation: snowflakes 3s linear 2s 20;
	-moz-animation: snowflakes 3s linear 2s 20;
	position: relative;
}

.snowflakes i:nth-child(3n) {
	width: 22px;
	height: 6px;
	-webkit-animation-duration: 6s;
	-webkit-animation-iteration-count: infinite;
}
.snowflakes i:nth-child(3n + 1) {
	width: 30px;
	height: 7px;
	-webkit-animation-duration: 8s;
	-webkit-animation-iteration-count: infinite;
}

.snowflakes i:nth-child(3n + 2) {
	width: 34px;
	height: 10px;
	-webkit-animation-duration: 10s;
	-webkit-animation-iteration-count: infinite;
}

.snowflakes i:nth-child(7n) {
	opacity: 0.3;
	-webkit-animation-delay: 0s;
	-webkit-animation-iteration-count: infinite;
	-webkit-animation-timing-function: ease-in;
}
.snowflakes i:nth-child(7n + 1) {
	opacity: 0.4;
	-webkit-animation-delay: 1s;
	-webkit-animation-iteration-count: infinite;
	-webkit-animation-timing-function: ease-out;
}
.snowflakes i:nth-child(7n + 2) {
	opacity: 0.5;
	-webkit-animation-delay: 1.5s;
	-webkit-animation-iteration-count: infinite;
	-webkit-animation-timing-function: linear;
}
.snowflakes i:nth-child(7n + 3) {
	opacity: 0.6;
	-webkit-animation-delay: 2s;
	-webkit-animation-iteration-count: infinite;
	-webkit-animation-timing-function: ease-in;
}
.snowflakes i:nth-child(7n + 4) {
	opacity: 0.7;
	-webkit-animation-delay: 2.5s;
	-webkit-animation-iteration-count: infinite;
	-webkit-animation-timing-function: linear;
}
.snowflakes i:nth-child(7n + 5) {
	opacity: 0.8;
	-webkit-animation-delay: 3s;
	-webkit-animation-iteration-count: infinite;
	-webkit-animation-timing-function: ease-out;
}
.snowflakes i:nth-child(7n + 6) {
	opacity: 0.9;
	-webkit-animation-delay: 3.5s;
	-webkit-animation-iteration-count: infinite;
	-webkit-animation-timing-function: ease-in;
}

/* Responsive */
@media (max-width: 768px) {
    .content-card {
        padding: 24px;
    }

    .page-container {
        padding: 20px 16px 60px;
    }

    #search-wrapper {
        padding-top: 80px;
    }

    #search-close {
        top: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 1.75rem;
    }

    .searchbar-outer {
        padding: 0 16px;
    }

    #searchbar {
        height: 60px;
        font-size: 1.4rem;
        padding: 0 20px;
    }

    .search-hint {
        display: none;
    }

    .searchresults-outer {
        padding: 0 16px;
        max-height: 60vh;
    }

    ul#searchresults li a {
        padding: 16px;
    }

    ul#searchresults .search-result-title {
        font-size: 1.2rem;
    }

    ul#searchresults span.teaser {
        font-size: 1rem;
    }
}




