/**
 * Capsule Video Widget Styles
 * 
 * @package Serenity_Toolkit_Pro
 */

/* Remove widget gaps */
.elementor-widget-serenity_capsule_video {
	margin: 0 !important;
	padding: 0 !important;
}

.elementor-widget-serenity_capsule_video .elementor-widget-container {
	margin: 0 !important;
	padding: 0 !important;
}

/* ===============================
 CONTAINER
================================ */
.capsule-container {
	margin: 0 !important;
	padding: 0 !important;
}

.capsule-scroll-wrapper {
	height: 1000vh;
	position: relative;
	margin: 0 !important;
	padding: 0 !important;
}

/* ===============================
 STICKY SECTION
================================ */
.capsule-sticky {
	position: sticky;
	top: 0;
	height: 100vh;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

/* ===============================
 CAPSULE VIDEO
================================ */
.capsule-video {
	width: 800px;
	height: 450px;
	border-radius: 999px;
	overflow: hidden;
	background: #000;
	position: relative;
	will-change: width, height, border-radius;
}

.capsule-video video,
.capsule-fallback-image {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	min-width: 100%;
	min-height: 100%;
	width: auto;
	height: auto;
	object-fit: cover;
	pointer-events: none;
	display: block;
}

/* Hide all video controls */
.capsule-video video::-webkit-media-controls {
	display: none !important;
}

.capsule-video video::-webkit-media-controls-enclosure {
	display: none !important;
}

.capsule-video video::-webkit-media-controls-panel {
	display: none !important;
}

/* ===============================
 TEXT
================================ */
.capsule-text-item {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: clamp(22px, 3vw, 44px);
	color: #fff;
	text-align: center;
	pointer-events: none;
	font-weight: 500;
	max-width: 80%;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0;
	z-index: 100;
}

.capsule-text-item.show {
	animation: textFadeIn 2s ease-out forwards;
}

.capsule-text-item.hide {
	animation: textFadeOut 2s ease-in forwards;
}

@keyframes textFadeIn {
	from {
		opacity: 0;
		transform: translate(-50%, -50%) translateY(80px);
	}
	to {
		opacity: 1;
		transform: translate(-50%, -50%) translateY(0);
	}
}

@keyframes textFadeOut {
	from {
		opacity: 1;
		transform: translate(-50%, -50%) translateY(0);
	}
	to {
		opacity: 0;
		transform: translate(-50%, -50%) translateY(-80px);
	}
}

/* ===============================
 MOBILE RESPONSIVE
================================ */
@media (max-width: 767px) {
	.capsule-video {
		width: 75vw;
		height: 72vh;
		border-radius: 999px;
	}
	
	.capsule-video video,
	.capsule-fallback-image {
		min-width: 100vw;
		min-height: 100vh;
	}
	
	.capsule-text-item {
		font-size: 22px;
		max-width: 95%;
		width: 95%;
		white-space: normal;
		padding: 0 20px;
	}
	
	.capsule-scroll-wrapper {
		height: 1100vh;
	}
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
	.capsule-video {
		width: 80vw;
		height: 60vh;
	}
	
	.capsule-video video,
	.capsule-fallback-image {
		min-width: 100vw;
		min-height: 100vh;
	}
	
	.capsule-text-item {
		font-size: clamp(24px, 4vw, 36px);
		max-width: 85%;
	}
}
