/**
 * LSN Video Platform Player Styles
 *
 * Minimal, responsive player styling for iframe embedding
 *
 * @package LSN\Video\Platform
 */

/* ============================================================================
   Reset & Base Styles
   ========================================================================= */

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	width: 100%;
	overflow: hidden;
	background-color: #000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ============================================================================
   Player Wrapper
   ========================================================================= */

.lsn-player-wrapper {
	position: relative;
	width: 100%;
	height: 100%;
	background-color: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ============================================================================
   Video.js Player - YouTube-Style Theme
   ========================================================================= */

/* YouTube red theme color (can be overridden via CSS custom property) */
#lsn-player {
	--vjs-theme-color: #ff0000;
	width: 100%;
	height: 100%;
}

.video-js {
	width: 100% !important;
	height: 100% !important;
	background-color: #000;
	font-size: 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "YouTube Sans", Arial, sans-serif;
}

/* Maintain aspect ratio */
.video-js .vjs-tech {
	object-fit: contain;
}

/* ============================================================================
   Big Play Button - YouTube Style (Round)
   ========================================================================= */
.video-js .vjs-big-play-button {
	font-size: 5em;
	line-height: 1.3em;
	height: 1.3em;
	width: 1.3em;
	border: none;
	border-radius: 50%;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	margin: 0;
	background-color: transparent;
	transition: background-color 0.1s transparent, border-color 0.1s transparent;
	border: 1px solid #fff;
}

.video-js:hover .vjs-big-play-button,
.video-js .vjs-big-play-button:hover,
.video-js .vjs-big-play-button:focus {
	background-color: var(--vjs-theme-color);
	border-color: transparent;
	opacity: 0.75;
}

.video-js .vjs-big-play-button .vjs-icon-placeholder:before {
	position: absolute;
	left: 40%;
	top: 50%;
	transform: translate(-40%, -50%);
}

/* ============================================================================
   Control Bar - YouTube Style
   ========================================================================= */
.video-js .vjs-control-bar {
	background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);
	height: 48px;
	padding: 0 12px;
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center;
	justify-content: flex-start !important;
	transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.video-js.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
	opacity: 0;
	transform: translateY(100%);
	transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.video-js.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-progress-control {
	height: 3px;
	pointer-events: none;
}

/* Control buttons */
.video-js .vjs-control {
	width: 40px;
	height: 40px;
}

.video-js .vjs-button > .vjs-icon-placeholder:before {
	font-size: 1.8em;
	line-height: 1.67;
}

.video-js .vjs-control:hover,
.video-js .vjs-control:focus {
	text-shadow: none;
}

/* ============================================================================
   Control Bar Layout - Left and Right Groups
   ========================================================================= */
/* Custom spacer added via JavaScript */
.video-js .vjs-custom-spacer {
	flex: 1 1 auto !important;
	height: 100%;
	pointer-events: none;
}

/* ============================================================================
   Progress Bar - YouTube Style
   ========================================================================= */
.video-js .vjs-progress-control {
	position: absolute;
	left: 0;
	right: 0;
	width: 100%;
	height: 3px;
	top: -3px;
	transition: height 0.2s ease;
}

.video-js .vjs-progress-control:hover {
	height: 3px;
	top: -3px;
}

.video-js .vjs-progress-control .vjs-progress-holder {
	height: 100%;
	margin: 0;
	position: absolute;
	left: 0;
	right: 0;
}

/* Progress bar background */
.video-js .vjs-slider {
	background-color: rgba(255, 255, 255, 0.3);
	border-radius: 0;
}

/* Loaded progress */
.video-js .vjs-load-progress {
	background-color: rgba(255, 255, 255, 0.4);
}

.video-js .vjs-load-progress div {
	background-color: rgba(255, 255, 255, 0.4);
}

/* Play progress */
.video-js .vjs-play-progress {
	background-color: var(--vjs-theme-color);
	border-radius: 0;
}

/* Scrubber handle */
.video-js .vjs-play-progress:before {
	display: none;
}

.video-js .vjs-slider:hover .vjs-play-progress:before,
.video-js .vjs-progress-control:hover .vjs-play-progress:before {
	display: block;
	font-size: 1em;
	position: absolute;
	right: -0.5em;
	top: -0.35em;
	height: 1em;
	width: 1em;
	background-color: var(--vjs-theme-color);
	border-radius: 50%;
	box-shadow: 0 0 1em rgba(0, 0, 0, 0.5);
	content: '';
	border: 2px solid #fff;
}

