:root {
	/* Fonts */
	--font-family: sans-serif;

	/* Colors */
	--bg-dark: oklch(25% 0.01 245);
	--bg: oklch(30% 0.01 245);
	--bg-light: oklch(35% 0.01 245);

	--border: oklch(40% 0.01 245);

	--accent-1: oklch(75% 0.05 215);
	--accent-1-dark: oklch(60% 0.05 215);

	--text: oklch(90% 0.01 245);
	--text-muted: oklch(75% 0.01 245);

	--success: oklch(75% 0.05 175);
	--error: oklch(75% 0.05 0);
	--info: oklch(75% 0.05 315);

	/* Borders */
	--br-small: 12px;
	--br-med: 16px;
	--br-large: 24px;

	/* Sizes */
	--static-small: 24px;
	--static-medium: 32px;
	--static-large: 48px;

	/* Padding */
	--pad-small: 4px;
	--pad-medium: 8px;
	--pad-large: 16px;

	/* Chat Specific Colors */
    --user-color: oklch(65% 0.03 315);
    --assistant-color: oklch(65% 0.03 165);
}

body {
	width: 100vw;

	margin: 0px;
	padding: 2.5vw;

	background: var(--bg-dark);

	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: auto;
	flex-direction: column;

	box-sizing: border-box;

	color: var(--text);

	font-family: var(--font-family);
}

.card {
	display: flex;
	flex-direction: column;
	padding: 10px;
	margin: 10px;
	margin-top: 10px;
	background: var(--bg);
	border-radius: var(--br-large);
	border: 1px solid var(--border);
	transition-duration: 150ms;

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

form {
	display: flex;
	flex-direction: column;
	color: var(--text-muted);
}

input {
	border: none;
	border-radius: var(--br-small);
	padding: var(--pad-medium);
	background: var(--bg-light);
	color: var(--text);
	border: 1px solid var(--border);

	&:hover {
		cursor: pointer;

		&[type=text] {
			cursor:text;
		}
	}
}

select {
	border: none;
	border-radius: var(--br-small);
	padding: var(--pad-medium);
	background: var(--bg-light);
	color: var(--text);
	border: 1px solid var(--border);

	&:hover {
		cursor: pointer;
	}
}

.fg {
	display: flex;
	flex-direction: column;
	background: var(--bg);
	padding: 10px;
	border-radius: var(--br-med);
	border: 1px solid var(--border);
	margin-top: 10px;
	transition-duration: 150ms;

	input {
		margin-left: 30px;
		margin-bottom: 15px;
	}

	label {
		margin-left: 30px;
		margin-bottom: 4px;
	}
}

button {
	border: none;
	border-radius: var(--br-small);
	padding: var(--pad-medium);
	margin-top: 10px;
	background: var(--accent-1);
	transition-duration: 150ms;

	&:hover {
		background: var(--accent-1-dark);
		cursor: pointer;
	}
}

h1, h2, h3 {
	margin: 5px;
	color: var(--text);
}

.linear {
	display: flex;
	flex-direction: row;
	align-items: center;

	input {
		margin-bottom: 0px !important;
		margin-left: 8px !important;
	}
}

.chip {
	width: 35%;
	min-width: 350px;
	height: var(--static-medium);
	border-radius: var(--br-large);
	background: var(--bg-light);
	padding: 4px;
	margin: 10px;
	margin-left: 30px;
	padding-left: 15px;
	justify-content: space-between;
	display: flex;
	flex-direction: row;
	align-items: center;
	border: 1px solid var(--border);
	box-sizing: border-box;
	flex-grow: 0;
}

.remove {
	display: flex;
	width: var(--static-small);
	height: var(--static-small);
	border-radius: 100rem;
	background: #4f4a4f;
	border: 1px solid var(--border);
	margin: 0px;
	justify-content: center;
	align-items: center;
	text-align: center;
	color: var(--error);
	padding: 0px;

	&:hover {
		background: #6f4a4f;
		color: var(--text);
		cursor: pointer;
	}
}

.left, .right {
	display: flex;
	align-items: center;
}

.chartGrid {
	display: grid;
	grid-template-columns: 2;
	grid-template-rows: 2;
	min-width: 0px;
}

.chart {
	display: flex;
	min-width: 0px;
	height: 450px;
	width: 100%;
	margin-bottom: 20px;
	justify-content: center;

	.pie {
		align-items: center;
		justify-content: center;
		margin-top: 30px;
		height: 250px;
	}
}

.modal {
	width: 25vw;
	display: flex;
	position: fixed;
	flex-direction: column;

	align-items: start;
	justify-content: center;

	top: 50vh;
	left: 50vw;

	transform: translate(-50%, -50%);

	border: 1px solid var(--border);
	border-radius: var(--br-med);
	padding: 12px;

	background: var(--bg);

	#newApiKeyModal {
		width: 65vw;

		button {
			width: 25%;
		}
	}

	form {
		display: flex;
		flex-grow: 1;
		width: 100%;

		* {
			display: flex;
			flex-grow: 1;
			margin: 5px;
		}

		button {
			align-items: center;
			justify-content: center;
		}
	}

	.apiKeyContainer {
		display: flex;
		position: relative;
		width: 100%;
		margin-top: 8px;
		margin-bottom: 8px;
		padding: 0px;

		#copyApiKey {
			position: absolute;
			display: flex;
			height: 36px;
			width: 36px;
			right: 6px;
			top: 6px;
			margin: 0px;
			padding: 0px;
			align-items: center;
			justify-content: center;
			box-sizing: border-box;
			border-radius: var(--br-med);
			background: var(--bg-light);
			border: 1px solid var(--border);
		}

		#apiKey {
			display: flex;
			position: relative;

			overflow-y: hidden;
			overflow-x: scroll;
			white-space: nowrap;

			box-sizing: border-box;

			width: 100%;

			padding: 12px;
			flex-grow: 0;
			margin: 0px;

			color: var(--text-muted);
		}
	}
}

