/**
 * Frontend CSS for WooCommerce AR Canvas Viewer
 * Styled with modern glassmorphism, responsive elements, and smooth animations.
 */

:root {
	--ar-primary-color: #00adb5;
	--ar-secondary-color: #222831;
	--ar-panel-bg: rgba(34, 40, 49, 0.85);
	--ar-border-color: rgba(255, 255, 255, 0.15);
	--ar-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Fullscreen Modal Overlay */
.wc-ar-canvas-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 9999999;
	background: #000;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #fff;
	box-sizing: border-box;
}

.wc-ar-canvas-modal-overlay * {
	box-sizing: border-box;
}

/* Viewport for Camera / Room view */
.ar-viewport-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

.ar-camera-feed {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 1;
	transform: scaleX(-1); /* Mirror camera for more intuitive usage on front cameras */
}

/* For back camera, we will remove mirror transformation in JS if we can detect it */
.ar-camera-feed.back-camera {
	transform: none;
}

.ar-room-bg-view {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	z-index: 2;
	transition: background-image 0.5s ease-in-out;
}

.threejs-canvas-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 3;
	pointer-events: auto;
}

/* UI Overlay Layer */
.ar-ui-overlay-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 4;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 20px;
	transition: opacity 0.3s ease;
}

.ar-ui-overlay-container.hidden {
	opacity: 0;
	pointer-events: none;
}

/* UI Elements need pointer events */
.ar-header,
.ar-side-controls,
.ar-bottom-controls-bar,
.ar-info-panel-box {
	pointer-events: auto;
}

/* Glassmorphism Helper */
.glass-panel {
	background: var(--ar-panel-bg);
	backdrop-filter: blur(12px) saturate(180%);
	-webkit-backdrop-filter: blur(12px) saturate(180%);
	border: 1px solid var(--ar-border-color);
	box-shadow: var(--ar-shadow);
	border-radius: 16px;
}

/* Circular Buttons */
.ar-circle-btn {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(0,0,0,0.3);
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

.ar-circle-btn:hover {
	transform: scale(1.05);
	background: rgba(0, 0, 0, 0.8);
	border-color: var(--ar-primary-color);
}

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

/* Header UI */
.ar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
}

.ar-status-indicator {
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	padding: 8px 18px;
	border-radius: 20px;
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.5px;
	box-shadow: var(--ar-shadow);
}

/* Side Controls */
.ar-side-controls {
	position: absolute;
	right: 20px;
	top: 90px;
	display: flex;
	flex-direction: column;
	gap: 15px;
	align-items: center;
}

.ar-control-action-btn {
	width: 50px;
	height: 50px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.65);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.ar-control-action-btn:hover {
	background: rgba(0, 0, 0, 0.85);
	border-color: var(--ar-primary-color);
	color: var(--ar-primary-color);
}

.ar-btn-caption {
	font-size: 9px;
	margin-top: 3px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: rgba(255, 255, 255, 0.8);
}

.ar-control-action-btn:hover .ar-btn-caption {
	color: var(--ar-primary-color);
}

/* Room Switcher Thumbnails */
.ar-room-selector-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: rgba(0, 0, 0, 0.5);
	padding: 6px;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.ar-room-thumb-btn {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	border: 2px solid transparent;
	cursor: pointer;
	background-size: cover;
	background-position: center;
	transition: all 0.2s ease;
}

.ar-room-thumb-btn:hover {
	transform: scale(1.05);
}

.ar-room-thumb-btn.active {
	border-color: var(--ar-primary-color);
	box-shadow: 0 0 8px var(--ar-primary-color);
}

