/* The theme's player page (template-parts/player-page.php), inside an iframe. */
html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	background: #000;
	overflow: hidden;
	font-family: Arial, sans-serif;
}

body {
	display: flex;
	justify-content: center;
	align-items: center;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

/* The largest 16:9 box that fits, centred. */
#video-container {
	position: relative;
	width: min(100vw, calc(100vh * 16 / 9));
	height: min(100vh, calc(100vw * 9 / 16));
	background: #000;
	overflow: hidden;
}

#video-container .fluid_video_wrapper {
	width: 100% !important;
	height: 100% !important;
	background: #000;
}

#video-container video {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center center;
	background: #000;
}

/* Play button in the middle */
#custom-play-button {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 80px;
	height: 80px;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.7);
	border-radius: 50%;
	cursor: pointer;
	z-index: 50;
	display: none;
	align-items: center;
	justify-content: center;
	transition: background 0.3s ease, transform 0.3s ease;
}

#custom-play-button.show {
	display: flex;
}

#custom-play-button:hover {
	background: var(--vp-accent, #e50914);
	transform: translate(-50%, -50%) scale(1.1);
}

#custom-play-button svg {
	width: 40px;
	height: 40px;
	fill: #fff;
	pointer-events: none;
}

@media (max-width: 480px) {
	#custom-play-button {
		width: 64px;
		height: 64px;
	}

	#custom-play-button svg {
		width: 32px;
		height: 32px;
	}
}

/* ---- Pre-roll ad ---- */
/* The ad's click layer covers the whole video at every size. */
#video-container .vast_clickthrough_layer {
	width: 100% !important;
	height: 100% !important;
}

/* Fluid Player's "Ad - 00:05" sits on the full screen button; the time shows on the skip button. */
#video-container .ad_countdown {
	display: none !important;
}

/* Pill "Skip ad" bottom right, ad card bottom left */
#video-container .skip_button {
	right: 16px;
	bottom: 84px;
	padding: 0 12px 0 16px;
	height: 36px;
	display: flex;
	align-items: center;
	background: rgba(0, 0, 0, 0.6);
	border: 0;
	border-radius: 999px;
	font-family: Roboto, "Segoe UI", Arial, sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	transition: background 0.2s ease;
}

#video-container .skip_button,
#video-container .skip_button a {
	color: #fff;
	text-decoration: none;
}

#video-container .skip_button a {
	display: flex;
	align-items: center;
	gap: 4px;
}

#video-container .skip_button.skip_button_disabled {
	color: rgba(255, 255, 255, 0.8);
	cursor: default;
	padding-right: 16px;
}

#video-container .skip_button:not(.skip_button_disabled):hover {
	background: rgba(0, 0, 0, 0.8);
}

/* Fluid's own skip icon does not line up in the pill: a centred one instead. */
#video-container .skip_button .skip_button_icon {
	display: none;
}

#video-container .skip_button:not(.skip_button_disabled) a::after {
	content: "";
	flex: none;
	width: 24px;
	height: 24px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M5 4.5v15l11-7.500zM18 4.500h2v15h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.vp-ad-card {
	position: absolute;
	left: 16px;
	bottom: 60px;
	z-index: 40;
	display: none;
	flex-direction: column;
	gap: 8px;
	max-width: calc(100% - 220px);
	color: #fff;
	text-decoration: none;
	font-family: Roboto, "Segoe UI", Arial, sans-serif;
}

.vp-ad-playing .vp-ad-card {
	display: flex;
}

