@import url('modal.css');
@import url('navbar.css');
@import url('styles.css');

:root {
	color-scheme: light dark;
}

/* [hidden] {
	display: none !important;
} */

body {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 14px;
	margin: 0;
	overflow: hidden;
}

hr {
	border: 0;
	border-top: 1px solid #ccc;
}

button {
	position: relative;
}

input {
	vertical-align: middle;
}

input[type="color"]::-webkit-color-swatch-wrapper {
	padding: 0;
}

input[type="color"]::-webkit-color-swatch {
	border: none;
}

textarea {
	tab-size: 4;
	white-space: pre;
	word-wrap: normal;
}

textarea.success {
	border-color: #8b8 !important;
}

textarea.fail {
	border-color: #f00 !important;
	background-color: rgba(255, 0, 0, 0.05);
}

textarea,
input {
	outline: none;
}

/* osx */

.Panel {
	-moz-user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;

	/* No support for these yet */
	-o-user-select: none;
	user-select: none;
}

.TabbedPanel {
	-moz-user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;

	/* No support for these yet */
	-o-user-select: none;
	user-select: none;
	position: relative;
	display: block;
	width: 100%;
	/* min-width: 335px; */
}

.TabbedPanel .Tabs {
	display: none;
	background-color: var(--color4);
	border: none;
	cursor: pointer;
	position: relative;
	width: 100%;
	height: 36px;
	display: flex;
	align-items: center;
	border-bottom: 1px solid rgba(195, 206, 215, 0.15);
}

.TabbedPanel .Tab {
	color: #c3ced7;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: none;
	border-bottom: 4px solid transparent;
	font-size: 11px;
	flex: 1 1 0;
	text-align: center;
	cursor: pointer;
}

.TabbedPanel .Tab.selected {
	color: var(--color1);
	background-color: var(--color4);
	border-bottom: 4px solid var(--color1);
	font-weight: bold;
	color: #3389c9;

}


.TabbedPanel .Tabs::-webkit-scrollbar {
	height: 5px;
	background: #eee;
}

.TabbedPanel .Tabs::-webkit-scrollbar-thumb {
	background: #08f3;
}

.TabbedPanel .Tabs:hover::-webkit-scrollbar-thumb {
	background: #08f;
	cursor: ew-resize;
}

.TabbedPanel .Tabs .Tab {
	padding: 10px 9px;
	text-transform: uppercase;
}

.TabbedPanel .Panels {
	/* position: absolute;
	top: 40px; */
	display: block;
	width: 100%;
}

/* Listbox */
.Listbox {
	color: #444;
	background-color: #fff;
	padding: 0;
	width: 100%;
	min-height: 180px;
	font-size: 12px;
	cursor: default;
	overflow: auto;
}

.Listbox .ListboxItem {
	padding: 6px;
	color: #666;
	white-space: nowrap;
}

.Listbox .ListboxItem.active {
	background-color: rgba(0, 0, 0, 0.04);
}

/* CodeMirror */

.CodeMirror {

	position: absolute !important;
	top: 37px;
	width: 100% !important;
	height: calc(100% - 37px) !important;

}

.CodeMirror .errorLine {

	background: rgba(255, 0, 0, 0.25);

}

.CodeMirror .esprima-error {

	color: #f00;
	text-align: right;
	padding: 0 20px;

}

/* outliner */

#outliner .opener {
	display: inline-block;
	width: 14px;
	height: 14px;
	margin: 0px 4px;
	vertical-align: top;
	text-align: center;
}

#outliner .opener.open:after {
	content: '−';
}

#outliner .opener.closed:after {
	content: '+';
}

#outliner .option {

	border: 1px solid transparent;

}

#outliner .option.drag {

	border: 1px dashed #999;

}

#outliner .option.dragTop {

	border-top: 1px dashed #999;

}

#outliner .option.dragBottom {

	border-bottom: 1px dashed #999;

}

#outliner .type {
	display: inline-block;
	width: 14px;
	height: 14px;
	color: #ddd;
	text-align: center;
}

