/* Migrated: static/css/streamer.css */
/* Fonts: use relative URLs so webpack emits hashed assets from src/fonts */
@font-face {
	font-family: 'Avenir';
	src: url(/static/dist/assets/Avenir-Roman.7c94a37f.woff2) format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Avenir';
	src: url(/static/dist/assets/Avenir-Medium.efe1fd0d.woff2) format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Avenir';
	src: url(/static/dist/assets/Avenir-Heavy.af43c184.woff2) format('woff2');
	font-weight: 800;
	font-style: normal;
	font-display: swap;
}
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	height: 100%;
}

body {
	font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	background: #000; /* Fullscreen camera backdrop */
	/* Use modern dynamic viewport units where available */
	min-height: 100vh;
	min-height: 100svh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	color: white;
	overflow: hidden; /* Prevent scroll to keep OSD overlays fixed */
	position: relative;
	/* Prevent accidental text selection across the UI */
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	/* Prevent bounce and unintended page gestures in fullscreen camera */
	overscroll-behavior: none;
}

/* Allow selection in form controls explicitly (none are used now, but safe to keep) */
input, textarea {
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
}

/* Prevent image dragging and long-press actions */
img, video, canvas {
	-webkit-user-drag: none;
	-webkit-touch-callout: none;
}

.main-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 0; /* Fullscreen video; OSD handles spacing */
}

.video-container {
	position: fixed; /* Fullscreen camera */
	inset: 0;
	display: block;
	margin: 0;
	padding: 0;
}

#localVideo {
	position: absolute;
	top: 0;
	left: 0;
	width: 100vw;
	/* Fullscreen height across devices with fallbacks */
	height: 100vh;   /* fallback */
	height: 100svh;  /* small viewport height (iOS address bar visible) */
	height: 100dvh;  /* dynamic viewport height (iOS 15.4+/modern) */
	height: var(--app-height, 100vh); /* JS fallback for older Safari */
	object-fit: cover; /* Fill screen, crop as needed */
	border-radius: 0;
	box-shadow: none;
	background: #000;
	transition: opacity 0.2s ease;
	will-change: opacity, transform;
	transform: translateZ(0);
}

#overlayCanvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100vw;
	/* Match video element sizing exactly */
	height: 100vh;
	height: 100svh;
	height: 100dvh;
	height: var(--app-height, 100vh);
	border-radius: 0;
	pointer-events: none;
	z-index: 10;
	will-change: opacity, transform;
	transform: translateZ(0);
}

/* Centered DOM guideline image: show at intrinsic size without any scaling */
#guidelineOverlayImg {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) translateZ(0);
	/* Fit to container width only; preserve aspect ratio */
	width: 100%;
	height: auto;
	display: none; /* hidden until the real SVG/image is loaded */
	z-index: 12; /* above canvas but below status overlays (z 20) */
	pointer-events: none; /* allow interactions to pass through */
	image-rendering: auto; /* keep vector crispness */
}

/* Status overlay for camera detection */
.status-overlay {
	position: absolute;
	top: 30px;
	left: 50%;
	transform: translateX(-50%) translateZ(0);
	background: rgba(0,0,0,0.7);
	color: white;
	padding: 12px 24px;
	border-radius: 25px;
	font-size: 16px;
	font-weight: 500;
	z-index: 20;
	opacity: 0;
	transition: opacity 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 80%;
	text-align: center;
	will-change: opacity, transform;
	pointer-events: none;
}

.status-overlay.active {
	opacity: 1;
}

/* MediaPipe loading states */
.status-overlay.loading {
	opacity: 1;
	background: rgba(54, 162, 235, 0.8);
}

.status-overlay.loading .status-icon {
	border-color: #ffffff;
	border-top-color: transparent;
	animation: spin 1s linear infinite;
}

.status-overlay.success {
	opacity: 1;
	background: rgba(76, 175, 80, 0.8);
}

.status-overlay.warning {
	opacity: 1;
	background: rgba(255, 152, 0, 0.8);
}

.status-overlay.error {
	opacity: 1;
	background: rgba(244, 67, 54, 0.8);
}

.status-overlay .status-icon {
	width: 20px;
	height: 20px;
	border: 2px solid #ffffff;
	border-top: 2px solid transparent;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	flex-shrink: 0;
}

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

