/**
 * KS LP Video Gallery — Stylesheet
 */

.kslp-video-gallery-block {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	overflow: hidden;
}

.kslp-vg-container {
	position: relative;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
	z-index: 2;
}

/* --- Layout Modes --- */
/* Single Media Mode */
.kslp-vg-layout--single {
	display: flex;
	flex-direction: column;
	width: 100%;
}
.kslp-vg-layout--single.kslp-vg-align--left {
	align-items: flex-start;
}
.kslp-vg-layout--single.kslp-vg-align--center {
	align-items: center;
}
.kslp-vg-layout--single.kslp-vg-align--right {
	align-items: flex-end;
}
.kslp-vg-layout--single .kslp-vg-card {
	width: 100%;
}

/* Grid Mode */
.kslp-vg-layout--grid {
	display: grid;
	width: 100%;
	box-sizing: border-box;
}

/* Carousel Mode */
.kslp-vg-carousel-wrapper {
	position: relative;
	width: 100%;
}

.kslp-vg-carousel-track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE */
	padding-bottom: 8px;
}
.kslp-vg-carousel-track::-webkit-scrollbar {
	display: none; /* Chrome/Safari */
}

.kslp-vg-carousel-track .kslp-vg-card {
	flex: 0 0 auto;
	scroll-snap-align: start;
	box-sizing: border-box;
}

/* Carousel Navigation Arrows */
.kslp-vg-carousel-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 18px;
}

.kslp-vg-carousel-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #ffffff;
	color: #0f172a;
	border: 1px solid #e2e8f0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	cursor: pointer;
	transition: all 0.2s ease;
	outline: none;
	padding: 0;
}
.kslp-vg-carousel-btn:hover {
	background: #0f172a;
	color: #ffffff;
	border-color: #0f172a;
	transform: scale(1.05);
}
.kslp-vg-carousel-btn:active {
	transform: scale(0.95);
}

.kslp-vg-carousel-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 14px;
}
.kslp-vg-carousel-dot {
	width: 8px;
	height: 8px;
	border-radius: 4px;
	background: #cbd5e1;
	border: none;
	cursor: pointer;
	padding: 0;
	transition: all 0.25s ease;
}
.kslp-vg-carousel-dot.is-active {
	width: 24px;
	background: #2563eb;
}

/* --- Video Card Styling --- */
.kslp-vg-card {
	display: flex;
	flex-direction: column;
	border-radius: 12px;
	background: #ffffff;
	box-sizing: border-box;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kslp-vg-card--shadow-none { box-shadow: none; }
.kslp-vg-card--shadow-sm { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04); }
.kslp-vg-card--shadow-md { box-shadow: 0 4px 12px -1px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04); }
.kslp-vg-card--shadow-lg { box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.05); }
.kslp-vg-card--shadow-glow { box-shadow: 0 0 20px rgba(37, 99, 235, 0.25); }

.kslp-vg-card:hover {
	transform: translateY(-4px);
}
.kslp-vg-card--shadow-md:hover {
	box-shadow: 0 12px 24px -2px rgba(0, 0, 0, 0.12), 0 4px 8px -1px rgba(0, 0, 0, 0.06);
}
.kslp-vg-card--shadow-lg:hover {
	box-shadow: 0 20px 35px -4px rgba(0, 0, 0, 0.16), 0 8px 16px -2px rgba(0, 0, 0, 0.08);
}

/* --- Media Player / Facade Wrapper --- */
.kslp-vg-media-wrap {
	position: relative;
	width: 100%;
	background: #090d16;
	overflow: hidden;
	border-radius: 8px;
	cursor: pointer;
}

/* Aspect Ratios */
.kslp-vg-aspect--16-9 { aspect-ratio: 16 / 9; }
.kslp-vg-aspect--9-16 { aspect-ratio: 9 / 16; }
.kslp-vg-aspect--1-1  { aspect-ratio: 1 / 1; }
.kslp-vg-aspect--4-3  { aspect-ratio: 4 / 3; }

/* Poster Thumbnail */
.kslp-vg-poster {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease, filter 0.3s ease;
	display: block;
}
.kslp-vg-media-wrap:hover .kslp-vg-poster {
	transform: scale(1.05);
	filter: brightness(0.92);
}

/* Source / Duration Badge */
.kslp-vg-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	color: #ffffff;
	background: rgba(15, 23, 42, 0.75);
	backdrop-filter: blur(4px);
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	letter-spacing: 0.02em;
}

/* Platform Icon in Badge */
.kslp-vg-badge svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

/* Play Button Overlay */
.kslp-vg-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 4;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.kslp-vg-play-btn svg {
	width: 40%;
	height: 40%;
	margin-left: 6%; /* Visual optical center adjustment */
	fill: currentColor;
	display: block;
}

