/**
 * Custom Video Player Styles
 * Full-featured HTML5 video player with custom controls
 */

/* ============================================
   VIDEO PLAYER CONTAINER
   ============================================ */

.video-player-container {
	position: relative;
	width: 100%;
	max-width: 100%;
	border-radius: 8px;
	overflow: visible;
	display: block;
}

/* Ensure video maintains aspect ratio on all devices */
.video-player-container,
.video-player-wrapper {
	-webkit-tap-highlight-color: transparent;
}

/* Fix for GenerateBlocks containers */
.video-player-container.gb-element-258057d3,
.video-player-container > div {
	line-height: 0;
}

.video-player-container img,
.video-player-container video {
	line-height: 0;
	font-size: 0;
}

/* Thumbnail Trigger (Image + Play Button) */
.video-player-trigger {
	position: relative;
	cursor: pointer;
	display: block;
	transition: opacity 0.3s ease;
	line-height: 0;
	width: 63.55556rem;
	height: 35.75rem;
	max-width: 100%;
	overflow: hidden;
	border-radius: 20px;
}

.video-player-trigger.hidden {
	opacity: 0;
	pointer-events: none;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 0;
	z-index: -1;
	visibility: hidden;
	overflow: hidden;
}

.video-player-trigger img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ============================================
   VIDEO ELEMENT
   ============================================ */

.video-player-video {
	display: none;
	width: 100%;
	height: auto;
	background: #000;
	border-radius: 8px;
}

.video-player-video.active {
	display: block;
}

/* ============================================
   VIDEO PLAYER WRAPPER
   ============================================ */

.video-player-wrapper {
	position: relative;
	width: 100%;
	height: 35.75rem;
	max-width: 100%;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	line-height: 0;
}

.video-player-wrapper video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.video-player-wrapper:fullscreen {
	border-radius: 0;
}

.video-player-wrapper:-webkit-full-screen {
	border-radius: 0;
}

.video-player-wrapper:-moz-full-screen {
	border-radius: 0;
}

.video-player-wrapper:-ms-fullscreen {
	border-radius: 0;
}

/* ============================================
   CUSTOM CONTROLS
   ============================================ */

/* Gradient overlay at bottom for contrast */
.video-player-wrapper::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 180px;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.7) 0%,
		rgba(0, 0, 0, 0.4) 30%,
		rgba(0, 0, 0, 0) 100%
	);
	pointer-events: none;
	z-index: 9;
	opacity: 0;
	transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-player-wrapper:hover::after,
.video-player-wrapper.controls-visible::after {
	opacity: 1;
}

.video-controls {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: transparent;
	padding: 20px 24px 24px;
	opacity: 0;
	transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
	            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform: translateY(10px);
	z-index: 10;
}

.video-player-wrapper:hover .video-controls,
.video-controls.show {
	opacity: 1;
	transform: translateY(0);
}