/* Detection indicators */
.detection-indicator {
	position: absolute;
	/* Place above the bottom OSD controls (140px tall) with extra spacing */
	bottom: calc(140px + 16px);
	/* iOS safe-area aware override (supported browsers will use this) */
	bottom: calc(140px + env(safe-area-inset-bottom) + 16px);
	left: 50%;
	transform: translateX(-50%) translateZ(0);
	background: rgba(0,255,136,0.2);
	border: 2px solid rgba(0,255,136,0.6);
	color: #00ff88;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 600;
	z-index: 20;
	opacity: 0;
	transition: opacity 0.3s ease;
	will-change: opacity, transform;
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: 80%;
	text-align: center;
	white-space: nowrap;
}

.detection-indicator.active {
	opacity: 1;
}

.detection-indicator.warning {
	background: rgba(255,193,7,0.2);
	border-color: rgba(255,193,7,0.6);
	color: #ffc107;
}

.detection-indicator.error {
	background: rgba(220,53,69,0.2);
	border-color: rgba(220,53,69,0.6);
	color: #dc3545;
}

#selectedImage {
	width: 100%;
	max-width: 100%;
	height: auto;
	border-radius: 15px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.3);
	background: rgba(0,0,0,0.1);
	display: none;
	border: 3px solid #00ff88;
	transition: opacity 0.2s ease;
}

#captureCanvas {
	display: none;
}

.image-gallery {
	display: none; /* Hide the old gallery */
}

.gallery-header {
	display: none; /* Hide header for cleaner look */
}

.gallery-title {
	display: none;
}

.toggle-view-btn {
	display: none;
}

.gallery-grid {
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	gap: 12px;
	padding: 15px 20px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
}

.gallery-grid::-webkit-scrollbar {
	display: none;
}

.gallery-item {
	position: relative;
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 16px;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	border: 3px solid rgba(255,255,255,0.2);
	background: rgba(0,0,0,0.1);
}

.gallery-item:hover {
	transform: scale(1.1);
	border-color: rgba(255,255,255,0.6);
}

.gallery-item.selected {
	border-color: #ffffff;
	box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
	transform: scale(1.05);
}

.gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 13px;
}

.gallery-item .timestamp {
	display: none; /* Clean look without timestamps */
}

.no-images {
	text-align: center;
	color: rgba(255,255,255,0.6);
	font-style: italic;
	padding: 20px;
}

.empty-gallery {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	text-align: center;
	background: rgba(255,255,255,0.1);
	border-radius: 16px;
	border: 2px solid rgba(255,255,255,0.2);
	margin: 15px 20px;
	min-height: 80px;
	transition: all 0.3s ease;
}

.empty-gallery:hover {
	border-color: rgba(255,255,255,0.4);
	background: rgba(255,255,255,0.15);
}

.empty-icon {
	display: none; /* Hide for cleaner look */
}

.empty-title {
	font-size: 16px;
	font-weight: 600;
	color: rgba(255,255,255,0.9);
	margin: 0;
}

.empty-subtitle {
	display: none; /* Hide for cleaner look */
}

.empty-hint {
	display: none; /* Hide for cleaner look */
}

@keyframes float {
	0%, 100% { transform: translateY(0px); }
	50% { transform: translateY(-10px); }
}

.controls-bottom {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: transparent; /* No gradient background under OSD */
	/* Add safe-area aware padding on iOS */
	padding: 40px 30px calc(40px + env(safe-area-inset-bottom)) 30px;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	border-top: none;
	z-index: 1000;
	height: 160px; /* Increased to accommodate arm selector above capture button */
	box-sizing: border-box;
	/* Avoid pinch/double-tap zoom on control bar */
	touch-action: manipulation;
}

.controls-bottom > * {
	flex-shrink: 0; /* Prevent items from shrinking */
}

/* Center controls container - arm selector above capture button */
.center-controls {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	position: relative;
	/* Capture button will align with gallery and auto toggle */
	/* Avoid gesture zooms on nested controls */
	touch-action: manipulation;
}

/* Right side controls container */
.right-controls {
	display: flex;
	align-items: flex-end;
	gap: 15px;
}

/* Left side - Gallery thumbnail */
.gallery-thumbnail {
	width: 70px;
	height: 70px;
	border-radius: 14px;
	overflow: hidden;
	border: 3px solid rgba(255,255,255,0.8);
	background: rgba(0,0,0,0.3);
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	flex-shrink: 0; /* Prevent shrinking */
	/* Prevent double-tap zoom on thumbnail */
	touch-action: manipulation;
}

/* Small count badge at top-right of gallery thumbnail */
.gallery-count-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	border-radius: 12px;
	background: #00ff88;
	color: #0b2b1f;
	border: 2px solid #ffffff;
	font-size: 13px;
	line-height: 20px;
	font-weight: 700;
	text-align: center;
	pointer-events: none;
	box-shadow: 0 2px 6px rgba(0,0,0,0.3);
	z-index: 2;
}

