/**
 * Public CSS for Genius Video Plugin
 */

/* ========================================
   Floating Video Module
   ======================================== */

.genius-floating-video {
	position: fixed;
	bottom: 20px;
	width: 350px;
	height: auto;
	max-width: calc(100vw - 40px);
	z-index: 9999;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	border-radius: 8px;
	overflow: hidden;
	background: #000;
	transition: all 0.3s ease;
	cursor: pointer;
}

/* Position variants */
.genius-floating-video.position-right {
	right: 20px;
}

.genius-floating-video.position-left {
	left: 20px;
}

/* Minimized state */
.genius-floating-video.minimized {
	width: 150px;
	opacity: 0.9;
}

/* Landscape video in minimized mode - wider */
.genius-floating-video.minimized.video-landscape {
	width: 250px;
}

.genius-floating-video.minimized:hover {
	opacity: 1;
	transform: scale(1.05);
}

/* Expanded state */
.genius-floating-video.expanded {
	width: 450px;
	cursor: default;
}

/* Landscape video in expanded mode - much wider */
.genius-floating-video.expanded.video-landscape {
	width: 700px;
}

.genius-floating-video.hidden {
	transform: translateY(150%);
	opacity: 0;
	pointer-events: none;
}

.genius-floating-video-container {
	position: relative;
	background: #000;
	aspect-ratio: auto; /* Let video determine its own ratio */
}

.genius-floating-video-container video,
.genius-floating-video-container .genius-slideshow-player {
	width: 100%;
	height: auto;
	object-fit: contain; /* Show full video without cropping */
	display: block;
}

.genius-floating-video-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	transition: all 0.2s ease;
	opacity: 1;
	pointer-events: auto;
}

/* Smaller close button in minimized mode */
.genius-floating-video.minimized .genius-floating-video-close {
	width: 20px;
	height: 20px;
	font-size: 16px;
	top: 5px;
	right: 5px;
}

/* Show close button in both minimized and expanded states */
.genius-floating-video.minimized .genius-floating-video-close,
.genius-floating-video.expanded .genius-floating-video-close {
	opacity: 1;
	pointer-events: auto;
}

.genius-floating-video-close:hover {
	background: rgba(0, 0, 0, 0.9);
}

/* Slideshow Player */
.genius-slideshow-player {
	position: relative;
	background: #000;
	min-height: 400px;
}

.genius-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0;
	transition: opacity 0.5s ease;
	z-index: 0;
}

.genius-slide.active {
	opacity: 1;
	z-index: 1;
}

.genius-slideshow-play {
	position: absolute;
	bottom: 15px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 20px;
	transition: background 0.2s ease;
}

.genius-slideshow-play:hover {
	background: rgba(0, 0, 0, 0.9);
}

/* Navigation arrows */
.genius-slideshow-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	border-radius: 4px;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 36px;
	line-height: 1;
	transition: background 0.2s ease;
}

.genius-slideshow-nav:hover {
	background: rgba(0, 0, 0, 0.8);
}

.genius-slideshow-prev {
	left: 15px;
}

.genius-slideshow-next {
	right: 15px;
}

/* Hide navigation arrows on mobile */
@media (max-width: 768px) {
	.genius-slideshow-nav {
		display: none !important;
	}
}

/* Progress bar */
.genius-slideshow-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, 0.3);
	z-index: 10;
}

.genius-slideshow-progress-bar {
	height: 100%;
	width: 0%;
	background: #fff;
	transition: width 0.05s linear;
}

/* ========================================
   Circle Video Module
   ======================================== */

.genius-circle-video-module {
	padding-top: 20px;
	width: 100%;
	clear: both;
}

.genius-circle-video-list {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	justify-content: flex-start;
}

.genius-circle-video-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.genius-circle-video-button {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	transition: transform 0.2s ease;
}

.genius-circle-video-button:hover {
	transform: scale(1.05);
}

.genius-circle-video-thumb {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	position: relative;
	overflow: hidden;
	border: 3px solid #ddd;
	transition: border-color 0.2s ease;
}

