/* ========================================================
   LiDimension - Render Page Styling
   Inherits variables & typography from global.css
   ======================================================== */

/* Ensure the canvas and base background stay the original #111 */
html,
body {
	height: 100%;
	background: #111;
	color: var(--cream-100);
}

body {
	position: relative;
}

canvas {
	display: block;
}

/* ========================================================
   Top Bar
   ======================================================== */

#topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10;

	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;

	height: 52px;
	padding: 0 18px;

	background: rgba(6, 13, 32, 0.88);
	border-bottom: 1px solid rgba(147, 164, 193, 0.16);

	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brand-group {
	display: flex;
	align-items: center;
	gap: 12px;
}

#brand {
	display: flex;
	align-items: center;
	text-decoration: none;
	user-select: none;
}

.brand-name {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.04em;
	color: var(--cream-100);
}

.brand-name span {
	color: var(--slate-400);
}

.brand-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--slate-400);
	background: rgba(24, 43, 87, 0.45);
	border: 1px solid rgba(147, 164, 193, 0.2);
	padding: 3px 8px;
	border-radius: 4px;
}

.brand-eyebrow::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--cream-100);
	box-shadow: 0 0 10px rgba(252, 241, 208, 0.7);
}

/* ========================================================
   View Tabs
   ======================================================== */

#view-tabs {
	display: flex;
	align-items: center;
	gap: 4px;
	background: rgba(6, 13, 32, 0.65);
	padding: 3px 4px;
	border-radius: 6px;
	border: 1px solid rgba(147, 164, 193, 0.14);
}

.view-tab {
	position: relative;

	border: 1px solid transparent;
	outline: none;

	padding: 6px 14px;
	border-radius: 4px;

	background: transparent;
	color: var(--slate-400);

	font: inherit;
	font-size: 13px;
	font-weight: 500;

	cursor: pointer;
	transition:
		color var(--transition),
		background var(--transition),
		border-color var(--transition),
		box-shadow var(--transition);
}

.view-tab:hover {
	color: var(--cream-100);
	background: rgba(24, 43, 87, 0.45);
}

.view-tab.active {
	color: var(--cream-100);
	font-weight: 600;
	background: rgba(24, 43, 87, 0.85);
	border-color: rgba(147, 164, 193, 0.25);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	text-shadow: 0 0 12px rgba(252, 241, 208, 0.35);
}

/* Tooltip for view tabs */
.view-tab[data-tooltip]::before {
	content: "";
	position: absolute;
	top: calc(100% + 4px);
	left: 50%;
	transform: translateX(-50%) translateY(-4px);

	border-width: 0 5px 6px 5px;
	border-style: solid;
	border-color: transparent transparent rgba(147, 164, 193, 0.25) transparent;

	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 180ms ease,
		transform 180ms ease,
		visibility 180ms ease;
	z-index: 51;
}

.view-tab[data-tooltip]::after {
	content: attr(data-tooltip);
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(-4px);

	padding: 6px 11px;
	border-radius: 6px;

	background: rgba(6, 13, 32, 0.94);
	border: 1px solid rgba(147, 164, 193, 0.25);
	box-shadow:
		0 6px 20px rgba(0, 0, 0, 0.5),
		0 0 10px rgba(24, 43, 87, 0.4);

	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);

	color: var(--cream-100);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.02em;
	white-space: nowrap;

	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 180ms ease,
		transform 180ms ease,
		visibility 180ms ease;
	z-index: 50;
}

.view-tab[data-tooltip]:hover::before,
.view-tab[data-tooltip]:hover::after {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.topbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nav-btn {
	color: var(--slate-400);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-decoration: none;
	padding: 6px 12px;
	border-radius: 5px;
	border: 1px solid rgba(147, 164, 193, 0.2);
	background: rgba(6, 13, 32, 0.6);
	transition:
		color var(--transition),
		background var(--transition),
		border-color var(--transition),
		box-shadow var(--transition);
}

.nav-btn:hover {
	color: var(--cream-100);
	background: var(--navy-800);
	border-color: rgba(252, 241, 208, 0.35);
	box-shadow: 0 0 10px rgba(252, 241, 208, 0.15);
}

/* ========================================================
   Info HUD
   ======================================================== */

#info {
	position: fixed;
	top: 64px;
	left: 16px;
	z-index: 5;

	color: var(--cream-100);
	background: rgba(6, 13, 32, 0.84);
	border: 1px solid rgba(147, 164, 193, 0.18);
	border-radius: 8px;
	padding: 12px 16px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);

	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);

	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	line-height: 1.55;

	white-space: pre;
	pointer-events: none;
}