.gallery-thumbnail:hover {
	transform: scale(1.05);
	border-color: white;
}

.gallery-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.gallery-thumbnail .placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255,255,255,0.6);
	font-size: 28px;
	text-align: center;
	background: rgba(255,255,255,0.1);
}

/* Rive gallery loading overlay */
#galleryThumbnail { position: relative; }
#galleryThumbnail .rive-loading-wrap { display: none; }
#galleryThumbnail .rive-fallback-spinner {
  box-sizing: border-box;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: riveSpin 0.9s linear infinite;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}
@keyframes riveSpin { to { transform: rotate(360deg); } }

/* Phase-specific tinting for fallback spinner */
#galleryThumbnail .rive-loading-wrap[data-phase="upload"] .rive-fallback-spinner {
	border-color: rgba(77,163,255,0.35);
	border-top-color: #4da3ff;
}
#galleryThumbnail .rive-loading-wrap[data-phase="composite"] .rive-fallback-spinner {
	border-color: rgba(0,255,136,0.35);
	border-top-color: #00ff88;
}

/* Upload SVG progress ring (shown only in upload phase) */
#galleryThumbnail .upload-ring-wrap { display: none; }
#galleryThumbnail .rive-loading-wrap[data-phase="upload"] .upload-ring-wrap { display: flex; }

#galleryThumbnail svg.upload-ring {
	width: 48px;
	height: 48px;
	overflow: visible;
}
#galleryThumbnail .upload-ring .ring-track {
	stroke: rgba(77,163,255,0.25); /* blue track */
	stroke-width: 3.5;
}
#galleryThumbnail .upload-ring .ring-progress {
	/* High-contrast blue with subtle gradient simulated via filter */
	stroke: #5bb3ff; /* base */
	stroke-width: 3.5;
	stroke-linecap: round;
	transition: stroke-dashoffset 120ms linear;
	/* Stronger edge separation against busy thumbnails */
	filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35)) drop-shadow(0 0 2px rgba(33,150,243,0.4));
}
#galleryThumbnail .upload-ring .ring-text {
	/* Max readability on photos: near-white text with outline and shadow */
	fill: #ffffff;
	font-size: 7px;
	font-weight: 700;
	dominant-baseline: middle; /* vertical centering in SVG */
	alignment-baseline: middle; /* extra hint for cross-browser */
	paint-order: stroke fill;
	stroke: rgba(0,0,0,0.6);
	stroke-width: 0.6px;
	/* Extra glow for edge cases where stroke is not enough */
	filter: drop-shadow(0 0 2px rgba(0,0,0,0.6));
}

/* Center - Capture button */
.btn-capture {
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	/* Prevent any text/emoji from rendering inside the button */
	color: transparent;
	font-size: 0;
	line-height: 0;
	padding: 0;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	box-shadow: 0 8px 25px rgba(0,0,0,0.3);
	border: 6px solid rgba(255,255,255,0.9);
	position: relative;
	cursor: pointer;
	transition: all 0.2s ease;
	/* Prevent double-tap/dblclick zoom on the capture button */
	touch-action: manipulation;
}

.btn-capture::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 60px;
	height: 60px;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border-radius: 50%;
	transition: all 0.2s ease;
}

.btn-capture:active {
	transform: scale(0.95);
}

.btn-capture.capturing::before {
	background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
	transform: translate(-50%, -50%) scale(0.9);
}

/* Auto toggle - on right side */
.auto-toggle {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	transition: all 0.3s ease;
	z-index: 1001; /* Ensure it's above other elements */
	pointer-events: auto; /* Explicitly enable pointer events */
	-webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
	-webkit-touch-callout: none; /* Disable callout on mobile */
	user-select: none; /* Prevent text selection */
	/* Prevent double-tap zoom on toggle */
	touch-action: manipulation;
}

.auto-toggle-switch {
	position: relative;
	width: 52px;
	height: 28px;
	background: rgba(255,255,255,0.2);
	border-radius: 14px;
	border: 2px solid rgba(255,255,255,0.3);
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	padding: 4px;
}