.vp-ad-card-box {
	display: flex;
	align-items: center;
	gap: 12px;
	align-self: flex-start;
	max-width: 100%;
	padding: 8px 10px 8px 12px;
	background: rgba(28, 28, 28, 0.82);
	border-radius: 8px;
	box-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.vp-ad-card-logo {
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--vp-accent, #e50914);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 700;
}

.vp-ad-card-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.vp-ad-card-brand,
.vp-ad-card-host,
.vp-ad-card-meta-host {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vp-ad-card-brand {
	font-size: 14px;
	font-weight: 700;
}

.vp-ad-card-host {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.75);
}

.vp-ad-card-btn {
	flex: none;
	margin-left: 6px;
	padding: 0 16px;
	height: 36px;
	display: flex;
	align-items: center;
	background: #fff;
	color: #0f0f0f;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: background 0.2s ease;
}

.vp-ad-card:hover .vp-ad-card-btn {
	background: #e5e5e5;
}

.vp-ad-card-meta {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 100%;
	padding-left: 2px;
	font-size: 12px;
	font-weight: 700;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.vp-ad-card-sponsored {
	flex: none;
}

@media (max-width: 480px) {
	#video-container .skip_button {
		right: 8px;
		bottom: 74px;
		height: 32px;
		padding: 0 10px 0 14px;
		font-size: 13px;
	}

	.vp-ad-card {
		left: 8px;
		bottom: 54px;
		gap: 5px;
		max-width: calc(100% - 160px);
	}

	.vp-ad-card-box {
		gap: 8px;
		padding: 5px 10px 5px 6px;
	}

	.vp-ad-card-logo {
		width: 26px;
		height: 26px;
		font-size: 13px;
	}

	.vp-ad-card-brand {
		font-size: 12px;
	}

	.vp-ad-card-host,
	.vp-ad-card-meta {
		font-size: 11px;
	}

	.vp-ad-card-btn,
	.vp-ad-card-meta-host {
		display: none;
	}
}

/* ---- Short mode (short=1): the video fills the frame, no controls ---- */
.vp-short #video-container {
	width: 100%;
	height: 100%;
}

.vp-short #video-container video {
	object-fit: cover;
}

.vp-short #custom-play-button,
.vp-short .fluid_controls_container,
.vp-short .fluid_initial_play,
.vp-short .fluid_context_menu {
	display: none !important;
}

/* Without a control bar the ad's parts sit at the bottom edge. */
.vp-short #video-container .skip_button {
	right: 10px;
	bottom: 14px;
	height: 32px;
	padding: 0 10px 0 14px;
	font-size: 13px;
}

.vp-short .vp-ad-card {
	left: 10px;
	bottom: 12px;
	gap: 5px;
	max-width: calc(100% - 160px);
}

.vp-short .vp-ad-card-box {
	gap: 8px;
	padding: 5px 10px 5px 6px;
}

.vp-short .vp-ad-card-logo {
	width: 26px;
	height: 26px;
	font-size: 13px;
}

.vp-short .vp-ad-card-brand {
	font-size: 12px;
}

.vp-short .vp-ad-card-host,
.vp-short .vp-ad-card-meta {
	font-size: 11px;
}

.vp-short .vp-ad-card-btn,
.vp-short .vp-ad-card-meta-host {
	display: none;
}

/* ---- From the ad to the video: spinner ---- */
.vp-switching .fluid_controls_container,
.vp-switching .fluid_initial_play_button_container {
	visibility: hidden !important;
}

.vp-spinner {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 45;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border: 3px solid rgba(255, 255, 255, 0.22);
	border-top-color: #fff;
	border-radius: 50%;
	animation: vp-spin 0.8s linear infinite;
	pointer-events: none;
}

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

.vp-switching .vp-spinner {
	display: block;
}

/* ---- The file does not play: a note on the poster ---- */
.vp-failed {
	position: absolute;
	inset: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: #000 center / cover no-repeat;
}

.vp-failed::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
}

.vp-failed span {
	position: relative;
	padding: 10px 16px;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font: 600 15px/1.4 Roboto, "Segoe UI", Arial, sans-serif;
	text-align: center;
}

/* ---- Short mode, iPhone: the video's own full screen (bottom right) ---- */
.vp-fs-button {
	position: absolute;
	right: 10px;
	bottom: 14px;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.vp-fs-button svg {
	width: 24px;
	height: 24px;
	fill: #fff;
}

/* The skip button takes that corner during the ad. */
.vp-ad-playing .vp-fs-button,
.vp-switching .vp-fs-button {
	display: none;
}
