: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 {
	border-radius: 7px; /* Rounds the edges of the input */
	background-color: #333;
    color: white;
	vertical-align: middle; /* Vertically aligns the input element with surrounding content */
	padding: 10px; /* Adds some padding inside the input for better spacing */
	border: none; /* Optional: Removes the default border for a cleaner look */
  }

	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;
	background: grey;
	color: white
}

	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;
	background-color: #121212;
}

.TabbedPanel .Tabs {
	position: relative;
	z-index: 1; /** Above .Panels **/
	display: block;
	width: 100%;
	white-space: pre;
	overflow: hidden;
	overflow-x: auto;
	background-color: #121212;
}

	.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;
		
	}

	.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: black;
	background-color: #ff914d; /* Fallback for browsers that don't support gradients */
	background-image: linear-gradient(to bottom, #ffa769, #ff914d, #ff7a2e); /* Nice orange gradient */
	border: 0px;
	margin: 0px; /* GNOME Web */
	padding: 5px 8px;
	font-size: 12px;
	cursor: pointer;
	outline: none;
	border-radius: 5px; /* Rounded edges */
}

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

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

input, textarea {
	border: 1px solid transparent;
	color: white;
}

input.Number {
	color: #ff914d;
	font-size: 12px;
	border: 0px;
	padding: 2px;
}

select {
	color: white;
	background-color:  #333;
	border-radius: 4px;
	border: 0px;
	text-transform: uppercase;
	cursor: pointer;
	outline: none;
}

	select:hover {
		background-color:  #333;
	}

/* UI */

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

	#resizer:hover {
		background-color: rgba(9, 10, 10, 0.533);
		transition-property: background-color;
		transition-delay: 0.1s;
		transition-duration: 0.2s;
	}

	#resizer:active {
		background-color:black;
	}

#viewport {
	position: absolute;
	top: 32px;
	left: 0;
	right: 350px;
	bottom: 0;
}

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

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

#player {
	position: absolute;
	top: 32px;
	left: 0;
	right: 350px;
	bottom: 0;
}

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

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

	#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: #222222;
			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: white;
				background-color: transparent;
				padding: 5px 10px;
				margin: 0 !important;
			}

				#menubar .menu .options .option:hover {
					color: black;
					background-color: #ff914d;
				}

				#menubar .menu .options .option:not(.submenu-title):active {
					color: #222222;
					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: 32px;
			bottom: 0;
			width: 350px;
			background: #222222;
			overflow: auto;
			overflow-x: hidden;
		}
		
		/* For WebKit browsers (Chrome, Safari, newer Edge) */
		#sidebar::-webkit-scrollbar {
			width: 3px; /* Very slim scrollbar width */
		}
		
		#sidebar::-webkit-scrollbar-track {
			background-color: transparent; /* Transparent track */
		}
		
		#sidebar::-webkit-scrollbar-thumb {
			background-color: rgba(0, 0, 0, 0.0); /* Transparent thumb - adjust alpha for slight visibility if needed */
		}

	#sidebar .Panel {
		color: #888;
		padding: 10px;
		border-top: 1px solid #ccc;
	}

	#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: #222222;
	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: #222222;
		text-align: center;
		border-radius: 5px; /* Rounded edges for a cleaner look */
	}
	#toolbar button, #toolbar input {
		height: 32px;
		background: #222222;
	}

		#toolbar button img {
			width: 16px;
			opacity: 0.8;
			color: white
		}

		.Outliner {
			color: white;
			background-color: #444;
			padding: 5px;
			width: 95%;
			height: 180px;
			font-size: 12px;
			cursor: default;
			overflow: auto;
			resize: vertical;
			outline: none !important;
			margin-left: 10px; /* Add left margin */
			margin-right: 20px; /* Add right margin */
			border-radius: 5px; /* Add rounded corners */
			box-sizing: border-box; /* Added to fix overflow issue */
		}

/* Slim and transparent scrollbar for .Outliner */
.Outliner::-webkit-scrollbar {
    width: 3px; /* Very slim scrollbar width */
}

.Outliner::-webkit-scrollbar-track {
    background-color: transparent; /* Transparent track */
}

.Outliner::-webkit-scrollbar-thumb {
    background-color: #ff914d; /* Transparent thumb */
	border-radius: 5px; 
}

.Outliner .option {
	padding: 4px;
	color: white;
	white-space: nowrap;
	margin-left: 5px; /* Added margin-left here */
}

.Outliner .option:hover {
	background-color: rgba(255, 145, 77, 0.2); /* Transparent orange background */
	border-radius: 5px; /* Added border-radius for hover */

}