/* ========================================================
   Point Cloud Disclaimer
   ======================================================== */

#pointcloud-disclaimer {
	display: none;
	position: fixed;
	top: 64px;
	right: 16px;
	max-width: 380px;
	z-index: 8;

	background: rgba(6, 13, 32, 0.9);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(252, 241, 208, 0.28);
	border-radius: 8px;
	padding: 12px 16px;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.5),
		0 0 18px rgba(24, 43, 87, 0.5);

	color: var(--slate-400);
	font-size: 12px;
	line-height: 1.55;
	animation: fadeIn 220ms ease;
}

/* Shown automatically in Point Cloud tab when active */
body:has(.view-tab[data-view="pointCloud"].active) #pointcloud-disclaimer {
	display: block;
}

.pc-disclaimer-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.pc-disclaimer-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--cream-100);
	box-shadow: 0 0 10px rgba(252, 241, 208, 0.8);
}

.pc-disclaimer-title {
	color: var(--cream-100);
	font-weight: 600;
	font-size: 11.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.pc-disclaimer-text {
	margin: 0;
}

.pc-disclaimer-text strong {
	color: var(--cream-100);
	font-weight: 600;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ========================================================
   Playback Bar
   ======================================================== */

#playback {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 10;

	display: flex;
	align-items: center;
	gap: 14px;

	padding: 10px 16px;

	background: rgba(6, 13, 32, 0.88);
	border: 1px solid rgba(147, 164, 193, 0.18);
	border-radius: 8px;

	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

#play-button {
	width: 36px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;

	padding: 0;

	border: 1px solid rgba(147, 164, 193, 0.25);
	border-radius: 6px;

	background: rgba(24, 43, 87, 0.65);
	color: var(--cream-100);
	font-size: 13px;

	cursor: pointer;
	transition:
		background var(--transition),
		border-color var(--transition),
		transform var(--transition),
		box-shadow var(--transition);
}

#play-button:hover {
	background: var(--navy-800);
	border-color: rgba(252, 241, 208, 0.45);
	box-shadow: 0 0 10px rgba(252, 241, 208, 0.25);
	transform: translateY(-1px);
}

#frame-slider {
	flex: 1;

	min-width: 0;
	height: 6px;

	cursor: pointer;
	accent-color: var(--cream-100);
	background: rgba(147, 164, 193, 0.2);
	border-radius: 3px;
	outline: none;
}

#frame-slider::-webkit-slider-thumb {
	appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--cream-100);
	box-shadow: 0 0 8px rgba(252, 241, 208, 0.7);
	cursor: pointer;
	transition: transform 120ms ease;
}

#frame-slider::-webkit-slider-thumb:hover {
	transform: scale(1.18);
}

#frame-label {
	min-width: 130px;

	color: var(--slate-400);

	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	font-weight: 500;
	text-align: right;

	white-space: nowrap;
}

/* ========================================================
   Controls Hint (OrbitControls scheme)
   ======================================================== */

#controls-hint {
	position: fixed;
	bottom: 76px;
	right: 16px;
	z-index: 5;

	display: flex;
	flex-direction: column;
	gap: 6px;

	padding: 10px 14px;

	background: rgba(6, 13, 32, 0.82);
	border: 1px solid rgba(147, 164, 193, 0.16);
	border-radius: 8px;

	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);

	pointer-events: none;
	user-select: none;
}

.hint-header {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 2px;
}

.hint-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--cream-100);
	box-shadow: 0 0 8px rgba(252, 241, 208, 0.7);
}

.hint-title {
	color: var(--cream-100);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hint-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.hint-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	font-size: 11.5px;
}

.hint-action {
	color: var(--slate-400);
}

.hint-keys {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.hint-keys kbd {
	padding: 2px 6px;
	border-radius: 3px;
	background: rgba(24, 43, 87, 0.65);
	border: 1px solid rgba(147, 164, 193, 0.25);
	color: var(--cream-100);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 10.5px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========================================================
   Responsive
   ======================================================== */

@media (max-width: 680px) {
	#topbar {
		padding: 0 12px;
		gap: 8px;
	}

	.brand-eyebrow {
		display: none;
	}

	.nav-btn {
		padding: 5px 8px;
	}

	#pointcloud-disclaimer {
		left: 12px;
		right: 12px;
		top: 60px;
		max-width: none;
	}

	#controls-hint {
		display: none;
	}

	#playback {
		left: 10px;
		right: 10px;
		bottom: 10px;
		gap: 8px;
		padding: 8px 12px;
	}

	#frame-label {
		min-width: 100px;
		font-size: 11px;
	}
}