.auto-toggle-switch::before {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(255,255,255,0.8);
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	transform: translateX(0);
	box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.auto-toggle.active .auto-toggle-switch {
	background: rgba(0,255,136,0.3);
	border-color: rgba(0,255,136,0.6);
}

.auto-toggle.active .auto-toggle-switch::before {
	background: #00ff88;
	transform: translateX(24px);
	box-shadow: 0 2px 8px rgba(0,255,136,0.4);
}

.auto-toggle-text {
	color: rgba(255,255,255,0.8);
	font-size: 12px;
	font-weight: 500;
	text-align: center;
}

.auto-toggle.active .auto-toggle-text {
	color: #00ff88;
}

/* Arm Selector - Above Capture Button (smaller) */
.arm-selector {
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: pointer;
	transition: all 0.3s ease;
	user-select: none;
	/* Prevent double-tap zoom on arm selector */
	touch-action: manipulation;
}

.arm-selector:hover {
	transform: scale(1.05);
}

.arm-selector:active {
	transform: scale(0.95);
}

.arm-selector-label {
	color: rgba(255,255,255,0.8);
	font-size: 11px;
	font-weight: 500;
	text-align: center;
}

.arm-selector-options {
	display: flex;
	gap: 8px;
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(10px);
	border-radius: 22px;
	padding: 6px 12px;
	border: 2px solid rgba(255,255,255,0.25);
	box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.arm-selector-btn {
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 50%;
	background: rgba(255,255,255,0.15);
	color: rgba(255,255,255,0.7);
	font-size: 20px;
	cursor: pointer;
	transition: all 0.25s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none; /* Disable individual button clicks */
}

.arm-selector-btn.active {
	background: rgba(255,255,255,0.95);
	box-shadow: 0 2px 6px rgba(0,0,0,0.3);
	transform: scale(1.1);
}

/* Gallery Modal */
.gallery-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #f5f5f5;
	z-index: 2000;
	display: none;
	opacity: 0;
	transform: translateY(100%);
	transition: all 0.3s ease;
}

.gallery-modal.active {
	display: flex;
	flex-direction: column;
	opacity: 1;
	transform: translateY(0);
}

.gallery-modal-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 0;
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
	z-index: 3;
}

.gallery-modal-header h3 { display: none; }

.gallery-close {
	position: absolute;
	top: 54px; /* push below disclaimer */
	right: 10px;
	background: rgba(245,245,245,0.95);
	border: 1px solid rgba(0,0,0,0.06);
	color: #222;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-size: 18px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 4;
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);
	/* Prevent double-tap zoom on close */
	touch-action: manipulation;
}

.gallery-close:hover {
	background: #f0f0f0;
	color: #111;
}

.gallery-modal-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #000;
	overflow: hidden; /* Prevent content overflow */
	min-height: 0; /* Important for flex children to shrink properly */
}

.gallery-main-view {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	background: #000;
	padding: 0;
	min-height: 0; /* Allow shrinking */
	overflow: hidden; /* Prevent image overflow */
}

.gallery-main-image {
	width: 100%;
	height: 100%;
	object-fit: cover; /* Fill area fully (no letterbox), crop if needed */
	border-radius: 0;
	box-shadow: none;
	background: #000;
}

/* Improve slider responsiveness on touch devices */
#galleryAdjustControls { z-index: 5; }
#galleryAdjustSlider,
#repositionSlider {
	touch-action: none; /* prevent scroll hijack, ensure immediate input */
}

/* Navigation buttons removed - user changes images via thumbnails */

/* Main image action buttons - share, download and delete on main image */
.gallery-main-actions {
	position: absolute;
	top: 72px; /* push below disclaimer */
	left: 12px;
	right: 12px;
	display: flex;
	justify-content: space-between;
	pointer-events: none;
	z-index: 2;
}

.gallery-left-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	pointer-events: none;
}

.gallery-main-action-btn {
	background: rgba(255, 255, 255, 0.95);
	border: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 18px; /* smaller icons to avoid overflow */
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
	/* Prevent double-tap zoom */
	touch-action: manipulation;
}

.gallery-main-action-btn:hover {
	transform: scale(1.1);
	background: white;
}

.gallery-main-action-btn.download {
	background: rgba(33, 150, 243, 0.95);
}

.gallery-main-action-btn.download:hover {
	background: #2196F3;
}


/* Delete button theme: translucent dark */
.gallery-main-action-btn.delete {
	background: rgba(0,0,0,0.45);
	color: #fff;
}

.gallery-main-action-btn.delete:hover {
	background: rgba(0,0,0,0.6);
}

/* Anchor the main delete button to bottom-right */
#galleryDeleteBtn.gallery-main-action-btn.delete {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 3;
}

.gallery-bottom-strip {
	background: white;
	padding: 8px 16px 12px;
	border-top: 1px solid #e0e0e0;
	box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
	flex-shrink: 0; /* Prevent shrinking */
	max-height: 220px; /* Leave room for product bar */
	display: flex;
	flex-direction: column;
}