/* Play Button Glow Style */
.kslp-vg-play--glow {
	box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6);
	animation: kslp-pulse-glow 2s infinite;
}
@keyframes kslp-pulse-glow {
	0% {
		box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
	}
	70% {
		box-shadow: 0 0 0 16px rgba(255, 255, 255, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
	}
}

.kslp-vg-media-wrap:hover .kslp-vg-play-btn {
	transform: translate(-50%, -50%) scale(1.12);
}

/* Play Button Glass Style */
.kslp-vg-play--glass {
	background: rgba(255, 255, 255, 0.25) !important;
	backdrop-filter: blur(8px);
	border: 1.5px solid rgba(255, 255, 255, 0.6);
	color: #ffffff !important;
}

/* Play Button Outline Style */
.kslp-vg-play--outline {
	background: rgba(0, 0, 0, 0.4) !important;
	border: 2px solid #ffffff;
	color: #ffffff !important;
}

/* Play Button Minimal Style */
.kslp-vg-play--minimal {
	background: transparent !important;
	color: #ffffff !important;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Dynamic iframe / video injection */
.kslp-vg-iframe-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 5;
	background: #000000;
}
.kslp-vg-iframe-container iframe,
.kslp-vg-iframe-container video {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* --- Card Content (Caption & Description) --- */
.kslp-vg-content {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-top: 12px;
	box-sizing: border-box;
}

.kslp-vg-caption {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: #0f172a;
	word-break: break-word;
}

.kslp-vg-desc {
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	color: #64748b;
	word-break: break-word;
}

/* Alignment Classes */
.kslp-vg-align--left .kslp-vg-content { text-align: left; }
.kslp-vg-align--center .kslp-vg-content { text-align: center; }
.kslp-vg-align--right .kslp-vg-content { text-align: right; }

/* --- Cinematic Lightbox Modal --- */
.kslp-vg-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(10, 15, 29, 0.88);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	box-sizing: border-box;
	padding: 20px;
}

.kslp-vg-modal.is-active {
	opacity: 1;
	visibility: visible;
}

.kslp-vg-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 900px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	background: #0f172a;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
	transform: scale(0.95);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.kslp-vg-modal.is-active .kslp-vg-modal__dialog {
	transform: scale(1);
}

.kslp-vg-modal__player {
	position: relative;
	width: 100%;
	background: #000000;
	aspect-ratio: 16 / 9;
}
.kslp-vg-modal__player.is-vertical {
	max-width: 420px;
	margin: 0 auto;
	aspect-ratio: 9 / 16;
}

.kslp-vg-modal__player iframe,
.kslp-vg-modal__player video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}

.kslp-vg-modal__info {
	padding: 16px 20px;
	background: #0f172a;
	color: #ffffff;
}

.kslp-vg-modal__title {
	margin: 0 0 6px 0;
	font-size: 17px;
	font-weight: 600;
	color: #ffffff;
}

.kslp-vg-modal__description {
	margin: 0;
	font-size: 13px;
	color: #94a3b8;
	line-height: 1.5;
}

/* Modal Close & Nav Controls */
.kslp-vg-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: all 0.2s ease;
}
.kslp-vg-modal__close:hover {
	background: rgba(239, 68, 68, 0.9);
	transform: scale(1.1);
}

.kslp-vg-modal__nav-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(15, 23, 42, 0.7);
	backdrop-filter: blur(4px);
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition: all 0.2s ease;
}
.kslp-vg-modal__nav-btn:hover {
	background: #2563eb;
	border-color: #2563eb;
	transform: translateY(-50%) scale(1.1);
}
.kslp-vg-modal__prev { left: 14px; }
.kslp-vg-modal__next { right: 14px; }

/* --- Gutenberg Editor Styles & On-Canvas Toolbar --- */
.kslp-vg-editor-card {
	position: relative;
}

.kslp-vg-editor-toolbar {
	position: absolute;
	top: 8px;
	left: 8px;
	display: flex;
	align-items: center;
	gap: 4px;
	background: #0f172a;
	padding: 3px 6px;
	border-radius: 6px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	z-index: 20;
	opacity: 0;
	transition: opacity 0.2s ease;
}
.kslp-vg-editor-card:hover .kslp-vg-editor-toolbar,
.kslp-vg-editor-card:focus-within .kslp-vg-editor-toolbar {
	opacity: 1;
}

.kslp-vg-editor-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 4px;
	background: transparent;
	border: none;
	color: #ffffff;
	cursor: pointer;
	font-size: 12px;
	padding: 0;
}
.kslp-vg-editor-btn:hover {
	background: rgba(255, 255, 255, 0.2);
}
.kslp-vg-editor-btn--danger:hover {
	background: #ef4444;
}

.kslp-vg-add-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 2px dashed #cbd5e1;
	border-radius: 12px;
	padding: 24px 16px;
	background: #f8fafc;
	cursor: pointer;
	transition: all 0.2s ease;
	min-height: 200px;
	box-sizing: border-box;
}
.kslp-vg-add-card:hover {
	border-color: #2563eb;
	background: #eff6ff;
}
.kslp-vg-add-card__icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #2563eb;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}
.kslp-vg-add-card__text {
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
}

/* Responsive adjustments */
@media (max-width: 767px) {
	.kslp-vg-modal {
		padding: 10px;
	}
	.kslp-vg-modal__dialog {
		max-height: 95vh;
	}
	.kslp-vg-modal__nav-btn {
		width: 36px;
		height: 36px;
	}
	.kslp-vg-modal__prev { left: 6px; }
	.kslp-vg-modal__next { right: 6px; }
}