.notification {
	border-radius: 100rem;
	position: fixed;
	display: flex;
	top: -150px;
	left: 50vw;
	padding: 12px;
	background: var(--success);
	transform: translateX(-50%);
	align-items: center;
	justify-content: center;
	color: black;
	border: 1px solid white;
	transition: all 450ms cubic-bezier(.16,.93,0,1.32);
	z-index: 1000;
}

.switch {
	width: 48px;
	height: 24px;
	background: var(--bg-dark);
	border-radius: 100rem;
	display: block;
	position: relative;
	align-items: center;
	justify-content: center;
	transition: all 215ms linear;
	margin-left: 10px;

	&:hover {
		cursor: pointer;
	}

	input {
		visibility: hidden; width: 0px; height: 0px;
	}

	&::after {
		content: '';
		display: block;
		position: absolute;
		top:4px;left:4px;
		width: 16px;
		aspect-ratio: 1;
		border-radius: 100rem;
		background: var(--bg-light);
		backdrop-filter: blur(4px);
		transition: all 125ms ease-in-out;
	}

	&:has(input:checked)::after {
		transform: translateX(24px);
		background: var(--bg-dark);
	}

	&:has(input:checked) {
		background: var(--accent-1);
	}
}

.info {
	width: 16px;
	aspect-ratio: 1;
	border-radius: 100rem;
	border: 1px solid var(--info);
	padding: 0px;
	margin-left: 5px;
	justify-content: center;
	align-items: center;
	display: flex;
	flex-direction: row;
	font-size: 12px;
	transition: all 150ms ease;
	position: relative;
	font-weight: 100;
	color: var(--info);

	&:hover {
		cursor:pointer;
		transform:scale(1.05);

		.popover{
			opacity: 1;
			visibility: visible;

			&::after {
				opacity: 1;
				visibility: visible;
			}

			&::before {
				opacity: 1;
				visibility: visible;
			}
		}
	}

	p {
		padding: 0px;
		margin: 0px;
	}

	.popover{
		display: inline-block;
		flex-direction: row;
		position: absolute;
		opacity: 0;
		top: 0px;
		left: 50%;
		background: var(--bg);
		border-radius: 10px;
		width: max-content;
		max-width: 245px;
		padding: 5px;
		transform: translate(calc(-50%), calc(-100% - 12px));
		transition: all 150ms ease;
		border: 1px solid var(--info);
		background: var(--bg);
		font-weight: 100;
		visibility: hidden;
		color: var(--text-muted);

		&::after {
			content: '';
			display: block;
			position: absolute;
			width: 8px;
			height: 4px;
			background: var(--bg);
			clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
			bottom:0px;
			right:50%;
			transform: rotateZ(180deg) translate(-50%, -4px);
			opacity: 0;
			visibility: hidden;
		}

		&::before {
			content: '';
			display: block;
			position: absolute;
			width: 10px;
			height: 5px;
			background: var(--info);
			clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
			bottom:0px;
			right:50%;
			transform: rotateZ(180deg) translate(-50%, -5px);
			opacity: 0;
			visibility: hidden;
		}
	}
}

.danger {
	border-color: var(--error);
	color: var(--error);
	align-items: center;

	button {
		width: 100%;
	}

	h3 {
		color: var(--error);
	}
}

.dropdown {
	display: flex;
	flex-direction: column;
	height: 0px;
	overflow: hidden;
}

.moduleConfigHeader {
	display: flex;
	flex-direction: row;
	align-items: center;

	&:has(.dropdownController:checked) + .dropdown {
		transition: all 150ms ease;
		height: fit-content;
	}
}

.dropdownControllerContainer {
	display: flex;
	width: 24px;
	height: 24px;
	background: url('/images/arrow-down.svg');
	transform: rotateZ(-90deg);
	margin:0px !important;
	padding: 0px;
	transition: all 150ms ease;

	&:hover {
		cursor: pointer;
	}

	&:has(.dropdownController:checked) {
		transform: rotateZ(0deg);
	}

	.dropdownController {
		visibility: hidden;
		margin: 0px;
		padding: 0px;
	}
}

@media (max-width: 1080px) {
	:root {
		/* Border Radii */
		--br-small: 24px;
		--br-med: 24px;
		--br-large: 32px;

		/* Sizes */
		--static-small: 40px;
		--static-medium: 48px;
		--static-large: 48px;

		/* Padding */
		--pad-small: 12px;
		--pad-medium: 16px;
		--pad-large: 28px;
	}

	body {
		grid-template-columns: 1fr;
	}

	.card {
		&.title {
			grid-column: span 1 !important;
		}
	}

	.modal.login {
		transform: translate(-50%, -50%) scale(2);
		max-width: 75vw;
	}

	.switch {
		transform: scale(1.15);
	}

	button {
		font-size: 16px;
	}

	input {
		font-size: 16px;
	}

	select {
		font-size: 18px;
	}

	h1 {
		font-size: 48px;
	}

	h2 {
		font-size: 32px;
	}

}