/* <pc-vod-player> — VOD HLS player container, video element, status line. */

.rd-vod-player {
	display: block;
	width: 100%;
	max-width: 960px;
	margin: 0 auto;
}

.rd-vod-player-video {
	display: block;
	width: 100%;
	max-height: 70vh;
	background: #000;
	border-radius: var(--rd-border-radius-sm, 4px);
}

.rd-vod-player-stage {
	position: relative;
	display: block;
}

.rd-vod-player-quality {
	position: absolute;
	top: var(--rd-spacing-x-sm, 8px);
	right: var(--rd-spacing-x-sm, 8px);
	z-index: 2;
	line-height: 1;
}

.rd-vod-player-quality-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border: 0;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font: inherit;
	font-size: var(--rd-fontsize-3);
	cursor: pointer;
}

.rd-vod-player-quality-btn:hover {
	background: rgba(0, 0, 0, 0.8);
}

.rd-vod-player-quality-menu {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	min-width: 120px;
	padding: 4px;
	background: rgba(20, 20, 20, 0.95);
	border-radius: var(--rd-border-radius-sm, 6px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rd-vod-player-quality-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	padding: 6px 10px;
	border: 0;
	border-radius: var(--rd-border-radius-sm, 4px);
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: var(--rd-fontsize-3);
	text-align: left;
	cursor: pointer;
}

.rd-vod-player-quality-item:hover {
	background: rgba(255, 255, 255, 0.12);
}

.rd-vod-player-quality-item.is-active {
	background: var(--rd-primary-active, #d66181);
	color: #fff;
}

.rd-vod-player-quality-hint {
	opacity: 0.7;
	font-size: 0.9em;
}

.rd-vod-player-status {
	margin-top: var(--rd-spacing-x-sm);
	font-size: var(--rd-fontsize-3);
	color: var(--rd-font-dark);
	min-height: 1.2em;
}

.rd-vod-player-error {
	padding: var(--rd-spacing-md);
	color: var(--rd-font-dark);
	background: var(--rd-font-light);
	border-radius: var(--rd-border-radius-sm, 4px);
}

/* Static "no access" panel — shown when issueToken returns HTTP 403.
   Sized like the video area so the layout does not jump. */
.rd-vod-player-forbidden {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--rd-spacing-x-sm, 8px);
	width: 100%;
	min-height: 240px;
	aspect-ratio: 16 / 9;
	padding: var(--rd-spacing-md);
	background: #000;
	color: #fff;
	text-align: center;
	border-radius: var(--rd-border-radius-sm, 4px);
}

.rd-vod-player-forbidden-icon {
	width: 72px;
	height: 72px;
}

.rd-vod-player-forbidden-code {
	font-size: var(--rd-fontsize-5, 28px);
	font-weight: 700;
}

.rd-vod-player-forbidden-text {
	max-width: 32ch;
	font-size: var(--rd-fontsize-3, 20px);
	opacity: 0.85;
}

/* Legacy lesson pages (videos/*.php, appv2/videos.php) host the player in
   #player1.rd-vod-player-host — see PCLib/Vod/VodPlayerHtml.php. The hosts are
   16:9 boxes (.video_block: padding-bottom 56.25% / height 0 / overflow hidden;
   .mc_video: calc(9*100vw/16)), so the player fills the host instead of using the
   standalone 960px / 70vh sizing. Scoped to the host class: 3Q's #player1 is untouched. */
.video_block > .rd-vod-player-host,
.mc_video > .rd-vod-player-host {
	position: absolute;
	inset: 0;
}

.rd-vod-player-host .rd-vod-player {
	max-width: none;
	height: 100%;
}

.rd-vod-player-host .rd-vod-player-stage,
.rd-vod-player-host .rd-vod-player-video {
	height: 100%;
	max-height: none;
}

/* The status line would be clipped by the host's overflow:hidden. */
.rd-vod-player-host .rd-vod-player-status {
	display: none;
}

/* Delivery-error overlay — sits on top of the <video> when the edge rejects the request
   with a readable 4xx (404 no_rendition_ready → "processing", 429 concurrent_streams →
   "too many streams", or a generic reason). The stage is position:relative, so inset:0
   covers exactly the video area. Retryable kinds show the spinner; the generic kind a button. */
.rd-vod-player-processing {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--rd-spacing-md, 16px);
	padding: var(--rd-spacing-md);
	background: rgba(0, 0, 0, 0.85);
	color: #fff;
	text-align: center;
	border-radius: var(--rd-borderradius-border-sm, 4px);
}

.rd-vod-player-processing-spinner {
	width: 48px;
	height: 48px;
	border: 4px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: rd-vod-player-spin 0.8s linear infinite;
}

@keyframes rd-vod-player-spin {
	to {
		transform: rotate(360deg);
	}
}

.rd-vod-player-processing-title {
	font-size: var(--rd-fontsize-5, 28px);
	font-weight: 700;
}

.rd-vod-player-processing-text {
	max-width: 40ch;
	font-size: var(--rd-fontsize-3, 20px);
	opacity: 0.85;
}

.rd-vod-player-processing-retry {
	margin-top: var(--rd-spacing-x-sm, 8px);
	padding: 8px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--rd-primary-active, #d66181);
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.rd-vod-player-processing-retry:hover {
	opacity: 0.9;
}