/* Time tooltip */
.video-js .vjs-time-tooltip,
.video-js .vjs-mouse-display .vjs-time-tooltip {
	background-color: rgba(28, 28, 28, 0.95);
	border-radius: 2px;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 11px;
	padding: 4px 6px;
	pointer-events: none;
	position: absolute;
	top: -32px;
	visibility: hidden;
	z-index: 1;
}

.video-js .vjs-progress-control:hover .vjs-time-tooltip,
.video-js .vjs-progress-control:hover .vjs-mouse-display .vjs-time-tooltip {
	visibility: visible;
}

/* ============================================================================
   Volume Control - YouTube Style
   ========================================================================= */
.video-js .vjs-volume-panel {
	width: 40px;
	transition: width 0.2s ease;
}

.video-js .vjs-volume-panel:hover,
.video-js .vjs-volume-panel:focus,
.video-js .vjs-volume-panel.vjs-hover {
	width: 120px;
}

.video-js .vjs-volume-panel .vjs-volume-control {
	opacity: 0;
	width: 0;
	transition: opacity 0.2s ease, width 0.2s ease;
}

.video-js .vjs-volume-panel:hover .vjs-volume-control,
.video-js .vjs-volume-panel:focus .vjs-volume-control,
.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control {
	opacity: 1;
	width: 80px;
	position: relative;
	left: 0;
}

.video-js .vjs-volume-bar {
	background-color: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
	margin: 1.4em 0.45em;
}

.video-js .vjs-volume-level {
	background-color: #fff;
	border-radius: 2px;
}

.video-js .vjs-volume-level:before {
	display: none;
}

/* ============================================================================
   Time Display - YouTube Style
   ========================================================================= */
.video-js .vjs-current-time,
.video-js .vjs-duration,
.video-js .vjs-time-divider {
	display: block;
	padding: 0;
	line-height: 40px;
	min-width: auto;
}

.video-js .vjs-current-time {
	padding-left: 8px;
}

.video-js .vjs-time-divider {
	padding: 0 3px;
	min-width: 0;
}

.video-js .vjs-duration {
	padding-right: 8px;
}

.video-js .vjs-time-control {
	font-size: 12px;
	line-height: 40px;
	font-weight: 500;
	color: #fff;
}

/* ============================================================================
   Settings/Quality Menu - YouTube Style
   ========================================================================= */
.video-js .vjs-menu-button-popup .vjs-menu {
	left: auto;
	right: 0;
}

.vjs-menu-button-popup .vjs-menu {
    width: 5em;
}

.video-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content {
	background-color: rgba(28, 28, 28, 0.95);
	backdrop-filter: blur(10px);
	border-radius: 2px;
	max-height: 24em;
	overflow: auto;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
	width: 6em;
}
.video-js .vjs-subs-caps-button .vjs-menu .vjs-menu-content {
	width: 9em;
}

.video-js .vjs-menu li {
	padding: 0.6em 0em;
	font-size: 13px;
	line-height: 1.4;
	text-transform: none;
	color: #fff;
	transition: background-color 0.1s ease;
}

.video-js .vjs-menu li.vjs-selected {
	background-color: rgba(255, 255, 255, 0.1);
	color: var(--vjs-theme-color);
}

.video-js .vjs-menu li.vjs-selected:before {
	content: '✓';
	position: absolute;
	left: 0.7em;
	font-size: 1.2em;
}

.video-js .vjs-menu li:focus,
.video-js .vjs-menu li:hover {
	background-color: rgba(255, 255, 255, 0.15);
}

