@keyframes fade-in-up {
	0% {
		opacity: 0;
   }
	100% {
		transform: translateY(0);
		opacity: 1;
   }
}

/* Higher specificity to override Astra theme - only when stuck */
body .video-wrap .video.stuck iframe {
	max-width: 100% !important;
	max-height: 100% !important;
}

/* Override Astra theme's oembed container styles */
body .video-wrap .video.stuck,
body .ast-oembed-container .video.stuck,
.video.stuck {
	position: fixed !important;
	transform: translateY(0) !important;
	animation: fade-in-up 0.25s ease forwards !important;
	z-index: 999999 !important;
	opacity: 1 !important;
	/* Position and size will be set by JavaScript from admin settings */
}

/* Ensure iframe inside stuck video maintains proper positioning */
body .video-wrap .video.stuck iframe,
body .ast-oembed-container .video.stuck iframe {
	position: relative !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
}

/* Additional override for maximum compatibility */
.video.stuck {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* Ensure video-wrap doesn't interfere and maintains proper height */
.video-wrap {
	position: relative;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	width: 100%;
	height: auto;
	min-height: inherit;
}

/* Normal video state (non-sticky) - ensure proper display */
.video-wrap .video:not(.stuck) {
	position: relative !important;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	width: 100%;
	height: auto;
	line-height: 0;
}

/* Ensure iframe displays properly in normal state */
.video-wrap .video:not(.stuck) iframe {
	position: relative !important;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}

/* Fix WordPress responsive embed padding issue - prevents 75% padding-top */
.wp-embed-responsive .wp-embed-aspect-4-3 .wp-block-embed__wrapper:before,
.wp-embed-responsive .wp-embed-aspect-16-9 .wp-block-embed__wrapper:before,
.wp-embed-responsive .wp-embed-aspect-21-9 .wp-block-embed__wrapper:before {
	padding-top: 0 !important;
}

/* Fix WordPress responsive embed iframe height - allow natural height */
.wp-embed-responsive .wp-has-aspect-ratio iframe {
	height: revert-layer !important;
}

/* Only remove WordPress responsive embed padding when video is stuck 
   This prevents breaking normal video aspect ratios */
.video.stuck:before,
.video.stuck:after {
	display: none !important;
	content: none !important;
	padding-top: 0 !important;
}

.video-wrap .video.stuck {
	position: fixed !important;
}

/* Top Bar - Facebook Style */
.video.stuck .wpj-video-top-bar {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	height: 40px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	padding: 0 10px !important;
	z-index: 1000001 !important;
	border-radius: 4px 4px 0 0 !important;
}



/* Close button styles - in top bar */
.video.stuck .wpj-close-btn {
	position: relative !important;
	width: 28px !important;
	height: 28px !important;
	background: rgba(255, 255, 255, 0.2) !important;
	border: none !important;
	border-radius: 4px !important;
	cursor: pointer !important;
	z-index: 1000002 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: all 0.2s ease !important;
	flex-shrink: 0 !important;
}

/* CSS-drawn X using pseudo-elements */
.video.stuck .wpj-close-btn::before,
.video.stuck .wpj-close-btn::after {
	content: '' !important;
	position: absolute !important;
	width: 12px !important;
	height: 2px !important;
	background: white !important;
	border-radius: 1px !important;
}

.video.stuck .wpj-close-btn::before {
	transform: rotate(45deg) !important;
}

.video.stuck .wpj-close-btn::after {
	transform: rotate(-45deg) !important;
}

.video.stuck .wpj-close-btn:hover {
	background: rgba(255, 255, 255, 0.3) !important;
}

/* Hide close button on normal videos */
.video:not(.stuck) .wpj-close-btn {
	display: none !important;
}

/* Hide top bar on normal videos */
.video:not(.stuck) .wpj-video-top-bar {
	display: none !important;
}

/* Mobile adjustments for top bar */
@media (max-width: 768px) {
	.video.stuck .wpj-video-top-bar {
		height: 35px !important;
		padding: 0 8px !important;
	}

	.video.stuck .wpj-close-btn {
		width: 26px !important;
		height: 26px !important;
	}
}

/* ===== PRO FEATURES CSS ===== */

/* PRO: Resize Handles */
.wpj-resize-handle {
	position: absolute !important;
	width: 16px !important;
	height: 16px !important;
	background: rgba(255, 255, 255, 0.8) !important;
	border: 2px solid rgba(0, 0, 0, 0.3) !important;
	border-radius: 50% !important;
	z-index: 1000003 !important;
	cursor: pointer !important;
	transition: transform 0.15s ease, background 0.15s ease !important;
}

.wpj-resize-handle:hover {
	background: #fff !important;
	transform: scale(1.2) !important;
	border-color: rgba(0, 0, 0, 0.5) !important;
}

/* Resize handle positions */
.wpj-resize-se {
	bottom: -8px !important;
	right: -8px !important;
	cursor: se-resize !important;
}

.wpj-resize-sw {
	bottom: -8px !important;
	left: -8px !important;
	cursor: sw-resize !important;
}

.wpj-resize-ne {
	top: -8px !important;
	right: -8px !important;
	cursor: ne-resize !important;
}

.wpj-resize-nw {
	top: -8px !important;
	left: -8px !important;
	cursor: nw-resize !important;
}

/* Hide resize handles on normal videos */
.video:not(.stuck) .wpj-resize-handle {
	display: none !important;
}

/* PRO: HTML5 Video Support */
.video.stuck video {
	position: relative !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
}

.video-wrap .video:not(.stuck) video {
	position: relative !important;
	display: block !important;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 16 / 9;
}

/* PRO: Multiple Videos - Stack effect */
.video.stuck[data-video-id="1"] {
	z-index: 999998 !important;
}

.video.stuck[data-video-id="2"] {
	z-index: 999997 !important;
}

.video.stuck[data-video-id="3"] {
	z-index: 999996 !important;
}

/* PRO: Mobile resize handles adjustments */
@media (max-width: 768px) {
	.wpj-resize-handle {
		width: 20px !important;
		height: 20px !important;
	}

	.wpj-resize-se {
		bottom: -10px !important;
		right: -10px !important;
	}

	.wpj-resize-sw {
		bottom: -10px !important;
		left: -10px !important;
	}

	.wpj-resize-ne {
		top: -10px !important;
		right: -10px !important;
	}

	.wpj-resize-nw {
		top: -10px !important;
		left: -10px !important;
	}
}

/* PRO: Smooth resizing transition */
.video.stuck {
	transition: width 0.1s ease, height 0.1s ease !important;
}

/* Disable transition during resize */
.video.stuck.resizing {
	transition: none !important;
}