.video-section {
	display: block !important;
}

h1 {
	text-align: center;
	margin-bottom: 20px;
}

/* Height propagation through hierarchy */
.main-content {
	/* min-height: 100vh !important;
	display: flex !important;
	flex-direction: column !important; */
}

.video-page-container {
	min-height: 100% !important;
	flex: 1 !important;
	display: flex !important;
	flex-direction: column !important;
}

.video-section {
	flex: 1 !important;
	display: flex !important;
	flex-direction: column !important;
}

.container {
	min-height: 600px !important;
	flex: 1 !important;
	display: flex !important;
	flex-direction: column !important;
}

/* Main visualization layout */
.visualization-layout {
	display: flex;
	gap: 20px;
	align-items: stretch;
	margin: 0 auto 20px;
	position: relative;
	flex: 1;
}

.video-preview-section {
	flex: 1;
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 8px;
	/* border: 1px solid #666; */
}

.panels-section {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.panels-section > div {
	min-width: 0;
}

/* 3D Rotation floating toggle */
.rotation-toggle-box {
	position: absolute;
	top: 10px;
	left: 10px;
	background:#282828;
	/* border: 1px solid #333; */
	border-radius: 6px;
	padding: 8px 12px;
	z-index: 100;
	backdrop-filter: blur(5px);
	/* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); */
}

.rotation-toggle-box label {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #e1e1e1;
	font-size: 14px;
	cursor: pointer;
	margin: 0;
}

.rotation-toggle-box input[type="checkbox"] {
	margin: 0;
}

.modal-box {
	background: rgba(0, 0, 0, 0.3);
    border: 1px solid #272727;
    box-shadow: inset 0 0 20px rgba(204, 255, 0, 0.05);
	border-radius: 8px;
}

.file-controls {
	padding: 15px;
	margin-bottom: 20px;
	display: flex;
	gap: 15px;
	align-items: center;
	flex-wrap: wrap;
}

.file-controls input[type="text"] {
	padding: 8px 12px;
	background: #444;
	color: white;
	border: 1px solid #666;
	border-radius: 4px;
	font-size: 14px;
	min-width: 50px;
	width: 50px;
}

.file-controls button {
	padding: 8px 16px;
	background: #C6FF00;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
}

.file-controls button:hover {
	background: #A8D600;
}

.file-controls button:disabled {
	background: #666;
	cursor: not-allowed;
}

.quick-load-btn {
	padding: 6px 14px !important;
	background: #444 !important;
	border: 1px solid #515151 !important;
	font-weight: 500;
	min-width: 50px;
}

.quick-load-btn:hover {
	background: #555 !important;
	border-color: #C6FF00 !important;
}

.quick-load-btn.active {
	background: #C6FF00 !important;
	border-color: #C6FF00 !important;
	color: black;
	font-weight: bold;;
}

#loadBtn {
	color: black;
	font-weight: bold;
}

.controls {
	color: #e1e1e1;
	padding: 15px;
	border-radius: 8px;
	margin-bottom: 20px;
	display: flex;
	gap: 15px;
	align-items: center;
	flex-wrap: wrap;
}

.controls.controls-disabled {
	pointer-events: none;
}

.controls.controls-disabled * {
	opacity: 0.6;
	filter: grayscale(100%);
}

.controls button {
	padding: 10px 10px;
	background: #C6FF00;
	color: black;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	width: 90px;
	height: 38px;
	font-size: 14px;
}

.controls button:hover {
	background: #C6FF00;
	color: black;
	border: none;
}

/* Select box styling */
select {
	background: #666666;
	color: white;
	border: 1px solid #888;
	border-radius: 4px;
	padding: 4px 2px;
	cursor: pointer;
}

select:hover {
	background: #777;
	border-color: #C6FF00;
}

select:focus {
	outline: none;
	border-color: #C6FF00;
	box-shadow: 0 0 0 2px rgba(198, 255, 0, 0.2);
}

.controls label {
	font-size: 13px;
}

.controls button:hover {
	background: #C6FF00;
}

.controls button:disabled {
	background: #666;
	cursor: not-allowed;
}

.controls label {
	font-size: 13px;
}

