/**
 * AnimeHub Lightbox Styles
 *
 * Styles for screenshots gallery lightbox
 *
 * @package AnimeHub
 */

/* ============================================
   Lightbox Overlay
   ============================================ */
.screenshots-lightbox-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.95);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s, visibility 0.3s;
}

.screenshots-lightbox-overlay.active {
	opacity: 1;
	visibility: visible;
}

body.lightbox-open {
	overflow: hidden;
}

/* ============================================
   Lightbox Container
   ============================================ */
.lightbox-container {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px 80px;
}

/* ============================================
   Close Button
   ============================================ */
.lightbox-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 28px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	z-index: 10;
}

.lightbox-close:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Navigation Buttons
   ============================================ */
.lightbox-prev,
.lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, transform 0.2s;
	z-index: 10;
}

.lightbox-prev {
	left: 20px;
}

.lightbox-next {
	right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
	background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev:active,
.lightbox-next:active {
	transform: translateY(-50%) scale(0.95);
}

/* ============================================
   Image Container
   ============================================ */
.lightbox-image-wrap {
	position: relative;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lightbox-image {
	max-width: 100%;
	max-height: calc(100vh - 200px);
	object-fit: contain;
	border-radius: 8px;
	transition: opacity 0.3s;
}

/* ============================================
   Loading Spinner
   ============================================ */
.lightbox-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.lightbox-loading .spinner-ring {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: var(--animehub-primary, #ff6b35);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* ============================================
   Counter
   ============================================ */
.lightbox-counter {
	position: absolute;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.5);
	padding: 8px 16px;
	border-radius: 20px;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
}

/* ============================================
   Thumbnails
   ============================================ */
.lightbox-thumbnails {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	max-width: 80%;
	overflow-x: auto;
	padding: 8px;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 8px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.lightbox-thumbnails::-webkit-scrollbar {
	height: 4px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
}

.thumb-item {
	flex-shrink: 0;
	width: 60px;
	height: 40px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 4px;
	background: none;
	cursor: pointer;
	overflow: hidden;
	opacity: 0.5;
	transition: opacity 0.2s, border-color 0.2s;
}

.thumb-item:hover {
	opacity: 0.8;
}

.thumb-item.active {
	opacity: 1;
	border-color: var(--animehub-primary, #ff6b35);
}

.thumb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ============================================
   Trailer Player
   ============================================ */
.trailer-player {
	position: relative;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
}

.trailer-video,
.trailer-iframe {
	width: 100%;
	height: 100%;
}

.trailer-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.trailer-error {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	color: #888;
}

.trailer-error svg {
	margin-bottom: 10px;
	opacity: 0.5;
}

.trailer-error p {
	margin: 0;
	font-size: 14px;
}

/* ============================================
   Screenshots Gallery
   ============================================ */
.screenshots-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
}

.screenshots-gallery a {
	display: block;
	aspect-ratio: 16/9;
	overflow: hidden;
	border-radius: 8px;
	transition: transform 0.2s;
}

.screenshots-gallery a:hover {
	transform: scale(1.05);
}

.screenshots-gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
	.lightbox-container {
		padding: 20px 50px 100px;
	}

	.lightbox-prev,
	.lightbox-next {
		width: 40px;
		height: 40px;
	}

	.lightbox-prev {
		left: 10px;
	}

	.lightbox-next {
		right: 10px;
	}

	.lightbox-thumbnails {
		max-width: 95%;
	}

	.thumb-item {
		width: 50px;
		height: 34px;
	}
}
