/**
 * WebAR Camera Capture, Shutter Button & Preview Modal Styles
 * iam3dar Studio (https://iam3dar.com)
 */

/* Camera Shutter Container */
#shutter-container {
	position: fixed;
	bottom: calc(env(safe-area-inset-bottom, 20px) + 24px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10000;
	display: flex;
	flex-direction: column;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

#shutter-container.visible,
#shutter-container.active {
	opacity: 1 !important;
	visibility: visible !important;
}

/* Helper Hint above Shutter Button */
.shutter-hint {
	background: transparent;
	border: none;
	outline: none;
	color: rgba(255, 255, 255, 0.95);
	font-family: 'Outfit', system-ui, -apple-system, sans-serif;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.3px;
	padding: 0;
	white-space: nowrap;
	pointer-events: none;
	margin-bottom: 8px;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.6);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.shutter-btn {
	width: 80px;
	height: 80px;
	background: rgba(255, 255, 255, 0.22);
	border: 4px solid #ffffff;
	border-radius: 50%;
	position: relative;
	cursor: pointer;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
	display: flex;
	justify-content: center;
	align-items: center;
	outline: none;
	padding: 0;
	box-sizing: border-box;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
}

.shutter-btn:active {
	transform: scale(0.94);
}

/* Concentric SVG Progress Ring for Video Recording */
.shutter-progress-ring {
	position: absolute;
	top: -4px;
	left: -4px;
	width: 80px;
	height: 80px;
	transform: rotate(-90deg);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.shutter-progress-circle {
	fill: none;
	stroke: #ef4444;
	stroke-width: 4.5;
	stroke-linecap: round;
	stroke-dasharray: 238.76;
	stroke-dashoffset: 238.76;
	transition: stroke-dashoffset 0.05s linear;
}

.shutter-btn.recording .shutter-progress-ring {
	opacity: 1;
}

.shutter-btn.recording {
	border-color: rgba(255, 255, 255, 0.35);
	box-shadow: 0 0 25px rgba(239, 68, 68, 0.75);
}

.shutter-btn-inner {
	width: 58px;
	height: 58px;
	background: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.shutter-btn.recording .shutter-btn-inner {
	width: 32px;
	height: 32px;
	background: #ef4444;
	border-radius: 8px;
	box-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
}

.shutter-camera-icon {
	width: 24px;
	height: 24px;
	stroke: #0a4843;
	transition: transform 0.2s ease, opacity 0.15s ease;
}

.shutter-btn.recording .shutter-camera-icon {
	display: none;
}

/* Live Recording Status Indicator */
.recording-badge {
	position: fixed;
	top: calc(env(safe-area-inset-top, 16px) + 68px);
	left: 50%;
	transform: translateX(-50%) translateY(-10px);
	background: rgba(220, 38, 38, 0.92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: #ffffff;
	padding: 7px 16px;
	border-radius: 99px;
	font-family: 'Outfit', system-ui, -apple-system, sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.6px;
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 999999;
	box-shadow: 0 4px 20px rgba(220, 38, 38, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.recording-badge.active {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.rec-dot {
	width: 9px;
	height: 9px;
	background: #ffffff;
	border-radius: 50%;
	animation: arPulseDot 1s ease-in-out infinite;
}

/* Flash Effect Overlay */
#camera-flash {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: #ffffff;
	z-index: 999999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease-out;
}

#camera-flash.active {
	opacity: 0.9;
}

/* AR Scanning Target Hint Overlay - Borderless, Centered Minimalist Glass */
.ar-scan-hint {
	position: fixed;
	top: calc(env(safe-area-inset-top, 16px) + 16px);
	left: 50%;
	transform: translateX(-50%) translateY(-10px);
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: none;
	outline: none;
	color: #FFFFFF;
	padding: 8px 18px;
	border-radius: 99px;
	font-family: 'Outfit', system-ui, -apple-system, sans-serif;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.3px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	z-index: 99999;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
	opacity: 0;
	pointer-events: none;
	white-space: nowrap;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.ar-scan-hint.active {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.ar-scan-hint-dot {
	width: 7px;
	height: 7px;
	background: #2DD4BF;
	border-radius: 50%;
	box-shadow: 0 0 8px rgba(45, 212, 191, 0.8);
	animation: arPulseDot 1.4s ease-in-out infinite;
}

@keyframes arPulseDot {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.35); opacity: 0.45; }
}

/* Watermark Preview Mode & Modal */
#preview-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100vw;
	height: 100%;
	height: 100dvh;
	background: rgba(10, 15, 29, 0.92);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	z-index: 9999999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	padding: calc(env(safe-area-inset-top, 14px) + 8px) 20px calc(env(safe-area-inset-bottom, 18px) + 24px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	box-sizing: border-box;
	overflow: hidden;
}

#preview-modal.visible {
	opacity: 1;
	visibility: visible;
}

.preview-header {
	width: 100%;
	max-width: min(88vw, 330px);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
	margin-bottom: 8px;
}

.preview-title {
	font-family: 'Outfit', sans-serif;
	color: #ffffff;
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	letter-spacing: -0.01em;
}

.preview-close-btn {
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #ffffff;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.preview-close-btn:active {
	transform: scale(0.92);
}

.preview-media-container {
	width: auto;
	max-width: 100%;
	flex: 1 1 auto;
	min-height: 0;
	background: transparent;
	border: none;
	box-shadow: none;
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: auto 0;
}

.preview-media-container img,
.preview-media-container video {
	max-width: min(92vw, 380px);
	max-height: min(65vh, calc(100dvh - 145px));
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	border-radius: 18px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.preview-actions {
	width: 100%;
	max-width: min(88vw, 330px);
	display: flex;
	gap: 12px;
	flex-shrink: 0;
	margin-top: 12px;
	margin-bottom: 4px;
}

.preview-action-btn {
	flex: 1;
	padding: 12px 16px;
	border-radius: 28px;
	font-family: 'Outfit', sans-serif;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	outline: none;
	border: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.preview-action-btn.share {
	background: linear-gradient(135deg, #00c9a7 0%, #009688 100%);
	color: #ffffff;
	box-shadow: 0 4px 16px rgba(0, 201, 167, 0.35);
}

.preview-action-btn.download {
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #ffffff;
}

.preview-action-btn:active {
	transform: scale(0.96);
}

.preview-toast {
	position: fixed;
	bottom: calc(env(safe-area-inset-bottom, 20px) + 96px);
	left: 50%;
	transform: translateX(-50%) translateY(12px);
	background: rgba(14, 20, 24, 0.94);
	color: #FFFFFF;
	padding: 8px 16px;
	border: none;
	outline: none;
	border-radius: 20px;
	font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: 0.2px;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	opacity: 0;
	pointer-events: none;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 99999999;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.preview-toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Disabled / Loading state for AR Welcome button */
.ar-scan-button[disabled],
.ar-scan-button.loading-blocked {
	opacity: 0.45 !important;
	pointer-events: none !important;
	cursor: not-allowed !important;
	filter: grayscale(0.6) !important;
	animation: none !important;
	box-shadow: none !important;
}