.video-js .vjs-menu li.vjs-menu-title {
	text-align: left;
	text-transform: none;
	line-height: 2.4em;
	font-size: 1em;
	padding: 0 1em;
	font-weight: 600;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   Playback Rate Menu
   ========================================================================= */
.video-js .vjs-playback-rate .vjs-playback-rate-value {
	font-size: 1.2em;
	line-height: 2.4;
	padding: 0;
}

/* ============================================================================
   Picture-in-Picture & Fullscreen
   ========================================================================= */
/* Specific styling can go here if needed */

/* ============================================================================
   Loading Spinner - YouTube Style
   ========================================================================= */
.vjs-loading-spinner {
	border-color: rgba(255, 255, 255, 0.3);
	border-top-color: var(--vjs-theme-color);
	animation: vjs-spinner-spin 1s linear infinite;
}

@keyframes vjs-spinner-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* ============================================================================
   Captions/Subtitles - YouTube Style
   ========================================================================= */
.video-js .vjs-text-track-display {
	bottom: 60px;
}

.video-js .vjs-text-track-cue > div {
	background-color: rgba(0, 0, 0, 0.9) !important;
	padding: 0.3em 0.5em !important;
	border-radius: 2px;
	font-size: 1.4em !important;
	line-height: 1.4 !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* ============================================================================
   Hover States & Transitions
   ========================================================================= */
.video-js .vjs-control:not(.vjs-disabled):hover .vjs-icon-placeholder:before {
	text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.video-js button {
	transition: transform 0.1s ease;
}

/* ============================================================================
   Error Page Styles
   ========================================================================= */

.lsn-player-error {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background-color: #000;
	color: #fff;
	text-align: center;
	padding: 2rem;
}

.lsn-error-content {
	max-width: 600px;
}

.lsn-error-content .logo img {
	margin-bottom: 1rem;
	height: auto;
	width: 100%;
	max-width: 200px;
}

.lsn-error-content h1 {
	font-size: 2rem;
	font-weight: 600;
	margin-bottom: 1rem;
	color: #fff;
}

.lsn-error-content p {
	font-size: 1.125rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.8);
	margin: 0;
}

/* ============================================================================
   Mobile Optimizations - YouTube Style
   ========================================================================= */

/* Small mobile */
@media (max-width: 480px) {
	.video-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content {
		bottom: 1em;
	}
	
	.video-js .vjs-big-play-button {
		font-size: 3.5em;
	}

	.video-js .vjs-control-bar {
		font-size: 14px;
		height: 40px;
		padding: 0 8px;
	}

	.video-js .vjs-progress-control {
		height: 3px;
		top: -3px;
	}

	/* Hide some controls on very small screens */
	.video-js .vjs-picture-in-picture-control {
		display: none;
	}

	.video-js .vjs-time-control {
		font-size: 10px;
		padding: 0 4px;
	}
}

/* ============================================================================
   Accessibility - YouTube Style
   ========================================================================= */

.video-js .vjs-control:focus {
	outline: 2px solid var(--vjs-theme-color);
	outline-offset: 2px;
}

.video-js .vjs-control:focus:before {
	content: '';
	position: absolute;
	top: -2px;
	right: -2px;
	bottom: -2px;
	left: -2px;
	border-radius: 2px;
	border: 2px solid var(--vjs-theme-color);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.video-js .vjs-control-bar {
		background: linear-gradient(to top, #000 0%, #000 50%, rgba(0, 0, 0, 0) 100%);
	}

	.video-js .vjs-big-play-button {
		border: 3px solid #fff;
	}

	.video-js .vjs-slider {
		background-color: rgba(255, 255, 255, 0.5);
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.video-js .vjs-control-bar {
		transition: none !important;
	}

	.video-js .vjs-progress-control {
		transition: none !important;
	}
}

/* ============================================================================
   Quality Selector - YouTube Style
   ========================================================================= */

/* Quality selector button */
.video-js .vjs-quality-selector {
	cursor: pointer;
}

.video-js .vjs-quality-selector .vjs-icon-placeholder::before {
	content: 'HD';
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "YouTube Sans", Arial, sans-serif;
	font-size: 1em;
	font-weight: 700;
	line-height: 2.5;
	letter-spacing: 0.5px;
}

/* Quality selector menu */
.video-js .vjs-quality-selector .vjs-menu {
	left: auto;
	right: 0;
	bottom: 100%;
	margin-bottom: 4px;
}

.video-js .vjs-quality-selector .vjs-menu .vjs-menu-content {
	background-color: rgba(28, 28, 28, 0.95);
	backdrop-filter: blur(10px);
	border-radius: 2px;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
	padding: 4px 0;
}

.video-js .vjs-quality-selector .vjs-menu-item {
	text-transform: none;
	font-size: 13px;
	padding: 0.6em 2.4em 0.6em 1em;
	color: #fff;
	transition: background-color 0.1s ease;
	position: relative;
}

.video-js .vjs-quality-selector .vjs-menu-item.vjs-selected {
	background-color: rgba(255, 255, 255, 0.1);
	color: var(--vjs-theme-color);
	font-weight: 500;
}

.video-js .vjs-quality-selector .vjs-menu-item.vjs-selected:before {
	content: '✓';
	position: absolute;
	left: 0.7em;
	font-size: 1.2em;
}

.video-js .vjs-quality-selector .vjs-menu-item:hover,
.video-js .vjs-quality-selector .vjs-menu-item:focus {
	background-color: rgba(255, 255, 255, 0.15);
}

/* ============================================================================
   Print Styles (hide player when printing)
   ========================================================================= */

@media print {
	.lsn-player-wrapper,
	.lsn-player-error {
		display: none;
	}
}
