html, body {
    background: rgb(0, 0, 0);    /* Set background color */
    overflow: hidden;            /* Prevent scrolling */
    margin: 0px;                 /* Remove default margin */
}


canvas {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	user-select: none;
	background: #000;
	background-color: #000;
	background-color: rgb(0, 0, 0);
}

.background-text {
	font-family: "Karla", sans-serif;
	font-size: 64px;
	font-weight: 100;
	color: rgba(255, 255, 255, 0.3);
	z-index: -1;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translateX(-50%) translateY(-150%);
	display: none;
}

.phong-logo {
	width: 64px;
	opacity: 0.5;
	display: block;
	position: absolute;
	left: 5px;
	top: 5px;
	cursor: pointer;
	transition: 0.3s ease all;
}
.phong-logo:hover {
	opacity: 1;
}

#phong-logo-center {
	width: 15%;
	min-width: 180px;
	max-width: 512px;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1001;
	display: none;
	/* Add these lines to make the element not selectable */
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

@keyframes pulse {
	0% {
		opacity: 0.2;
	}
	50% {
		opacity: 1;
	}
	100% {
		opacity: 0.2;
	}
}

#container {
	z-index: 2;
	width: 100vw;
	height: 100vh;
	position: absolute;
	left: 0;
	right:0;
	top:0;
	bottom:0;
	background: #000;
}

#toolbar-panel {
	position: relative;
	padding: 12px;
	margin-right: 60px; /* Space for hamburger menu button */
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	min-height: 48px; /* Match hamburger button height */
	z-index: 20;
}

#toolbar-panel .toolbar-button {
	flex: 1;
	min-width: 0;
	height: 50px; /* Updated to 50px */
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile responsive toolbar */
@media (max-width: 768px) {
	#toolbar-panel {
		padding: 8px;
		margin-right: 50px; /* Less space on mobile */
		gap: 6px;
	}
	
	#toolbar-panel .toolbar-button {
		height: 44px; /* Smaller on mobile */
		font-size: 11px;
	}
	
	#switchProjectionButton {
		font-size: 10px !important;
		padding: 6px 8px !important;
	}
	
	.resolution-selector {
		font-size: 11px !important;
		height: 44px !important;
		padding: 6px 24px 6px 10px !important;
		min-width: 120px !important;
	}
}

#switchProjectionButton {
	font-size: 12px;
	padding: 8px 10px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#resolution-selector {
	/* Inherits from .resolution-selector class */
}

#info-panel {
	background-color: rgba(0, 0, 0, 0.8);
	border-radius: 4px;
	bottom: 10px;
	font-family: "Karla", sans-serif;
	padding: 12px 32px 12px 80px;
	position: absolute;
	left: 10px;
	z-index: 3;
	min-width: 150px;
	display: none; /* Hide by default */
}

@media screen and (min-width: 769px) {
	#info-panel {
		display: block; /* Show when screen width is over 768px */
	}
}

#info-panel .icon {
	color: #e13e13 !important;
	position: absolute;
	right: 6px;
	top: 6px;
	display: none;
}

#info-panel .title,
#info-panel .subtitle {
	margin: 0;
	padding: 0;
}

#info-panel .title {
	color: rgba(255, 255, 255, 0.7);
	font-weight: 600;
	font-size: 14px;
}

#info-panel .subtitle {
	color: rgba(255, 255, 255, 0.5);
	font-weight: 100;
	font-size: 14px;
}

.loading-spinner {
	color: rgba(255, 255, 255, 0.3);
	font-size: 18px;
	position: relative;
	top: 50%;
	left: 50%;
	transform: translateX(-50%) translateY(-50%);
	margin-left: 186px;
	margin-top: -52px;
	z-index: -1;
}

/* Loading Overlay */
#loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #000;
	z-index: 10;
	display: none;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	transition: opacity 200ms ease-in-out;
}

#loading-overlay .spinner {
	border: 4px solid rgba(255, 255, 255, 0.1);
	border-top: 4px solid rgba(255, 255, 255, 0.8);
	border-radius: 50%;
	width: 50px;
	height: 50px;
	animation: spin 1s linear infinite;
}

#loading-overlay .loading-text {
	color: rgba(255, 255, 255, 0.6);
	font-size: 14px;
	margin-top: 20px;
	font-family: Arial, sans-serif;
	letter-spacing: 1px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Disable clicks during transitions */
.transitioning {
	pointer-events: none;
	opacity: 0.6;
}

#drag-drop-overlay {
	display: none;
	position: fixed;
	top: 55px;
	bottom: 80px;
	left: 20px;
	right: 75px;
	background-color: rgba(0, 0, 0, 0.7);
	z-index: 1000;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	font-family: Arial, Helvetica, sans-serif;
	color: white;
	border-radius: 12px;
	border: 1px solid #fff;
}

#drag-drop-overlay .message {
	font-size: 18px;
	margin-top: 5px;
}

#drag-drop-overlay .icon {
	font-size: 86px;
}

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

#hamburger-menu {
	position: fixed;
	top: 10px;
	right: 10px;
	font-size: 26px;
}