.genius-circle-video-button:hover .genius-circle-video-thumb {
	border-color: #ddd;
}

.genius-circle-video-thumb.loading {
	position: relative;
	animation: borderPulse 1.2s ease-in-out infinite;
}

.genius-circle-video-thumb.loading::after {
	content: '';
	position: absolute;
	top: -6px;
	left: -6px;
	right: -6px;
	bottom: -6px;
	border-radius: 50%;
	border: 3px solid transparent;
	border-top-color: currentColor;
	border-right-color: currentColor;
	animation: borderSpin 1s linear infinite;
	pointer-events: none;
}

@keyframes borderPulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.6;
	}
}

@keyframes borderSpin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.genius-circle-video-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 30px;
	height: 30px;
	background: rgba(0, 0, 0, 0.7);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	transition: background 0.2s ease;
}

.genius-circle-video-button:hover .genius-circle-video-play-icon {
	background: rgba(0, 0, 0, 0.9);
}

.genius-circle-video-play-icon svg {
	width: 16px;
	height: 16px;
	margin-left: 2px;
}

.genius-circle-video-label {
	font-size: 14px;
	text-align: center;
	max-width: 80px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

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

.genius-video-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999999;
	display: none;
	align-items: center;
	justify-content: center;
}

.genius-video-modal.active {
	display: flex;
	animation: fadeIn 0.3s ease;
}

.genius-video-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.9);
}

.genius-video-modal-content {
	position: relative;
	z-index: 1;
	width: 90vw;
	max-width: 1200px;
	max-height: 90vh;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	animation: slideUp 0.3s ease;
}

.genius-video-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	transition: all 0.2s ease;
}

.genius-video-modal-close span, .genius-floating-video-close span {
	margin-top: -3px;
}

.genius-video-modal-close:hover {
	background: rgba(0, 0, 0, 0.9);
}

.genius-video-modal-body {
	position: relative;
	background: #000;
}

.genius-video-modal-body video,
.genius-video-modal-body .genius-slideshow-player {
	width: 100%;
	height: auto;
	max-height: 90vh;
	display: block;
}

.genius-video-modal-body .genius-slideshow-player {
	background: #000;
	position: relative;
	width: 100%;
	height: 70vh;
	min-height: 400px;
	max-height: 90vh;
}

.genius-video-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	background: #000;
}

.genius-video-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid rgba(255, 255, 255, 0.2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

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

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

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

@media screen and (max-width: 768px) {
	.genius-floating-video {
		width: 280px;
		bottom: 10px;
		right: 10px;
	}

	.genius-floating-video.minimized {
		width: 120px;
	}

	.genius-floating-video.expanded {
		width: 320px;
	}

	.genius-circle-video-list {
		gap: 15px;
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.genius-circle-video-list::-webkit-scrollbar {
		display: none;
	}

	.genius-circle-video-item {
		flex-shrink: 0;
	}

	.genius-circle-video-thumb {
		width: 70px;
		height: 70px;
	}

	.genius-circle-video-label {
		font-size: 13px;
		max-width: 70px;
	}

	.genius-video-modal-content {
		width: 95vw;
	}

	.genius-video-modal-close {
		top: 10px;
		right: 10px;
	}
}

/* ========================================
   Video.js Customization
   ======================================== */

/* Ensure video respects its aspect ratio */
.genius-video-player video {
	object-fit: contain !important;
}

.genius-video-player .vjs-tech {
	object-fit: contain !important;
}

.genius-video-player .vjs-big-play-button {
	border-radius: 50%;
	width: 80px;
	height: 80px;
	line-height: 80px;
	border-width: 3px;
}

.genius-video-player.vjs-has-started .vjs-big-play-button {
	display: none;
}

/* Lazy loading placeholder */
.genius-video-loading {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
}

.genius-video-loading::after {
	content: '';
	width: 40px;
	height: 40px;
	border: 4px solid rgba(255, 255, 255, 0.2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}