.controls input[type="range"] {
	flex: 1;
	min-width: 100px;
	max-width: 100%;
	accent-color: #C6FF00;
}

.time-slider-wrapper {
	flex: 1;
	min-width: 0;
	max-width: 100%;
}

/* Additional styling for range inputs across browsers */
input[type="range"] {
	accent-color: #C6FF00;
	border: none;
	outline: none;
	background: #666;
	-webkit-appearance: none;
	appearance: none;
	height: 8px;
	border-radius: 3px;
}

/* Webkit-based browsers (Chrome, Safari, Edge) */
input[type="range"]::-webkit-slider-track {
	background: #666;
	border-radius: 3px;
	height: 4px;
	border: none;
}

input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	background: #C6FF00;
	border-radius: 50%;
	width: 12px;
	height: 12px;
	border: none;
	cursor: pointer;
	transition: all 0.15s ease;
	-webkit-transition: all 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
	background: #B8E600;
	transform: scale(1.1);
}

/* Firefox */
input[type="range"]::-moz-range-track {
	background: #666;
	border-radius: 3px;
	height: 4px;
	border: none;
}

input[type="range"]::-moz-range-thumb {
	background: #C6FF00;
	border-radius: 50%;
	width: 16px;
	height: 16px;
	border: none;
	cursor: pointer;
	transition: all 0.15s ease;
}

input[type="range"]::-moz-range-thumb:hover {
	background: #B8E600;
	transform: scale(1.1);
}

input[type="checkbox"], 
input[type="radio"] {
	accent-color: #C6FF00;
}

.info {
	display: flex;
	gap: 20px;
	margin-bottom: 10px;
}

.info-item {
	background: #2a2a2a;
	padding: 10px 15px;
	border-radius: 4px;
}

.device-container {
	display: none; /* Hidden by default until video/json is loaded */
	justify-content: center;
	align-items: center;
	padding: 20px;
	
	/* CSS variables for responsive scaling */
	--device-radius: 30px;
	--device-padding: 40px;
	--device-side-padding: 15px;
}

.device-container.loaded {
	display: flex; /* Show when data is loaded */
}

.device-wrapper {
	/* Simplified - no 3D transforms needed */
}

.device-frame {
	background: #000;
	padding: var(--device-padding) var(--device-side-padding);
	border-radius: var(--device-radius);
	box-shadow: 0 0 30px rgba(0,0,0,0.2);
	position: relative;
	/* No fixed dimensions - adapts to content */
}

.device-wrapper.landscape .device-frame {
	padding: var(--device-side-padding) var(--device-padding) !important;
}

/* Base class for all device faces */
.device-face {
	position: absolute;
	border-radius: var(--device-radius);
}

/* Front face - the screen container */
.device-front {
	/* Takes size from content (screen + padding) */
	background: #000;
	border-radius: var(--device-radius);
	/* transform: translateZ(15px); */
	overflow: hidden;
	box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
	backface-visibility: hidden;
	padding: var(--device-padding) var(--device-side-padding);
	box-sizing: border-box;
	/* Use dimensions of parent frame */
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	z-index: 10;
}

/* Responsive device scaling classes */
.device-container.small {
	--device-radius: 18px;
	--device-padding: 24px;
	--device-side-padding: 9px;
}

.device-container.medium {
	--device-radius: 22px;
	--device-padding: 30px;
	--device-side-padding: 11px;
}

.device-container.large {
	--device-radius: 30px;
	--device-padding: 40px;
	--device-side-padding: 15px;
}

/* Keep screen styling but update for new structure */
.screen {
	position: relative;
	background: #000;
	border-radius: 5px;
	overflow: hidden;
	box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
	backface-visibility: hidden;
	width: 100%;
	height: 100%;
	/* Fix for iPhone Safari - prevent container collapse */
	min-width: 200px;
	min-height: 100px;
	/* Fix for iPhone Safari - disable 3D context for video rendering */
	transform-style: flat;
	-webkit-transform-style: flat;
	/* Create isolated stacking context to escape parent 3D transforms */
	isolation: isolate;
	/* Force 2D rendering */
	transform: translate3d(0, 0, 0);
	-webkit-transform: translate3d(0, 0, 0);
}

