/**
 * CE Stream Pro — front-end player styles.
 * Custom properties (--ce-aspect-padding, --ce-border-radius, --ce-accent-color)
 * are set inline per-instance in templates/player-template.php.
 */

.ce-stream-pro-wrapper {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: var(--ce-border-radius, 0);
	background: #000;
}

.ce-stream-pro-wrapper::before {
	content: "";
	display: block;
	padding-top: var(--ce-aspect-padding, 56.25%);
}

.ce-stream-pro-player-inner {
	position: absolute;
	inset: 0;
}

.ce-stream-pro-player-inner[hidden] {
	display: none;
}

.ce-stream-pro-player-inner > .ce-stream-pro-iframe,
.ce-stream-pro-player-inner > .video-js.ce-stream-pro-video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: var(--ce-border-radius, 0);
}

.ce-stream-pro-wrapper .vjs-poster {
	background-size: cover;
}

/* Live badge */
.ce-stream-pro-live-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 20;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 4px;
	background: var(--ce-accent-color, #e63946);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	pointer-events: none;
}

.ce-stream-pro-live-badge::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #fff;
	animation: ce-stream-pro-pulse 1.6s ease-in-out infinite;
}

@keyframes ce-stream-pro-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.35; }
}

/* Offline message overlay (HLS/MP4 only — YouTube/Vimeo handle this themselves) */
.ce-stream-pro-offline-message {
	position: absolute;
	inset: 0;
	z-index: 15;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	font-size: 14px;
	text-align: center;
	padding: 0 20px;
}

.ce-stream-pro-offline-message[hidden] {
	display: none;
}

/* Accent color applied to video.js controls */
.ce-stream-pro-video.video-js .vjs-play-progress,
.ce-stream-pro-video.video-js .vjs-volume-level,
.ce-stream-pro-video.video-js .vjs-big-play-button {
	background-color: var(--ce-accent-color, #e63946);
}

.ce-stream-pro-video.video-js .vjs-control-bar {
	background: rgba(0, 0, 0, 0.6);
}

/* Admin-only misconfiguration notice */
.ce-stream-pro-notice {
	font-size: 13px;
}

/* Countdown overlay (live mode with a scheduled start time) */
.ce-stream-pro-countdown {
	position: absolute;
	inset: 0;
	z-index: 15;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #0a0a0a;
	color: #fff;
	text-align: center;
	padding: 0 20px;
}

.ce-stream-pro-countdown-label {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.7;
}

.ce-stream-pro-countdown-timer {
	font-size: clamp(24px, 6vw, 40px);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

/* Stream-ended overlay */
.ce-stream-pro-ended-screen {
	position: absolute;
	inset: 0;
	z-index: 25;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: rgba(0, 0, 0, 0.9);
	color: #fff;
	text-align: center;
	padding: 0 20px;
}

.ce-stream-pro-ended-screen[hidden] {
	display: none;
}

.ce-stream-pro-ended-text {
	font-size: 15px;
	margin: 0;
}

.ce-stream-pro-replay-link {
	display: inline-block;
	padding: 8px 18px;
	border-radius: 4px;
	background: var(--ce-accent-color, #e63946);
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}

/* Sticky (floating) player: activated by JS toggling this class on scroll */
.ce-stream-pro-wrapper.ce-stream-pro-sticky-active {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: min(320px, 90vw);
	z-index: 99999;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ce-stream-pro-sticky-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 30;
	width: 24px;
	height: 24px;
	line-height: 1;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	display: none;
}

.ce-stream-pro-wrapper.ce-stream-pro-sticky-active .ce-stream-pro-sticky-close {
	display: block;
}

.ce-stream-pro-sticky-close[hidden] {
	display: none;
}

/* data-no-fullscreen on YouTube/Vimeo iframes: CSS can't disable the native
   fullscreen button inside a cross-origin iframe; the allow="fullscreen"
   attribute omission on the iframe (see template) is what actually
   enforces this. This class is kept for potential future styling hooks. */