#outliner .type:after {
	content: '●';
}

/* */

#outliner .Scene {
	color: #8888dd;
}

#outliner .Camera {
	color: #dd8888;
}

#outliner .Light {
	color: #dddd88;
}

/* */

#outliner .Object3D {
	color: #aaaaee;
}

#outliner .Mesh {
	color: #8888ee;
}

#outliner .Line {
	color: #88ee88;
}

#outliner .LineSegments {
	color: #88ee88;
}

#outliner .Points {
	color: #ee8888;
}

/* */

#outliner .Geometry {
	color: #aaeeaa;
}

#outliner .Material {
	color: #eeaaee;
}

/* */

#outliner .Script:after {
	content: '◎'
}

/*  */

button {
	color: #555;
	background-color: #ddd;
	border: 0px;
	margin: 0px;
	/* GNOME Web */
	padding: 5px 8px;
	font-size: 12px;
	text-transform: uppercase;
	cursor: pointer;
	outline: none;
}

/* button:hover {
	background-color: #fff;
}

button.selected {
	background-color: #fff;
} */

/* input,
textarea {
	border: 1px solid transparent;
	color: #444;
} */

input.Number {
	color: #08f !important;
	font-size: 12px;
	border: 0px;
	padding: 2px;
}

/* select {
	color: #666;
	background-color: #ddd;
	border: 0px;
	text-transform: uppercase;
	cursor: pointer;
	outline: none;
} */

/* UI */

#resizer {
	position: absolute;
	z-index: 2;
	/* Above #sidebar */
	top: 42px;
	right: 320px;
	width: 5px;
	bottom: 0px;
	transform: translatex(2.5px);
	cursor: col-resize;
}

#resizer:hover {
	background-color: #08f8;
	transition-property: background-color;
	transition-delay: 0.1s;
	transition-duration: 0.2s;
}

#resizer:active {
	background-color: #08f;
}

#viewport {
	position: absolute;
	top: 42px;
	left: 0;
	right: 320px;
	bottom: 0;
}

#viewport .Text {
	text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.25);
	pointer-events: none;
}

#script {
	position: absolute;
	top: 42px;
	left: 0;
	right: 320px;
	bottom: 0;
	opacity: 0.9;
}

#player {
	position: absolute;
	top: 42px;
	left: 0;
	width: 100%;
	/* right: 320px; */
	bottom: 0;
}

#menubar {
	position: absolute;
	width: 100%;
	height: 32px;
	background: #eee;
	padding: 0;
	margin: 0;
	right: 0;
	top: 0;
}

#menubar .menu {
	float: left;
	cursor: pointer;
	padding-right: 8px;
}

#menubar .menu.right {
	float: right;
	cursor: auto;
	padding-right: 0;
	text-align: right;
}

#menubar .menu .title {
	display: inline-block;
	color: #888;
	margin: 0;
	padding: 8px;
	line-height: 16px;
}

#menubar .menu .key {
	position: absolute;
	right: 10px;
	color: #ccc;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 9px;
	padding: 2px 4px;
	right: 10px;
	pointer-events: none;
}

#menubar .menu .options {
	position: fixed;
	z-index: 1;
	/* higher than resizer */
	display: none;
	padding: 5px 0;
	background: #eee;
	min-width: 150px;
	max-height: calc(100vh - 80px);
	overflow: auto;
}

#menubar .menu:hover .options {
	display: block;
	box-shadow: 0 10px 10px -5px #00000033;
}

#menubar .menu .options hr {
	border-color: #ddd;
}

#menubar .menu .options .option {
	color: #666;
	background-color: transparent;
	padding: 5px 10px;
	margin: 0 !important;
}

#menubar .menu .options .option:hover {
	color: #fff;
	background-color: #08f;
}

#menubar .menu .options .option:not(.submenu-title):active {
	color: #666;
	background: transparent;
}

