/* ============================================================
   Player Adsventure - Frontend Player Styles
   ============================================================ */

.pav-player-wrapper {
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

.pav-player-container {
	position: relative;
	background: #000;
	overflow: hidden;
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
	/* Responsive 16:9 by default — overridden inline when a custom ratio is set */
	aspect-ratio: 16 / 9;
	/* Fallback for browsers without aspect-ratio support */
	width: 100%;
}

/* Fallback padding-bottom trick for very old browsers */
@supports not (aspect-ratio: 1) {
	.pav-player-container::before {
		content: '';
		display: block;
		padding-top: 56.25%; /* 9/16 */
	}
}

/* Video element fills the container */
.pav-video-element {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
	cursor: pointer;
	outline: none;
	display: block;
}

/* Ad container sits on top of the video */
.pav-ad-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 10;
}

/* IMA requires pointer-events enabled on the ad container when ads play */
.pav-ad-container iframe,
.pav-ad-container .ima-controls-div,
.pav-ad-container .ima-countdown-div {
	pointer-events: auto;
}

/* Play overlay */
.pav-play-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
	cursor: pointer;
	transition: opacity .2s;
}

.pav-play-overlay:hover .pav-play-btn svg circle {
	fill: rgba(0, 0, 0, .75);
}

.pav-play-btn {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	line-height: 0;
	box-shadow: none;
	outline: none;
}

.pav-play-btn:hover,
.pav-play-btn:focus,
.pav-play-btn:active {
	background: none;
	box-shadow: none;
	outline: none;
}

.pav-play-btn svg {
	width: 72px;
	height: 72px;
	filter: drop-shadow( 0 2px 8px rgba(0,0,0,.5) );
	transition: transform .15s;
}

.pav-play-btn:hover svg {
	transform: scale(1.1);
}

/* ── Controls bar ──────────────────────────────────────────── */
.pav-controls {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: linear-gradient(transparent, rgba(0,0,0,.75));
	z-index: 6;
	opacity: 0;
	transition: opacity .25s;
	box-sizing: border-box;
}

.pav-player-container:hover .pav-controls,
.pav-player-container.pav-paused .pav-controls {
	opacity: 1;
}

/* hide controls completely while ad is playing */
.pav-player-container.pav-ad-playing .pav-controls {
	display: none;
}

.pav-ctrl-btn {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	line-height: 0;
	flex-shrink: 0;
	color: #fff;
	box-shadow: none;
	outline: none;
	text-decoration: none;
}

.pav-ctrl-btn:hover,
.pav-ctrl-btn:focus,
.pav-ctrl-btn:active {
	background: none;
	color: #fff;
	box-shadow: none;
	outline: none;
	opacity: .8;
}

.pav-ctrl-btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: #fff;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	display: block;
}

.pav-ctrl-play svg {
	width: 20px;
	height: 20px;
}

.pav-icon-play {
	fill: #fff;
	stroke: none !important;
}

.pav-icon-pause rect {
	fill: #fff;
	stroke: none !important;
}

.pav-icon-mute line {
	stroke: #fff;
	fill: none;
}

/* Progress bar */
.pav-progress-wrap {
	flex: 1;
	padding: 8px 0;
	cursor: pointer;
	position: relative;
}

.pav-progress-track {
	height: 4px;
	background: rgba(255,255,255,.3);
	border-radius: 4px;
	position: relative;
}

.pav-progress-fill {
	height: 100%;
	width: 0;
	background: #fff;
	border-radius: 4px;
	pointer-events: none;
	transition: width .1s linear;
}

.pav-progress-thumb {
	position: absolute;
	top: 50%;
	left: 0;
	width: 12px;
	height: 12px;
	background: #fff;
	border-radius: 50%;
	transform: translate(-50%, -50%) scale(0);
	transition: transform .15s;
	pointer-events: none;
}

.pav-progress-wrap:hover .pav-progress-thumb {
	transform: translate(-50%, -50%) scale(1);
}

.pav-progress-wrap:hover .pav-progress-track {
	height: 6px;
}

/* Time labels */
.pav-time-current,
.pav-time-total {
	font-size: 11px;
	color: #fff;
	white-space: nowrap;
	font-family: monospace;
	flex-shrink: 0;
}

/* Touch devices: always show controls, larger hit targets */
@media (hover: none) {
	.pav-controls {
		opacity: 1;
		padding: 4px 8px;
	}
	.pav-progress-wrap {
		touch-action: none;
		padding: 12px 0;
	}
	.pav-progress-thumb {
		transform: translate(-50%, -50%) scale(1);
		width: 14px;
		height: 14px;
	}
	.pav-progress-track {
		height: 5px;
	}
}

/* Small screens: compact controls */
@media (max-width: 480px) {
	.pav-controls {
		gap: 4px;
		padding: 4px 8px;
	}
	.pav-ctrl-btn svg {
		width: 15px;
		height: 15px;
	}
	.pav-ctrl-play svg {
		width: 17px;
		height: 17px;
	}
	.pav-time-current,
	.pav-time-total {
		font-size: 10px;
	}
	.pav-play-btn svg {
		width: 54px;
		height: 54px;
	}
}

.pav-player-wrapper-vertical {
	margin-inline: auto;
	max-width: min(420px, 100%, calc(85dvh * 9 / 16));
}

.pav-player-container.pav-player-vertical {
	aspect-ratio: 9 / 16;
	border-radius: 16px;
}

.pav-video-vertical {
	object-fit: cover;
	object-position: center;
}

.pav-error {
	color: #c00;
	padding: 10px;
	border: 1px solid #c00;
	border-radius: 4px;
}

/* Mini player flutuante ao rolar a página */
.pav-player-placeholder {
	display: none;
	width: 100%;
	pointer-events: none;
}

body > .pav-player-wrapper.pav-mini-player,
.pav-player-wrapper.pav-mini-player {
	position: fixed !important;
	bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
	right: max(12px, env(safe-area-inset-right, 12px)) !important;
	top: auto !important;
	left: auto !important;
	inset: auto !important;
	z-index: 2147483646 !important;
	margin: 0 !important;
	width: min(220px, 40vw) !important;
	max-width: none !important;
	height: auto !important;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
	border-radius: 10px;
	overflow: visible !important;
	cursor: pointer;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

body > .pav-player-wrapper-vertical.pav-mini-player,
.pav-player-wrapper-vertical.pav-mini-player {
	width: min(130px, 34vw) !important;
}

.pav-mini-player .pav-player-container {
	border-radius: 10px;
	width: 100% !important;
	position: relative !important;
	overflow: hidden !important;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	background: #000 !important;
}

.pav-mini-player .pav-player-container::before {
	display: none !important;
	content: none !important;
	padding: 0 !important;
}

.pav-mini-player .pav-video-element {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	object-fit: cover !important;
}

.pav-mini-player .pav-ad-container {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

.pav-mini-player .pav-controls {
	padding: 4px 6px;
	gap: 2px;
}

.pav-mini-player .pav-progress-wrap,
.pav-mini-player .pav-time-current,
.pav-mini-player .pav-time-total,
.pav-mini-player .pav-ctrl-pip,
.pav-mini-player .pav-ctrl-fullscreen {
	display: none;
}

.pav-mini-player .pav-ctrl-btn svg {
	width: 18px;
	height: 18px;
}

.pav-mini-close {
	display: none;
	position: absolute;
	top: 4px;
	right: 4px;
	z-index: 45;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
}

.pav-mini-player .pav-mini-close {
	display: flex;
}