.Outliner .option.active {
	background-color: #ff914d;
	color: black;
	border-radius: 5px; /* Adjust the value to control roundness */

	padding: 5px 5px; /* Optional: Add padding for better spacing around the text */
}

.TabbedPanel .Tabs {
	background-color: #222222;
	border-top: 1px solid #222222;
	margin-top: 5px;
}

	.TabbedPanel .Tab {
		color: #aaa;
		
	}

	.TabbedPanel .Tab.selected {
		color: orange;
		background-color: #2b2b2b; /* Fallback color */
		background-image: #444; /* Deeper bottom orange */
		border-radius: 4px;
		font-family: 'Inter', system-ui, sans-serif; /* Inter first, then fallbacks */
		margin-left: 5px;
		font-weight: bold;
	}
.Listbox {
	color: #444;
	background-color: #888;
}

.Panel {
	color: #888;
}

/* */

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

	#resizer {
		display: none;
	}

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

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

	#viewport {
		left: 0;
		right: 0;
		top: 32px;
		height: calc(100% - 352px);
	}

	#script {
		left: 0;
		right: 0;
		top: 32px;
		height: calc(100% - 352px);
	}

	#player {
		left: 0;
		right: 0;
		top: 32px;
		height: calc(100% - 352px);
	}

	#sidebar {
		left: 0;
		width: 100%;
		top: calc(100% - 320px);
		bottom: 0;
	}

}

/* DARK MODE */

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

	button {
		color: #aaa;
		background-color: #222;
	}

		button:hover {
			color: #ccc;
			background-color: #444;
		}

		button.selected {
			color: #fff;
			background-color: #08f;
		}

	input, textarea {
		background-color: #222;
		border: 1px solid transparent;
		color: #888;
	}

	select {
		color: #aaa;
		background-color: #222;
	}

		select:hover {
			color: #ccc;
			background-color: #444;
		}

	/* 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 {
		background-color: #222222;
	}

		#sidebar .Panel {
			border-top: 1px solid #222222;
		}

		#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);
		}

	.TabbedPanel .Tabs {
		background-color: #222222;
		border-top: 1px solid #222;
	}

		.TabbedPanel .Tabs::-webkit-scrollbar {
			background: #111;
		}

		.TabbedPanel .Tab {
			color: #555;
			border-right: 1px solid #222;
		}

		.TabbedPanel .Tab.selected {
			color: #888;
			background-color: #111;
		}

	.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;
}
#loading-overlay {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader {
    position: relative; /* For positioning the spinner segment */
    width: 30px;
    height: 30px;
    transform: translateX(-25%); /* Shift loader to the left to center over editor - adjust if needed */
}

.loader::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; /* Make base circle transparent if you only want the spinner outline to be visible, otherwise keep #333 or desired base color */
    border-radius: 50%;
    z-index: 0; /* Place base circle behind spinner */
}

.loader::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid transparent; /* Create space for the gradient spinner */
    border-top: 8px solid; /* Solid border for the spinning part, color will be gradient */
    border-color: black; /* Fallback color if gradient fails */
    border-top-color: linear-gradient(to bottom, black 0%, #ff914d 100%); /* Apply orange-black gradient to the top border */
    animation: spin 2s linear infinite;
    z-index: 1; /* Place spinner above base circle */
    background-color: transparent; /* Explicitly set background to transparent to ensure inside is empty */
    background-clip: padding-box; /* Clip gradient to border-box */
    -webkit-mask-image: linear-gradient(#fff 50%, transparent 50%); /* Mask to make it half circle spinner */
    mask-image: linear-gradient(#fff 50%, transparent 50%); /* Standard mask property */
}


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
  
  /* Dark mode adjustments for loader if needed */
  @media (prefers-color-scheme: dark) {
	.loader {
	  border: 16px solid #333; /* Dark grey for dark mode */
	  border-top: 16px solid #ff914d; /* Orange color remains same */
	}
  }

  .user-container {
	position: relative; /* For dropdown positioning */
}

.dropdown {
	display: none;
	position: absolute;
	right: 0;
	top: 100%;
	margin-top: 2px;
	background-color: #222; /* Match menu background */
	border: 1px solid #333;
	border-radius: 3px;
	padding: 5px 0;
	min-width: 120px;
	z-index: 10; /* Ensure dropdown is above other elements */
}

.dropdown-item {
	padding: 5px 15px;
	cursor: pointer;
}

.dropdown-item:hover {
	background-color: #333;
}