#menubar .menu .options .option.toggle::before {

	content: ' ';
	display: inline-block;
	width: 16px;

}

#menubar .menu .options .option.toggle-on::before {

	content: '✔';
	font-size: 12px;

}

#menubar .submenu-title::after {
	content: '⏵';
	float: right;
}

#menubar .menu .options .inactive {
	color: #bbb;
	background-color: transparent;
	padding: 5px 10px;
	margin: 0 !important;
	cursor: not-allowed;
}



#sidebar {
	position: absolute;
	right: 0;
	top: 42px;
	bottom: 0;
	width: 320px;
	background: var(--color4);
	border-left: 1px solid var(--color3);
	overflow: auto;
	overflow-x: hidden;
}

#sidebar .Panel {
	padding: 10px;
}

#sidebar .Panel.collapsed {
	margin-bottom: 0;
}

#sidebar .Row {
	display: flex;
	align-items: center;
	min-height: 24px;
	margin-bottom: 10px;
}

#sidebar .Row .Label {

	width: 120px;

}

#tabs {
	background-color: #ddd;
	border-top: 1px solid #ccc;
}

#tabs span {
	color: #aaa;
	border-right: 1px solid #ccc;
	padding: 10px;
}

#tabs span.selected {
	color: #888;
	background-color: #eee;
}

#toolbar {
	position: absolute;
	left: 10px;
	top: 42px;
	width: 32px;
	background: #eee;
	text-align: center;
}

#toolbar button,
#toolbar input {
	height: 32px;
}

#toolbar button img {
	width: 16px;
	opacity: 0.5;
}

.Outliner {
	color: #444;
	background-color: #fff;
	padding: 0;
	width: 100%;
	height: 180px;
	font-size: 12px;
	cursor: default;
	overflow: auto;
	resize: vertical;
	outline: none !important;
}

.Outliner .option {
	padding: 4px;
	color: #666;
	white-space: nowrap;
}

.Outliner .option:hover {
	background-color: rgba(0, 0, 0, 0.02);
}

.Outliner .option.active {
	background-color: rgba(0, 0, 0, 0.04);
}



.Listbox {
	color: #444;
	background-color: #fff;
}

.Panel {
	color: #888;
}

/* --- Mobile bottom bar for menu icons --- */
@media (max-width: 720px) {
	.navbar {
		height: 42px;
		min-height: 42px;
		max-height: 42px;
	}

	.navbar-items {
		display: flex;
		align-items: center;
	}

	.mobile-bottom-bar {
		display: flex !important;
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100vw;
		height: 42px;
		background: var(--color4);
		z-index: 1000;
		border-top: 1px solid var(--color3);
		justify-content: flex-start;
		align-items: center;
		gap: 2px;
	}

	.profile-dropdown {
		display: none !important;
	}
}

@media all and (max-width: 720px) {

	#resizer {
		display: none;
	}

	#menubar .menu .options {
		max-height: calc(100% - 80px);
	}

	#menubar .menu.right {
		display: none;
	}

	#viewport {
		left: 0;
		right: 0;
		top: 42px;
		height: calc(100vh - 84px);
	}

	#script {
		left: 0;
		right: 0;
		top: 42px;
		height: calc(100vh - 84px);
	}

	#player {
		left: 0;
		right: 0;
		top: 42px;
		height: calc(100vh - 84px);
	}

	#sidebar {
		bottom: 42px;
		top: unset;
		overflow: auto;
		width: 100%;
	}

	#sidebar:not(.hidden) {
		height: 50%;
	}

	#sidebar.hidden {
		height: 42px;
		overflow: hidden;
	}

	.mobile-hidden {
		display: none !important;
	}
}

/* DARK MODE */