/* Bottom Controls - Compact Layout */
.ar-bottom-controls-bar {
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Horizontally Scrollable Dimensions */
.ar-dimensions-selector-container {
	width: 100%;
	overflow: hidden;
}

.ar-sizes-scroll-wrapper {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 0 8px 0;
	scrollbar-width: none; /* Firefox */
}

.ar-sizes-scroll-wrapper::-webkit-scrollbar {
	display: none; /* Chrome/Safari */
}

.ar-size-pill-btn {
	flex: 0 0 auto;
	background: rgba(0, 0, 0, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	padding: 7px 14px;
	border-radius: 20px;
	cursor: pointer;
	font-weight: 600;
	font-size: 11px;
	transition: all 0.2s ease;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.ar-size-pill-btn:hover {
	border-color: var(--ar-primary-color);
	background: rgba(0, 0, 0, 0.85);
}

.ar-size-pill-btn.active {
	background: var(--ar-primary-color);
	border-color: var(--ar-primary-color);
	color: var(--ar-secondary-color);
	box-shadow: 0 0 10px var(--ar-primary-color);
}

/* Native AR Button */
.ar-native-action-wrapper {
	width: 100%;
	display: flex;
	justify-content: center;
}

.ar-btn-primary {
	width: 100%;
	background: var(--ar-primary-color);
	color: var(--ar-secondary-color);
	border: none;
	padding: 10px 18px;
	border-radius: 10px;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: 0 4px 15px rgba(0, 173, 181, 0.3);
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ar-btn-primary svg {
	stroke: var(--ar-secondary-color);
	width: 16px;
	height: 16px;
}

.ar-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 5px 18px rgba(0, 173, 181, 0.5);
}

.ar-btn-primary:active {
	transform: translateY(0);
}

/* Special Styling for Close Button */
.ar-close-btn {
	width: 52px !important;
	height: 52px !important;
	background: rgba(220, 53, 69, 0.75) !important; /* Crimson Red */
	border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.ar-close-btn:hover {
	background: rgba(220, 53, 69, 0.95) !important;
	transform: scale(1.1);
	border-color: #fff !important;
}

/* Hologram Logo (Persistent Layer) & Positions */
.ar-fixed-logo-overlay {
	position: fixed;
	pointer-events: none;
	z-index: 10000000;
	transition: all 0.3s ease;
}

.ar-fixed-logo-overlay img {
	max-height: 36px;
	width: auto;
	display: block;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Bottom Center Position */
.ar-fixed-logo-overlay.pos-bottom-center {
	bottom: 100px;
	left: 50%;
	transform: translateX(-50%);
}
.ar-ui-overlay-container.hidden ~ .ar-fixed-logo-overlay.pos-bottom-center {
	bottom: 25px;
}

/* Bottom Left Position */
.ar-fixed-logo-overlay.pos-bottom-left {
	bottom: 100px;
	left: 20px;
}
.ar-ui-overlay-container.hidden ~ .ar-fixed-logo-overlay.pos-bottom-left {
	bottom: 25px;
}

/* Bottom Right Position */
.ar-fixed-logo-overlay.pos-bottom-right {
	bottom: 100px;
	right: 20px;
}
.ar-ui-overlay-container.hidden ~ .ar-fixed-logo-overlay.pos-bottom-right {
	bottom: 25px;
}

/* Top Left Position */
.ar-fixed-logo-overlay.pos-top-left {
	top: 90px;
	left: 20px;
}
.ar-ui-overlay-container.hidden ~ .ar-fixed-logo-overlay.pos-top-left {
	top: 25px;
}

/* Top Right Position */
.ar-fixed-logo-overlay.pos-top-right {
	top: 90px;
	right: 90px; /* Offset the right action buttons slightly */
}
.ar-ui-overlay-container.hidden ~ .ar-fixed-logo-overlay.pos-top-right {
	top: 25px;
	right: 25px;
}

/* Floating Eye (Show UI) Button */
.ar-show-ui-floating-btn {
	position: absolute;
	right: 20px;
	bottom: 20px;
	z-index: 10000001;
	background: rgba(0, 173, 181, 0.8) !important;
	color: var(--ar-secondary-color) !important;
	border-color: var(--ar-primary-color) !important;
}

/* Info Panel Styling */
.ar-info-panel-box {
	position: absolute;
	top: 80px;
	left: 50%;
	transform: translateX(-50%);
	width: 90%;
	max-width: 380px;
	padding: 20px;
	z-index: 100;
	background: rgba(20, 20, 20, 0.9);
	border: 1px solid rgba(255,255,255,0.15);
	backdrop-filter: blur(10px);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.ar-info-panel-box h4 {
	margin-top: 0;
	margin-bottom: 10px;
	color: var(--ar-primary-color);
	font-size: 15px;
	font-weight: 600;
}

.ar-info-panel-box ul {
	margin: 0;
	padding-left: 0;
	list-style: none;
}

.ar-info-panel-box li {
	margin-bottom: 8px;
	font-size: 13px;
	line-height: 1.4;
}

.ar-info-panel-box button {
	background: var(--ar-primary-color);
	color: var(--ar-secondary-color);
	border: none;
	padding: 5px 15px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: bold;
	cursor: pointer;
	margin-top: 10px;
}

/* Responsive adjust for landscape or wide screens */
@media (min-height: 600px) {
	.ar-bottom-controls-bar {
		margin-bottom: 20px;
	}
}

/* Toast Notification Styles */
.ar-toast-notification {
	position: fixed;
	top: 30px;
	left: 50%;
	transform: translateX(-50%) translateY(-20px);
	background: rgba(0, 0, 0, 0.85);
	color: #fff;
	padding: 10px 20px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	z-index: 100000002;
	pointer-events: none;
	opacity: 0;
	box-shadow: 0 4px 15px rgba(0,0,0,0.3);
	transition: all 0.3s ease;
	border: 1px solid var(--ar-primary-color);
}

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

/* Help SVG Icon Enlargement */
#ar-info-btn svg {
	width: 28px !important;
	height: 28px !important;
}

/* AR Informational Notice Text Styles on Product Page */
.wc-ar-canvas-info-notice {
	border-radius: 8px;
	padding: 10px 12px;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	margin-bottom: 15px;
	transition: all 0.2s ease;
}

.wc-ar-canvas-info-notice:hover {
	background: #f1f3f5;
	border-color: #dee2e6;
}