.gallery-thumbnails {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding: 6px 0 2px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	flex-shrink: 0; /* Prevent shrinking */
}

.gallery-thumbnails::-webkit-scrollbar {
	height: 5px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

.gallery-thumb {
	flex-shrink: 0;
	width: 70px;
	height: 70px;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	transition: all 0.3s ease;
	border: 3px solid transparent;
	position: relative;
	/* Prevent double-tap zoom on thumbs */
	touch-action: manipulation;
}

.gallery-thumb.selected {
	border-color: #007AFF;
	transform: scale(1.05);
}

.gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery-thumb.delete {
	background: #ff4757;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 24px;
}

.gallery-thumb.delete:hover {
	background: #ff3742;
}

.gallery-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
	color: #666;
	font-size: 14px;
	flex-shrink: 0; /* Prevent info from shrinking */
}
.gallery-disclaimer {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	background: #ffffff;
	color: #000000;
	padding: 10px 14px;
	font-size: 12px;
	line-height: 1.35;
	text-align: center;
	z-index: 3;
}

/* New: product bar under thumbnails */
.gallery-product-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding-top: 10px;
	margin-top: 8px;
	border-top: 1px solid #eaeaea;
}

.gallery-product-bar .product-info {
	display: flex;
	flex-direction: column;
}

.gallery-product-bar .product-name {
	font-weight: 700;
	color: #111;
}

.gallery-product-bar .product-price {
	font-weight: 600;
	color: #007AFF;
}

.gallery-add-to-cart {
	background: #111;
	color: #fff;
	border: none;
	border-radius: 22px;
	padding: 10px 16px;
	font-weight: 700;
	letter-spacing: 0.3px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gallery-counter {
	font-weight: 500;
}

/* Removed thumbnail action buttons - now on main image */

@keyframes pulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); }
	100% { transform: scale(1); }
}

.btn:disabled {
	background: rgba(255,255,255,0.2);
	color: rgba(255,255,255,0.5);
	cursor: not-allowed;
	box-shadow: none;
}

.btn:active {
	transform: scale(0.95);
}

.result-container {
	margin-top: 20px;
	padding: 15px;
	background: rgba(255,255,255,0.1);
	border-radius: 15px;
	border: 1px solid rgba(255,255,255,0.2);
}

.result-container a {
	color: #64b5f6;
	text-decoration: none;
	font-weight: 500;
}

/* Camera Flash Effect */
.flash-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: white;
	opacity: 0;
	pointer-events: none;
	z-index: 9999;
	transition: opacity 0.1s ease;
}

.flash-overlay.active {
	opacity: 0.9;
}

@keyframes flashAnimation {
	0% { opacity: 0; }
	50% { opacity: 0.9; }
	100% { opacity: 0; }
}

.flash-overlay.animate {
	animation: flashAnimation 0.3s ease-out;
}

/* Mobile optimizations */
@media (max-width: 768px) {
	.controls-bottom {
		padding: 15px;
	}
    
	.btn-capture, #mainActionButton.capture-mode {
		width: 80px;
		height: 80px;
	}
    
	.header h1 {
		font-size: 1.3rem;
	}
    
	.main-content {
		padding: 0;
	}
}

/* Very small screens */
@media (max-width: 480px) {
	.header {
		padding: 15px;
	}
    
	.main-content {
		padding: 0;
	}
    
	.controls-bottom {
		padding: 12px;
	}
    
	.btn-capture, #mainActionButton.capture-mode {
		width: 75px;
		height: 75px;
	}
}

/* iPhone-specific optimizations */
@supports (-webkit-appearance: none) and (not (aspect-ratio: 1)) {
	/* iPhone Safari specific */
	video, canvas {
		-webkit-transform: translateZ(0);
		transform: translateZ(0);
		-webkit-backface-visibility: hidden;
		backface-visibility: hidden;
	}
    
	.video-container {
		-webkit-overflow-scrolling: touch;
	}
}

/* Upload progress UI removed (silent uploads) */

.btn-start-camera {
	position: fixed;
	bottom: calc(160px + env(safe-area-inset-bottom, 0px));
	left: 50%;
	transform: translateX(-50%);
	background: rgba(12,12,12,0.92);
	color: #fff;
	border: 1px solid rgba(255,255,255,0.35);
	border-radius: 999px;
	padding: 12px 28px;
	font-size: 1rem;
	letter-spacing: 0.3px;
	display: none;
	align-items: center;
	gap: 8px;
	z-index: 120;
	box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.btn-start-camera.is-visible {
	display: inline-flex;
}

.btn-start-camera:active {
	transform: translateX(-50%) scale(0.98);
}