.video-controls-inner {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* ============================================
   TIMELINE / PROGRESS BAR
   ============================================ */

.video-timeline {
	position: relative;
	width: 100%;
	height: 5px;
	background: rgba(255, 255, 255, 0.25);
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: visible;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.video-timeline:hover {
	height: 7px;
	background: rgba(255, 255, 255, 0.3);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.video-timeline-buffered {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: rgba(255, 255, 255, 0.4);
	border-radius: 10px;
	width: 0%;
	pointer-events: none;
	transition: width 0.3s ease;
}

.video-timeline-progress {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: linear-gradient(90deg, #ffffff 0%, #e0e0e0 100%);
	border-radius: 10px;
	width: 0%;
	transition: width 0.1s linear;
	pointer-events: none;
	box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.video-timeline:hover .video-timeline-progress {
	box-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
}

/* Timeline Thumb/Scrubber */
.video-timeline-thumb {
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%) scale(0);
	width: 16px;
	height: 16px;
	background: #ffffff;
	border-radius: 50%;
	opacity: 0;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
	box-shadow: 
		0 2px 8px rgba(0, 0, 0, 0.4),
		0 0 0 3px rgba(255, 255, 255, 0.3);
}

.video-timeline:hover .video-timeline-thumb {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* Timeline Preview Tooltip - Frosted Glass */
.video-timeline-preview {
	position: absolute;
	bottom: 140%;
	transform: translateX(-50%);
	background: rgba(30, 30, 30, 0.9);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 
		0 4px 16px rgba(0, 0, 0, 0.5),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	color: #ffffff;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	transform-origin: bottom center;
}

.video-timeline:hover .video-timeline-preview {
	opacity: 1;
	transform: translateX(-50%) translateY(-4px);
}

.video-timeline-preview::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: rgba(30, 30, 30, 0.9);
}

/* ============================================
   CONTROL BUTTONS ROW
   ============================================ */

.video-controls-buttons {
	display: flex;
	align-items: center;
	gap: 12px;
}

.video-control-button {
	background: transparent;
	border: none;
	color: #ffffff;
	cursor: pointer;
	padding: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 50%;
	position: relative;
}

.video-control-button::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	opacity: 0;
	transform: scale(0.8);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-control-button:hover::before {
	opacity: 1;
	transform: scale(1);
}

.video-control-button:hover {
	transform: scale(1.15);
}

.video-control-button:active {
	transform: scale(0.9);
}

.video-control-button:active::before {
	background: rgba(255, 255, 255, 0.2);
}

.video-control-button svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
	position: relative;
	z-index: 1;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Play/Pause Button - larger and more prominent */
.video-control-play-pause {
	padding: 12px;
}

.video-control-play-pause svg {
	width: 28px;
	height: 28px;
}

.video-control-play-pause:hover {
	transform: scale(1.2);
}

/* ============================================
   TIME DISPLAY
   ============================================ */

.video-time-display {
	color: #ffffff;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	user-select: none;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* ============================================
   VOLUME CONTROL
   ============================================ */

.video-volume-control {
	display: flex;
	align-items: center;
	gap: 4px;
	background: rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 50px;
	padding: 6px 10px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-volume-control:hover {
	background: rgba(0, 0, 0, 0.5);
	padding: 6px 14px;
}

.video-volume-slider {
	width: 0;
	opacity: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
	            opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-volume-control:hover .video-volume-slider {
	width: 80px;
	opacity: 1;
	margin-left: 4px;
}

.video-volume-slider input[type="range"] {
	width: 100%;
	height: 4px;
	background: transparent;
	border-radius: 2px;
	outline: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	position: relative;
	vertical-align: middle;
}

/* WebKit Thumb */
.video-volume-slider input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	background: #ffffff;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
	position: relative;
	margin-top: -5px;
	transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-volume-slider input[type="range"]::-webkit-slider-thumb:hover {
	transform: scale(1.2);
}

/* Mozilla Thumb */
.video-volume-slider input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	background: #ffffff;
	border-radius: 50%;
	cursor: pointer;
	border: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
	transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-volume-slider input[type="range"]::-moz-range-thumb:hover {
	transform: scale(1.2);
}

/* WebKit Track */
.video-volume-slider input[type="range"]::-webkit-slider-runnable-track {
	width: 100%;
	height: 4px;
	background: linear-gradient(
		to right, 
		#ffffff 0%, 
		#ffffff var(--volume-level, 100%), 
		rgba(255, 255, 255, 0.3) var(--volume-level, 100%), 
		rgba(255, 255, 255, 0.3) 100%
	);
	border-radius: 2px;
}

/* Mozilla Track */
.video-volume-slider input[type="range"]::-moz-range-track {
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
}

/* Mozilla Progress */
.video-volume-slider input[type="range"]::-moz-range-progress {
	height: 4px;
	background: #ffffff;
	border-radius: 2px;
}

/* ============================================
   SPACER (pushes fullscreen to right)
   ============================================ */

.video-controls-spacer {
	flex: 1;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.video-loading-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 50px;
	height: 50px;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	opacity: 0;
	pointer-events: none;
	z-index: 5;
}

.video-loading-spinner.show {
	opacity: 1;
}

@keyframes spin {
	to {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

/* ============================================
   CENTER PLAY BUTTON OVERLAY
   ============================================ */

.video-center-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: inline-flex;
	overflow: hidden;
	border-radius: 999px;
	padding: 1rem;
	line-height: 0;
	cursor: pointer;
	opacity: 0;
	z-index: 8;
	pointer-events: none;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.video-center-play.show {
	opacity: 1;
	pointer-events: all;
}

/* Override play-button-hover to maintain centered position */
.video-center-play:hover {
	transform: translate(-50%, -50%) scale(1.1);
	opacity: 0.9;
}

.video-center-play svg {
	width: 30px;
	height: 30px;
	display: block;
}

/* ============================================
   PLAYBACK FEEDBACK (YouTube-style)
   ============================================ */

.video-playback-feedback {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.8);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 50%;
	opacity: 0;
	z-index: 15;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.video-playback-feedback.show {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.video-playback-feedback svg {
	width: 40px;
	height: 40px;
	fill: #ffffff;
	display: block;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Responsive adjustment for fixed dimensions */
@media (max-width: 1200px) {
	.video-player-trigger,
	.video-player-wrapper {
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 9;
	}

	.video-player-trigger img,
	.video-player-wrapper video {
		object-fit: cover;
	}
}

/* Tablets (Landscape & Portrait) */
@media (max-width: 1024px) {
	.video-player-container {
		max-width: 100%;
	}

	.video-player-wrapper::after {
		height: 160px;
	}

	.video-controls {
		padding: 18px 20px 22px;
	}

	.video-controls-inner {
		gap: 13px;
	}

	.video-controls-buttons {
		gap: 8px;
	}

	.video-control-button {
		padding: 9px;
	}

	.video-control-button svg {
		width: 20px;
		height: 20px;
	}

	.video-control-play-pause {
		padding: 11px;
	}

	.video-control-play-pause svg {
		width: 26px;
		height: 26px;
	}

	.video-time-display {
		font-size: 13px;
	}

	.video-center-play {
		padding: 0.875rem;
	}

	.video-center-play svg {
		width: 28px;
		height: 28px;
	}

	.video-center-play:hover {
		transform: translate(-50%, -50%) scale(1.15);
	}

	.video-timeline {
		height: 5px;
	}

	.video-timeline:hover {
		height: 7px;
	}
}

/* Mobile Devices (Landscape & Portrait) */
@media (max-width: 768px) {
	.video-player-wrapper::after {
		height: 100px;
	}

	.video-controls {
		padding: 8px 10px 12px;
	}

	.video-controls-inner {
		gap: 8px;
	}

	.video-controls-buttons {
		gap: 4px;
		flex-wrap: nowrap;
	}

	.video-control-button {
		padding: 6px;
	}

	.video-control-button svg {
		width: 16px;
		height: 16px;
	}

	.video-control-play-pause {
		padding: 8px;
	}

	.video-control-play-pause svg {
		width: 20px;
		height: 20px;
	}

	.video-time-display {
		font-size: 10px;
		font-weight: 400;
	}

	.video-volume-control {
		padding: 4px 6px;
	}

	.video-volume-control:hover {
		padding: 4px 10px;
	}

	.video-volume-control:hover .video-volume-slider {
		width: 50px;
	}

	/* Smaller center play button to avoid overlap with controls */
	.video-center-play {
		padding: 0.5rem;
		top: 45%;
	}

	.video-center-play svg {
		width: 20px;
		height: 20px;
	}

	.video-center-play:hover {
		transform: translate(-50%, -50%) scale(1.1);
	}

	/* Smaller playback feedback on mobile */
	.video-playback-feedback {
		width: 60px;
		height: 60px;
	}

	.video-playback-feedback svg {
		width: 30px;
		height: 30px;
	}

	.video-timeline {
		height: 4px;
	}

	.video-timeline:hover {
		height: 5px;
	}

	.video-timeline-preview {
		font-size: 10px;
		padding: 5px 8px;
		bottom: 180%;
	}

	.video-timeline-thumb {
		width: 12px;
		height: 12px;
	}

	/* Better touch target size */
	.video-control-button::before {
		transform: scale(1.2);
	}
}

/* Small Mobile Devices */
@media (max-width: 480px) {
	.video-player-wrapper::after {
		height: 90px;
	}

	.video-controls {
		padding: 6px 8px 10px;
	}

	.video-controls-inner {
		gap: 6px;
	}

	.video-controls-buttons {
		gap: 2px;
	}

	.video-control-button {
		padding: 5px;
	}

	.video-control-button svg {
		width: 14px;
		height: 14px;
	}

	.video-control-play-pause {
		padding: 7px;
	}

	.video-control-play-pause svg {
		width: 18px;
		height: 18px;
	}

	.video-time-display {
		font-size: 9px;
	}

	.video-volume-control {
		padding: 3px 5px;
	}

	.video-volume-control:hover {
		padding: 3px 8px;
	}

	.video-volume-control:hover .video-volume-slider {
		width: 0;
		opacity: 0;
	}

	/* Smaller center play button and positioned higher */
	.video-center-play {
		padding: 0.4rem;
		top: 42%;
	}

	.video-center-play svg {
		width: 18px;
		height: 18px;
	}

	/* Even smaller playback feedback on small mobile */
	.video-playback-feedback {
		width: 50px;
		height: 50px;
	}

	.video-playback-feedback svg {
		width: 25px;
		height: 25px;
	}

	.video-timeline {
		height: 4px;
	}

	.video-timeline:hover {
		height: 5px;
	}

	.video-timeline-preview {
		font-size: 9px;
		padding: 4px 6px;
		bottom: 200%;
	}

	/* Hide volume slider on very small devices - only show mute button */
	.video-volume-control:hover .video-volume-slider {
		width: 0;
		opacity: 0;
	}
}

/* ============================================
   FULLSCREEN STYLES
   ============================================ */

.video-player-wrapper:fullscreen,
.video-player-wrapper:-webkit-full-screen,
.video-player-wrapper:-moz-full-screen,
.video-player-wrapper:-ms-fullscreen {
	width: 100vw;
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.video-player-wrapper:fullscreen::after,
.video-player-wrapper:-webkit-full-screen::after,
.video-player-wrapper:-moz-full-screen::after,
.video-player-wrapper:-ms-fullscreen::after {
	height: 220px;
}

.video-player-wrapper:fullscreen .video-controls,
.video-player-wrapper:-webkit-full-screen .video-controls,
.video-player-wrapper:-moz-full-screen .video-controls,
.video-player-wrapper:-ms-fullscreen .video-controls {
	padding: 24px 40px 32px;
}

.video-player-wrapper:fullscreen .video-player-video,
.video-player-wrapper:-webkit-full-screen .video-player-video,
.video-player-wrapper:-moz-full-screen .video-player-video,
.video-player-wrapper:-ms-fullscreen .video-player-video {
	max-width: 100vw;
	max-height: 100vh;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Landscape orientation in fullscreen */
@media screen and (orientation: landscape) {
	.video-player-wrapper:fullscreen .video-player-video,
	.video-player-wrapper:-webkit-full-screen .video-player-video,
	.video-player-wrapper:-moz-full-screen .video-player-video,
	.video-player-wrapper:-ms-fullscreen .video-player-video {
		width: 100vw;
		height: 100vh;
	}
}

/* Mobile fullscreen optimizations */
@media (max-width: 768px) {
	.video-player-wrapper:fullscreen,
	.video-player-wrapper:-webkit-full-screen,
	.video-player-wrapper:-moz-full-screen,
	.video-player-wrapper:-ms-fullscreen {
		/* Ensure video takes full screen on mobile */
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
	}
	
	.video-player-wrapper:fullscreen .video-player-video,
	.video-player-wrapper:-webkit-full-screen .video-player-video,
	.video-player-wrapper:-moz-full-screen .video-player-video,
	.video-player-wrapper:-ms-fullscreen .video-player-video {
		object-fit: contain;
	}
	
	.video-player-wrapper:fullscreen .video-controls,
	.video-player-wrapper:-webkit-full-screen .video-controls,
	.video-player-wrapper:-moz-full-screen .video-controls,
	.video-player-wrapper:-ms-fullscreen .video-controls {
		padding: 14px 16px 20px;
	}
}

/* ============================================
   ACCESSIBILITY & TOUCH OPTIMIZATION
   ============================================ */

.video-control-button:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

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

/* Screen reader only text */
.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;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
	/* Larger touch targets for better usability */
	.video-control-button {
		min-width: 36px;
		min-height: 36px;
	}

	.video-control-play-pause {
		min-width: 42px;
		min-height: 42px;
	}

	/* Thicker timeline for easier scrubbing */
	.video-timeline {
		height: 5px;
	}

	.video-timeline-thumb {
		width: 16px;
		height: 16px;
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}

	/* Smaller center play button on touch devices */
	.video-center-play {
		padding: 0.6rem;
		top: 45%;
	}

	.video-center-play svg {
		width: 22px;
		height: 22px;
	}

	/* Remove hover effects on touch */
	.video-control-button:hover::before {
		opacity: 0;
	}

	.video-control-button:hover {
		transform: scale(1);
	}

	/* Active states for touch feedback */
	.video-control-button:active {
		transform: scale(0.92);
		background: rgba(255, 255, 255, 0.15);
	}

	.video-center-play:active {
		transform: translate(-50%, -50%) scale(0.95);
	}
}

