:root {
	--panel-bg: #1a1a1a;
	--item-bg: #252525;
	--accent: #f1c40f;
	--text: #eeeeee;
	--border: #333333;
	--input-bg: #111111;
}

/* Base Layout */
body {
	margin: 0;
	font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
	display: flex;
	height: 100vh;
	background: #111111;
	color: var(--text);
	overflow: hidden;
}

/* 3D Viewer Container */
#viewer {
	flex-grow: 1;
	position: relative;
	cursor: grab;
}

#viewer:active {
	cursor: grabbing;
}

/* Student Name Overlay */
#student-display {
	position: absolute;
	top: 20px;
	left: 20px;
	font-size: 24px;
	font-weight: bold;
	color: var(--accent);
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
	pointer-events: none;
	z-index: 5;
}

/* Sidebar Panel */
#ui-panel {
	width: 100%;
	background: var(--panel-bg);
	padding: 20px;
	overflow-y: auto;
	border-left: 1px solid var(--border);
	box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
	z-index: 10;
}

/* Typography & Headers */
h2 {
	margin: 0 0 10px 0;
	color: var(--accent);
	font-size: 1.3rem;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.section-header {
	font-size: 10px;
	color: #777;
	text-transform: uppercase;
	letter-spacing: 2px;
	margin: 20px 0 10px 0;
	border-bottom: 1px solid var(--border);
	padding-bottom: 5px;
}

/* General Control Blocks (Stacking Layout) */
.control-block {
	margin-bottom: 8px;
	background: var(--item-bg);
	padding: 12px;
	border-radius: 6px;
	border: 1px solid var(--border);
}

.input-field {
	width: 100%;
	padding: 10px;
	background: var(--input-bg);
	border: 1px solid #444;
	color: white;
	border-radius: 4px;
	box-sizing: border-box;
	font-size: 14px;
}

/* Environment Row Layout */
.scene-tool {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 11px;
	color: #bbb;
	margin-bottom: 12px;
}

.scene-tool:last-child { margin-bottom: 0; }

.val-display {
	color: var(--accent);
	font-family: 'Courier New', monospace;
	min-width: 45px;
	text-align: right;
}

input[type="range"] {
	width: 130px;
	accent-color: var(--accent);
	cursor: pointer;
}

/* Part Color Selection (Side-by-Side Compact Layout) */
.part-control {
	margin-bottom: 6px;
	background: var(--item-bg);
	padding: 8px 12px;
	border-radius: 6px;
	border: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

.label-compact {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: #999;
	white-space: nowrap;
	flex-basis: 110px; /* Fixed gutter for alignment */
	min-width: 110px;
	flex-shrink: 0;
}

.swatch-grid-compact {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	flex-grow: 1;
}

.swatch {
	width: 24px;
	height: 24px;
	border-radius: 4px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: transform 0.15s ease, border-color 0.15s ease;
	box-sizing: border-box;
}

.swatch:hover {
	transform: scale(1.1);
	border-color: rgba(255, 255, 255, 0.3);
}

.swatch.active {
	border-color: #ffffff;
	transform: scale(1.15);
	box-shadow: 0 0 8px var(--accent);
	z-index: 2;
}

/* Buttons (Stacking Layout) */
.btn {
	display: block;
	width: 100%;
	padding: 12px;
	border: none;
	border-radius: 6px;
	font-weight: bold;
	cursor: pointer;
	margin-top: 10px;
	transition: background 0.2s, transform 0.1s;
	text-transform: uppercase;
	font-size: 12px;
}

.btn-primary { background: var(--accent); color: #111111; }
.btn-primary:hover { background: #ffffff; }
.btn-secondary { background: #444444; color: white; }
.btn-secondary:hover { background: #555555; }

#loading-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.9);
	padding: 25px;
	border: 1px solid var(--accent);
	border-radius: 8px;
	z-index: 1000;
	text-align: center;
}
