/**
 * Video Carrusel Fullwitch - Styles
 * Creado por Hedonai
 *
 * @package Video_Carrusel_Fullwitch
 * @version 2.7.8
 * @author Hedonai
 */

/* ==========================================
   Carousel Wrapper
   ========================================== */

/* Force overflow visible on Elementor containers */
.elementor-widget-video-carousel {
	overflow: visible !important;
}

.elementor-widget-video-carousel .elementor-widget-container {
	overflow: visible !important;
}

.video-carousel-wrapper {
	position: relative;
	width: 100%;
	overflow: visible !important;
	padding: 40px 0;
	margin: 0 auto;
}

.video-carousel-wrapper .splide {
	width: 100%;
	height: 100%;
	padding: 20px 0;
	overflow: visible !important;
}

.video-carousel-wrapper .splide__track {
	overflow: visible !important;
}

.video-carousel-wrapper .splide__list {
	display: flex;
	align-items: center;
}

/* ==========================================
   Slides
   ========================================== */

.video-carousel-slide {
	position: relative;
	width: 100%;
	height: 500px;
	overflow: hidden;
	border-radius: 12px;
	cursor: pointer;
}

/* Image Background */
.video-carousel-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	z-index: 1;
	transition: transform 0.6s ease, filter 0.6s ease;
}

/* Hover effect - zoom and brighten */
.video-carousel-slide:hover .video-carousel-image {
	transform: scale(1.05);
	filter: brightness(1.1);
}

/* ==========================================
   Bottom Gradient Overlay (Always Visible)
   ========================================== */

.video-carousel-gradient {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 50%;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.85) 0%,
		rgba(0, 0, 0, 0.3) 40%,
		transparent 100%
	);
	pointer-events: none;
	z-index: 0;
}

/* ==========================================
   Text Content (Visible Only on Center Slide)
   ========================================== */

.video-carousel-content {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	padding: 30px;
	z-index: 2;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
}

/* Show text only on active (center) slide */
.splide__slide.is-active .video-carousel-content {
	opacity: 1;
	visibility: visible;
}

.video-carousel-title {
	font-size: 24px;
	font-weight: 700;
	color: #ffffff;
	margin: 0 0 8px 0;
	line-height: 1.3;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-carousel-description {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.9);
	margin: 0;
	line-height: 1.5;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ==========================================
   Play Icon (Hidden, Appears on Hover)
   ========================================== */

.video-carousel-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.8);
	width: 80px;
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	z-index: 3;
	transition: opacity 0.4s ease, transform 0.4s ease;
	pointer-events: none; /* Don't block hover on canvas */
}