/* Device notch styling */
.device-notch {
	position: absolute;
	top: calc(var(--device-radius) * 0.2);
	left: 50%;
	transform: translateX(-50%);
	width: calc(var(--device-radius) * 2);
	height: 6px;
	background: #000;
	border-radius: 3px;
	z-index: 5;
	box-shadow: inset 0 1px 2px rgba(255,255,255,0.1);
}

/* Landscape mode notch adjustments */
.device-wrapper.landscape[data-landscape-orientation="left"] .device-notch {
	/* Landscape left (rotation 0) - notch on left side */
	top: 50%;
	left: calc(var(--device-side-padding) - calc(var(--device-radius)));
	transform: translateY(-50%) rotate(90deg);
}

/* Landscape right (rotation 180) - notch on right side */
.device-wrapper.landscape[data-landscape-orientation="right"] .device-notch {
	top: 50%;
	left: auto;
	right: calc(var(--device-side-padding) - calc(var(--device-radius)));
	transform: translateY(-50%) rotate(90deg);
}

.screen video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	object-fit: cover;
	z-index: 1;
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
	background: #000;
	/* Fix for iPhone Safari - disable 3D context for video rendering */
	transform-style: flat;
	-webkit-transform-style: flat;
	/* Force hardware acceleration without 3D context */
	will-change: transform;
}

/* Video play overlay */
.video-play-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	background: rgba(0, 0, 0, 0.3);
	z-index: 20;
	cursor: pointer;
	transition: opacity 0.3s ease, background 0.3s ease;
}

.video-play-overlay:hover {
	background: rgba(0, 0, 0, 0.5);
}

.video-play-overlay .play-icon {
	width: 80px;
	height: 80px;
	transition: transform 0.3s ease;
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.video-play-overlay:hover .play-icon {
	transform: scale(1.1);
}

/* Hide overlay when video is playing */
.video-play-overlay.hidden {
	opacity: 0;
	pointer-events: none;
}

.touch-point {
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
	transform: translate(-50%, -50%);
	animation: touchFade 0.2s ease-out;
	z-index: 10;
}

.touch-active {
	background: rgba(255, 0, 0, 0.5);
	border: 2px solid rgba(255, 0, 0, 0.8);
}

.touch-ended {
	background: rgba(0, 150, 255, 0.3);
	border: 2px solid rgba(0, 150, 255, 0.6);
}

@keyframes touchFade {
	from {
		transform: translate(-50%, -50%) scale(0);
		opacity: 0;
	}
	to {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
	}
}

.event-log {
	/* background: #2a2a2a; */
	/* padding: 10px; */
	/* border-radius: 4px; */
	max-height: 200px;
	overflow-y: auto;
	font-family: monospace;
	font-size: 12px;
	/* border: 1px solid #333; */
}

.event-log div {
	padding: 2px 5px;
	line-height: 1.1;
}

.event-gesture { color: #4CAF50; }
.event-button { color: #C6FF00; }
.event-pinch { color: #FF9800; }

.zoom-indicator {
	position: absolute;
	top: 18px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(255, 152, 0, 0.95);
	color: white;
	padding: 8px 16px;
	border-radius: 20px;
	font-weight: bold;
	font-size: 16px;
	z-index: 100;
	box-shadow: 0 2px 10px rgba(0,0,0,0.3);
	pointer-events: none;
	animation: zoomIndicatorPulse 0.3s ease-in-out;
}

.entity-icon { 
	display: none;
}

@keyframes zoomIndicatorPulse {
	0%, 100% { transform: translateX(-50%) scale(1); }
	50% { transform: translateX(-50%) scale(1.1); }
}

.pinch-zoom-circle {
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
	transform: translate(-50%, -50%);
	background: rgba(255, 215, 0, 0.3);
	border: 4px solid rgba(255, 215, 0, 0.8);
	transition: transform 0.1s ease-out;
	box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
	z-index: 15;
}

.pinch-zoom-circle::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 12px;
	background: rgba(255, 215, 0, 0.9);
	border-radius: 50%;
	transform: translate(-50%, -50%);
}

/* Camera view buttons */
.camera-btn {
	padding: 6px 7px;
	background: #2a2a2a;
	color: #ccc;
	border: 1px solid #333;
	border-radius: 4px;
	cursor: pointer;
	font-size: 11px;
	transition: all 0.2s;
}

.camera-btn:hover {
	background: #3a3a3a;
	border-color: #666;
	color: #fff;
}

.camera-btn:active {
	background: #C6FF00;
	border-color: #C6FF00;
	color: #fff;
}

.camera-btn.active {
	background: #C6FF00;
	border-color: #A8D600;
	color: #000;
	font-weight: bold;
}

/* Acceleration display */
#accelerationValues {
	transition: all 0.2s ease;
}

#accelCanvas {
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Map container */
#mapContainer {
	border: 1px solid #333;
}

#map {
	filter: brightness(0.9);
}