#library-panel {
	position: fixed;
	right: -100%;
	top: 0;
	bottom: 0;
	width: 80%;
	max-width: 400px;
	background-color: rgba(0, 0, 0, 0.85);
	color: white;
	transition: right 0.3s ease-in-out;
	z-index: 100;
	display: flex;
	flex-direction: column;
	overflow: hidden; /* Panel itself doesn't scroll, only content inside */
}

#library-panel::-webkit-scrollbar {
	width: 0;
	height: 0;
	background: transparent; /* Chrome/Safari/Webkit */
}

/* Responsive adjustments */
@media (max-width: 768px) {
	#library-panel {
		width: 100%;
		max-width: none;
	}
}

#library-panel.active {
	right: 0;
}

#library-content {
	padding: 0;
	flex: 1;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

#library-content::-webkit-scrollbar {
	width: 8px;
}

#library-content::-webkit-scrollbar-track {
	background: transparent;
}

#library-content::-webkit-scrollbar-thumb {
	background-color: rgba(255, 255, 255, 0.3);
	border-radius: 4px;
}

#library-content::-webkit-scrollbar-thumb:hover {
	background-color: rgba(255, 255, 255, 0.5);
}

#library-tree {
	padding: 12px;
}

#library-tree ul {
	list-style-type: none;
	padding-left: 8px;
	margin: 0;
	padding: 0px;
	margin-top: 0;
}

#library-tree li {
	margin-bottom: 10px;
	background-color: rgba(255, 255, 255, 0.05);
	display: block;
	border-radius: 6px;
}


#library-tree .folder > span {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	border-radius: 8px;
	margin-bottom: 10px;
	font-weight: 600;
	font-size: 0.95em;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
	border: 1px solid rgba(255, 255, 255, 0.1);
	cursor: pointer;
	user-select: none;
	transition: all 0.2s ease;
	position: relative;
	min-height: 48px; /* Mobile-friendly touch target */
}

/* Add chevron indicator */
#library-tree .folder > span::before {
	content: '▶';
	font-size: 0.7em;
	color: rgba(255, 255, 255, 0.6);
	transition: transform 0.3s ease;
}

/* Rotate chevron when expanded */
#library-tree .folder.expanded > span::before {
	transform: rotate(90deg);
}

/* Hover effect */
#library-tree .folder > span:hover {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
	border-color: rgba(255, 255, 255, 0.2);
	transform: translateX(2px);
}

/* Active/pressed effect */
#library-tree .folder > span:active {
	transform: scale(0.98);
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
}

#library-tree .file {
	cursor: pointer;
	color: #e0e0e0;
	font-size: 0.66em;
	word-break: break-word; /* For most modern browsers */
	overflow-wrap: break-word; /* Alternative property name, also works in most modern browsers */
	hyphens: auto; /* Optionally adds hyphens where the word breaks */
}

#library-tree .file:hover {
}

#library-tree .file {
	cursor: pointer;
	padding: 5px;
	transition: 0.1s all ease-out;
	border: 1px solid transparent;
	align-items: center;
	margin-bottom: 5px;
}

#library-tree .file:hover {
	border: 1px solid rgba(255, 255, 255, 0.25);
	background-color: rgba(255, 255, 255, 0.2);
}

#library-tree .file.current {
	background-color: #e0e0e0;
	color: #000;
	font-weight: bold;
}

#library-tree .file-thumbnail {
	display: block;
	width: 100%;
	min-height: 128px;
	object-fit: cover;
	object-position: center;
	border-radius: 6px;
	transition: 0.2s all ease;
}

#library-tree .file-name {
	flex-grow: 1;
}

#library-tree .file img {
	transition: 0.2s all ease;
}

#library-tree .file.current img {
	opacity: 0.66;
}

.toolbar-button {
	padding: 12px;
	background-color: rgba(0, 0, 0, 0.5);
	color: rgba(255, 255, 255, 0.8);
	border: 1px solid transparent;
	z-index: 4;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease-out;
	cursor: pointer;
	font-family: Arial, sans-serif;
	font-size: 18px;
	z-index: 1000;
	box-shadow: 1px 1px 0px transparent;

	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.toolbar-button:hover {
	color: #fff;
	border: 1px solid #fff;
}

.toolbar-button.active {
	background-color: rgba(255, 255, 255, 1);
	color: #000;
	font-weight: bold;
	box-shadow: 4px 4px 0px #000;
}

.toolbar-button.active:hover {
	color: #000;
}

/* Resolution Selector */
.resolution-selector {
	min-width: 180px;
	height: 50px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	margin-left: 8px;
	font-family: "Karla", sans-serif;
	padding: 8px 32px 8px 12px;
	background-color: rgba(0, 0, 0, 0.5);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' opacity='0.8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 10px;
	color: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	transition: all 0.2s ease;
	outline: none;
}

.resolution-selector:hover {
	background-color: rgba(0, 0, 0, 0.7);
	border-color: rgba(255, 255, 255, 0.4);
	color: #fff;
}

.resolution-selector:focus {
	border-color: rgba(255, 255, 255, 0.6);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.resolution-selector option {
	background-color: rgba(0, 0, 0, 0.95);
	color: #fff;
	padding: 10px;
	font-weight: 500;
}