.video-carousel-play-icon svg {
	width: 100%;
	height: 100%;
	color: #ffffff;
	filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

/* ==========================================
   Hover Effects
   ========================================== */

.video-carousel-slide:hover .video-carousel-play-icon {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* ==========================================
   Splide Navigation (Arrows)
   ========================================== */

.video-carousel-wrapper .splide__arrow {
	background: rgba(0, 0, 0, 0.5);
	width: 50px;
	height: 50px;
	border-radius: 50%;
	border: none;
	outline: none;
	opacity: 1;
	padding: 0.4rem;
	transition: all 0.3s ease;
}

.video-carousel-wrapper .splide__arrow:focus {
	outline: none;
}

.video-carousel-wrapper .splide__arrow svg {
	fill: none;
	stroke: currentColor;
	width: 100%;
	height: 100%;
}

/* Rotate left arrow 180 degrees */
.video-carousel-wrapper .splide__arrow--prev svg {
	transform: rotate(180deg);
}

.video-carousel-wrapper .splide__arrow:hover {
	background: rgba(0, 0, 0, 0.8);
}

.video-carousel-wrapper .splide__arrow:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

/* ==========================================
   Splide Pagination (Dots)
   ========================================== */

.video-carousel-wrapper .splide__pagination {
	position: relative;
	margin-top: 30px;
	padding: 0;
	bottom: auto;
}

.video-carousel-wrapper .splide__pagination__page {
	width: 12px;
	height: 12px;
	background-color: #ffffff;
	opacity: 0.5;
	transition: all 0.3s ease;
	border: none;
	margin: 0 5px;
}

.video-carousel-wrapper .splide__pagination__page.is-active {
	opacity: 1;
	background-color: #ffffff;
	transform: scale(1.2);
}

/* ==========================================
   Centered Effect - Side Slides Clean (No opacity effects)
   ========================================== */

.video-carousel-wrapper .splide {
	overflow: visible;
}

.video-carousel-wrapper .splide__slide {
	opacity: 1;
	transition: opacity 0.3s ease, transform 0.3s ease;
	transform: scale(1);
}

.video-carousel-wrapper .splide__slide.is-active {
	opacity: 1;
	transform: scale(1);
	z-index: 10;
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 1024px) {
	.video-carousel-slide {
		height: 400px;
	}

	.video-carousel-content {
		padding: 25px;
	}

	.video-carousel-title {
		font-size: 20px;
	}

	.video-carousel-description {
		font-size: 13px;
	}

	.video-carousel-play-icon {
		width: 70px;
		height: 70px;
	}

	.video-carousel-wrapper .splide__arrow {
		width: 40px;
		height: 40px;
	}

	.video-carousel-wrapper .splide__arrow svg {
		width: 16px;
		height: 16px;
	}
}

@media (max-width: 768px) {
	.video-carousel-slide {
		height: 350px;
	}

	.video-carousel-wrapper {
		padding: 30px 0;
	}

	.video-carousel-content {
		padding: 20px;
	}

	.video-carousel-title {
		font-size: 18px;
	}

	.video-carousel-description {
		font-size: 12px;
	}

	.video-carousel-play-icon {
		width: 60px;
		height: 60px;
	}

	.video-carousel-wrapper .splide__arrow {
		width: 35px;
		height: 35px;
	}

	.video-carousel-wrapper .splide__arrow svg {
		width: 14px;
		height: 14px;
	}

	.video-carousel-wrapper .splide__pagination__page {
		width: 10px;
		height: 10px;
	}
}

@media (max-width: 480px) {
	.video-carousel-slide {
		height: 300px;
	}

	.video-carousel-wrapper {
		padding: 20px 0;
	}

	.video-carousel-content {
		padding: 15px;
	}

	.video-carousel-title {
		font-size: 16px;
		margin-bottom: 5px;
	}

	.video-carousel-description {
		font-size: 11px;
	}

	.video-carousel-play-icon {
		width: 50px;
		height: 50px;
	}
}

/* ==========================================
   Loading State
   ========================================== */

.video-carousel-wrapper .splide:not(.is-initialized) .splide__slide {
	opacity: 0;
}

.video-carousel-wrapper .splide.is-initialized .splide__slide {
	animation: fadeInSlide 0.5s ease forwards;
}

@keyframes fadeInSlide {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==========================================
   Accessibility
   ========================================== */

.video-carousel-slide:focus {
	outline: 2px solid #ffffff;
	outline-offset: 4px;
}

.video-carousel-wrapper .splide__arrow:focus {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* ==========================================
   Custom Video Modal
   ========================================== */

.video-carousel-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	z-index: 999999;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

.video-carousel-modal.active {
	display: flex;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.video-carousel-modal-content {
	position: relative;
	width: 90%;
	max-width: 1200px;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	animation: slideIn 0.3s ease;
}

@keyframes slideIn {
	from {
		transform: translateY(-50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.video-carousel-modal-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: rgba(255, 255, 255, 0.2);
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-radius: 50%;
	color: #ffffff;
	font-size: 28px;
	font-weight: 300;
	font-family: Arial, sans-serif;
	cursor: pointer;
	width: 44px;
	height: 44px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	z-index: 1000001;
	line-height: 44px;
}

.video-carousel-modal-close:hover {
	transform: scale(1.1);
	background: rgba(255, 255, 255, 0.35);
	border-color: rgba(255, 255, 255, 0.7);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.video-carousel-modal-video {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 aspect ratio for iframes */
	height: 0;
	overflow: hidden;
}

/* Special container for native videos - no forced aspect ratio */
.video-carousel-modal-video.native-video {
	padding-bottom: 0;
	height: 80vh; /* Use viewport height for better vertical video display */
	display: flex;
	align-items: center;
	justify-content: center;
}

.video-carousel-modal-video iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}

@media (max-width: 768px) {
	.video-carousel-modal-content {
		width: 95%;
	}

	.video-carousel-modal-close {
		top: 15px;
		right: 15px;
		font-size: 26px;
		width: 40px;
		height: 40px;
		line-height: 40px;
	}
}

@media (max-width: 480px) {
	.video-carousel-modal-close {
		top: 10px;
		right: 10px;
		font-size: 24px;
		width: 36px;
		height: 36px;
		line-height: 36px;
	}
}

/* ==========================================
   Fullscreen Mode Styles
   ========================================== */

.video-carousel-modal:-webkit-full-screen {
	width: 100vw !important;
	height: 100vh !important;
}

.video-carousel-modal:-moz-full-screen {
	width: 100vw !important;
	height: 100vh !important;
}

.video-carousel-modal:fullscreen {
	width: 100vw !important;
	height: 100vh !important;
}

/* Fullscreen modal content adjustments */
.video-carousel-modal:-webkit-full-screen .video-carousel-modal-content,
.video-carousel-modal:-moz-full-screen .video-carousel-modal-content,
.video-carousel-modal:fullscreen .video-carousel-modal-content {
	width: 100%;
	max-width: 100%;
	height: 100%;
	border-radius: 0;
}

/* Fullscreen video container */
.video-carousel-modal:-webkit-full-screen .video-carousel-modal-video,
.video-carousel-modal:-moz-full-screen .video-carousel-modal-video,
.video-carousel-modal:fullscreen .video-carousel-modal-video {
	padding-bottom: 0;
	height: 100%;
}

/* Hide close button in fullscreen on mobile (use back gesture/button) */
@media (max-width: 768px) {
	.video-carousel-modal:-webkit-full-screen .video-carousel-modal-close,
	.video-carousel-modal:-moz-full-screen .video-carousel-modal-close,
	.video-carousel-modal:fullscreen .video-carousel-modal-close {
		display: none;
	}
}

/* ==========================================
   Mobile Fullscreen Mode
   ========================================== */

/* Make modal fullscreen on mobile */
.video-carousel-modal.mobile-fullscreen {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	max-width: 100vw !important;
	max-height: 100vh !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 0 !important;
	z-index: 999999 !important;
}

.video-carousel-modal.mobile-fullscreen .video-carousel-modal-content {
	width: 100vw !important;
	height: 100vh !important;
	max-width: 100vw !important;
	border-radius: 0 !important;
	margin: 0 !important;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.video-carousel-modal.mobile-fullscreen .video-carousel-modal-video {
	padding-bottom: 0 !important;
	height: 100% !important;
}

/* Mobile fullscreen for native videos */
.video-carousel-modal.mobile-fullscreen .video-carousel-modal-video.native-video {
	height: 100vh !important;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

/* Mobile iframe container - maintain aspect ratio */
.video-carousel-modal.mobile-fullscreen .video-carousel-modal-video {
	position: relative;
	width: 100%;
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: #000;
}

.video-carousel-modal.mobile-fullscreen .video-carousel-modal-video iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 100%;
	height: auto;
	max-width: 100vw;
	max-height: 100vh;
	aspect-ratio: 16/9;
}

/* Ensure no scrolling when mobile modal is open */
body.video-modal-open-mobile {
	overflow: hidden !important;
}

/* Make close button more visible on mobile fullscreen */
.video-carousel-modal.mobile-fullscreen .video-carousel-modal-close {
	position: fixed !important;
	top: 10px !important;
	right: 10px !important;
	z-index: 1000002 !important;
	background: rgba(0, 0, 0, 0.8) !important;
	border: 2px solid rgba(255, 255, 255, 0.8) !important;
}

/* ==========================================
   Native Video Element Styles
   ========================================== */

/* Style for native HTML5 video */
.video-carousel-modal video {
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	background: #000;
}

/* When inside native-video container */
.video-carousel-modal-video.native-video video {
	position: relative;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
}

/* Fullscreen video styles */
.video-carousel-modal video:fullscreen {
	width: 100vw !important;
	height: 100vh !important;
}

.video-carousel-modal video:-webkit-full-screen {
	width: 100vw !important;
	height: 100vh !important;
}

/* Mobile specific video styles */
@media (max-width: 768px) {
	/* Native videos - contain within viewport */
	.video-carousel-modal.mobile-fullscreen video {
		position: relative;
		width: auto !important;
		height: auto !important;
		max-width: 100vw !important;
		max-height: 100vh !important;
		object-fit: contain;
	}

	/* Native video container in mobile modal */
	.video-carousel-modal-video.native-video {
		height: 100vh !important;
		padding: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #000;
	}

	.video-carousel-modal-video.native-video video {
		max-width: 100vw !important;
		max-height: 100vh !important;
		width: auto;
		height: auto;
	}

	/* Modal content in mobile */
	.video-carousel-modal.mobile-fullscreen .video-carousel-modal-content {
		height: 100vh !important;
		max-width: 100vw !important;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	/* Override the 56.25% padding for mobile */
	.video-carousel-modal.mobile-fullscreen .video-carousel-modal-video {
		padding-bottom: 0 !important;
	}
}