/* Metadata panels styling */
.metadata-panel {
	/* border: 1px solid #333; */
	border-radius: 8px;
	padding: 15px;
	margin: 10px 0;
}

.metadata-title {
	color: #C6FF00;
	font-weight: bold;
	font-size: 19px;
	text-align: center;
	margin-bottom: 15px;
	/* padding-bottom: 10px; */
	/* border-bottom: 1px solid #333; */
}

.metadata-content {
	display: flex;
	flex-direction: column;
	/* gap: 8px; */
	font-size: 13px;
	line-height: 1.6;
}

.metadata-row {
	display: flex;
	justify-content: space-between;
	padding: 3px 0;
}

.metadata-label {
	color: #999;
}

.metadata-value {
	color: #cbcbcb;
	font-weight: 500;
}

.metadata-link {
	color: #C6FF00;
	text-decoration: none;
	font-weight: 500;
}

.metadata-link:hover {
	text-decoration: underline;
}

.metadata-link.disabled {
	color: #666 !important;
	cursor: not-allowed !important;
	pointer-events: none !important;
	opacity: 0.5 !important;
}

.metadata-link.disabled:hover {
	text-decoration: none !important;
	color: #666 !important;
}

.map-wrapper {
	width: 100%;
	height: 200px;
	border-radius: 4px;
	overflow: hidden;
	margin-top: 10px;
}

.video-audio-title {
	color: #ccc;margin-bottom: 5px;font-weight: bold;font-size: 14px
}

/* Time display styles */
#timeDisplay {
	min-width: 80px;
	text-align: right;
	font-size: 13px;
	/* font-family: monospace; */
}

/* Quaternion values styles */
#quaternionValues, #accelerationValues, #magnetometerValues {
	color: #888;
	font-size: 12px;
	margin-top: 12px;
	font-family: monospace;
	line-height: 1.2;
}

#quaternionValues { 
	margin-top: 7px;
}

#autoScaleBtn {
	display: none;
}

#scaleValue {
	font-size: 13px;
	min-width: 45px;
}

#scaleSelect {
	min-width: 80px;
	width: 80px;
}

/* Metadata grid container */
.metadata-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

/* Collapsible section styling */
.section-title-wrapper {
	user-select: none;
}

.section-title-wrapper:hover {
	opacity: 0.8;
}

.collapse-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #C6FF00;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.collapse-icon svg {
	width: 48px;
	height: 48px;
}

#sensorDataContent {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	opacity: 0;
	will-change: grid-template-rows, opacity;
}

#sensorDataContent > .sensor-data-inner {
	overflow: hidden;
	min-height: 0;
}

/* When toggle is expanded, rotate icon and expand content */
.section-title-wrapper.expanded .collapse-icon {
	transform: rotate(180deg);
}

.section-title-wrapper.expanded + #sensorDataContent {
	grid-template-rows: 1fr;
	opacity: 1;
}

/* Auto-expand sensor section on touch devices (fallback if desktop view shows on phone) */
@media (pointer: coarse) {
	#sensorDataContent {
		grid-template-rows: 1fr;
		opacity: 1;
	}
	.section-title-wrapper .collapse-icon {
		transform: rotate(180deg);
	}
}

/* Responsive Media Queries */
/* Tablet: 2 columns */
@media (max-width: 1024px) {
	.panels-section {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Mobile: 1 column */
@media (max-width: 768px) {
	.panels-section {
		grid-template-columns: 1fr;
	}
	
	.metadata-grid {
		grid-template-columns: 1fr;
	}
	
	.controls {
		flex-direction: column;
	}
}