/**
 * Image Lightbox/Zoom Styles
 * Global lightbox for viewing images across all pages
 * 
 * @package TabcomGroup
 */

/* Lightbox Overlay */
.tabcom-lightbox {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.92);
	z-index: 99999;
	opacity: 0;
	transition: opacity 0.3s ease;
	cursor: zoom-out;
	pointer-events: none;
}

.tabcom-lightbox.active {
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
	pointer-events: auto;
}

/* Lightbox Image Container */
.tabcom-lightbox__container {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	animation: lightboxZoomIn 0.3s ease;
}

@keyframes lightboxZoomIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Lightbox Image */
.tabcom-lightbox__image {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	cursor: default;
}

/* Close Button */
.tabcom-lightbox__close {
	position: fixed;
	top: 20px;
	right: 20px;
	width: 50px;
	height: 50px;
	background: rgba(255, 255, 255, 0.1);
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	z-index: 100000;
}

.tabcom-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.5);
	transform: rotate(90deg);
}

/* Image Caption */
.tabcom-lightbox__caption {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 14px;
	text-align: center;
	max-width: 80%;
	padding: 10px 20px;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 8px;
	opacity: 0.8;
}

/* Zoomable images cursor */
img[data-lightbox] {
	cursor: zoom-in;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img[data-lightbox]:hover {
	transform: scale(1.02);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
	overflow: hidden;
}

/* Ensure body is not locked when no lightbox is active */
body:not(.lightbox-open) {
	overflow-x: hidden;
	overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
	.tabcom-lightbox__close {
		top: 15px;
		right: 15px;
		width: 40px;
		height: 40px;
		font-size: 20px;
	}
	
	.tabcom-lightbox__image {
		max-width: 95vw;
		max-height: 80vh;
	}
	
	.tabcom-lightbox__caption {
		font-size: 12px;
		padding: 8px 15px;
		max-width: 90%;
	}
}