@media (prefers-color-scheme: dark) {

	button {
		color: #aaa;
		background-color: var(--color5);
	}





	/* UI */

	#menubar {
		background: #111;
	}

	#menubar .menu .key {
		color: #444;
		border-color: #444;
	}

	#menubar .menu .options {
		background: #111;
	}

	#menubar .menu .options hr {
		border-color: #222;
	}

	#menubar .menu .options .option {
		color: #888;
	}

	#menubar .menu .options .inactive {
		color: #444;
	}


	#sidebar .Panel.Material canvas {
		border: solid 1px #5A5A5A;
	}

	#tabs {
		background-color: #1b1b1b;
		border-top: 1px solid #222;
	}

	#tabs span {
		color: #555;
		border-right: 1px solid #222;
	}

	#tabs span.selected {
		background-color: #111;
	}

	#toolbar {
		background-color: #111;
	}

	#toolbar img {
		filter: invert(1);
	}

	.Outliner {
		background: #222;
	}

	.Outliner .option {
		color: #999;
	}

	.Outliner .option:hover {
		background-color: rgba(21, 60, 94, 0.5);
	}

	.Outliner .option.active {
		background-color: rgba(21, 60, 94, 1);
	}

	#sidebar>.Tabs {
		display: none;
	}


	.Listbox {
		color: #888;
		background: #222;
	}

	.Listbox .ListboxItem:hover {
		background-color: rgba(21, 60, 94, 0.5);
	}

	.Listbox .ListboxItem.active {
		background-color: rgba(21, 60, 94, 1);
	}

}

/* Temporary Chrome fix (#24794) */

[draggable="true"] {
	transform: translate(0, 0);
	z-index: 0;
}



/* CUSTOM STYLES */

#app-logo svg {
	width: 24px;
	height: 24px;
	border-radius: 9999px;
}

#menubar .navbar-items {
	height: 42px;
	display: flex;
	align-items: center;
	flex: 1;
	width: 100%;
}

#menubar.navbar {
	height: 42px;
	display: flex;
	align-items: center;
	background: var(--color4);
	border-bottom: 1px solid var(--color3);
}


.navbar-items .navbar-items-right {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 1;
	width: 100%;
}

#scriptTab {
	display: none !important;
}

#loading-screen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: #222;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 1rem;
	color: #fff;
	font-size: 2em;
	z-index: 9999;
}

.spinner {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 720px) {
	.mobile-sidebar-toggle {
		display: block;
		background: var(--color4);
		color: #fff;
		border: none;
		width: 100%;
		height: 42px;
		z-index: 1100;
		cursor: pointer;
		position: sticky;
		top: 0;
		border-bottom: 1px solid var(--color3);
		outline: none;
		box-shadow: none;
	}

	.mobile-sidebar-toggle:hover {
		background: var(--color3);
	}
}

@media (min-width: 601px) {
	.mobile-sidebar-toggle {
		display: none !important;
	}
}

/* --- TOOLTIP STYLES FOR ICON BUTTONS --- */
.sumo-square-icon {
	position: relative;
}

.tooltip {
	position: absolute;
	left: 50%;
	bottom: -24px;
	transform: translateX(-50%);
	background: var(--color5, #eee);
	border: 1px solid var(--color3);
	color: #c3ced7;
	padding: 4px 10px;
	font-weight: bold;
	border-radius: 6px;
	white-space: nowrap;
	pointer-events: none;
	z-index: 100;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s, visibility 0.15s;
}

.sumo-square-icon:hover .tooltip,
.sumo-square-icon:focus .tooltip {
	opacity: 1;
	visibility: visible;
}

.camera-controls-panel {
	position: absolute;
	left: 24px;
	bottom: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.camera-controls-panel button {
	background: rgba(255, 255, 255, 0.9);
	border: none;
	border-radius: 6px;
	padding: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: none;
	outline: none;
	border: 1px solid var(--color3, #ccc);
}

.camera-controls-panel button:hover {
	background: #e6f2fa;
}

.camera-controls-panel button:active {
	border-color: var(--color1);
}

@media (prefers-color-scheme: dark) {
	.camera-controls-panel button {
		background: var(--color5, #222);
		color: #3389c9;
	}

	.camera-controls-panel button:hover {
		background: var(--color4, #333);
	}
}