/* ==========================================================================
   QK Video Player – v1.2.0
   ========================================================================== */

.qkv-wrap {
	width: 100%;
}

.qkv-player {
	position: relative;
	width: 100%;
	max-width: 100%;
	outline: none;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}

.qkv-player:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.qkv-stage {
	position: relative;
	width: 100%;
	padding-top: var(--qkv-ratio, 56.25%);
	overflow: hidden;
	background-color: #000;
	isolation: isolate;
}

/* ---------- ویدیو ---------- */
.qkv-video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	background-color: transparent;
	opacity: 0;
	transition: opacity .35s ease;
}

.qkv-player.qkv-started .qkv-video {
	opacity: 1;
}

/* ---------- پوستر و پوشش ---------- */
.qkv-poster {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: 2;
	transition: opacity .4s ease, visibility .4s ease;
}

.qkv-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .8s cubic-bezier(.2, .7, .3, 1);
}

.qkv-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 3;
	pointer-events: none;
	transition: opacity .4s ease, visibility .4s ease;
}

.qkv-player.qkv-started .qkv-poster,
.qkv-player.qkv-started .qkv-overlay {
	opacity: 0;
	visibility: hidden;
}

/* ---------- عنوان ---------- */
.qkv-title {
	position: absolute;
	top: 14px;
	inset-inline-start: 14px;
	max-width: calc(100% - 28px);
	z-index: 6;
	color: #fff;
	font-size: 15px;
	line-height: 1.7;
	backdrop-filter: blur(4px);
	transition: opacity .35s ease, transform .35s ease;
}

.qkv-player.qkv-title-hide.qkv-playing .qkv-title {
	opacity: 0;
	transform: translateY(-8px);
}

/* ---------- دکمه پخش وسط ---------- */
.qkv-bigplay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 7;
	width: 84px;
	height: 84px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	border: 0;
	cursor: pointer;
	background-color: rgba(0, 0, 0, .55);
	border-radius: 50%;
	transition: background-color .3s ease, transform .3s ease, opacity .3s ease, visibility .3s ease;
	box-shadow: none;
}

.qkv-bigplay svg {
	width: 32px;
	height: 32px;
	fill: #fff;
	margin-inline-start: 4px;
	position: relative;
	z-index: 2;
	transition: fill .3s ease;
}

.qkv-bigplay::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: 0 0 0 0 rgba(255, 255, 255, .35);
	pointer-events: none;
}

.qkv-player.qkv-pulse .qkv-bigplay::before {
	animation: qkv-pulse 2.4s infinite;
}

@keyframes qkv-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .35); }
	70%  { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.qkv-player:hover .qkv-bigplay {
	transform: translate(-50%, -50%) scale(1.06);
}

.qkv-player.qkv-started .qkv-bigplay {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* ---------- لودینگ ---------- */
.qkv-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 42px;
	height: 42px;
	margin: -21px 0 0 -21px;
	z-index: 8;
	border: 3px solid rgba(255, 255, 255, .2);
	border-top-color: #fff;
	border-right-color: #fff;
	border-radius: 50%;
	opacity: 0;
	visibility: hidden;
	animation: qkv-spin .8s linear infinite;
}

.qkv-player.qkv-loading .qkv-spinner {
	opacity: 1;
	visibility: visible;
}

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

/* ---------- خطا ---------- */
.qkv-error {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 9;
	display: none;
	padding: 10px 18px;
	border-radius: 10px;
	background-color: rgba(0, 0, 0, .75);
	color: #fff;
	font-size: 14px;
	text-align: center;
	direction: rtl;
}

.qkv-player.qkv-has-error .qkv-error {
	display: block;
}

/* ---------- نوار کنترل ---------- */
.qkv-controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10;
	direction: ltr;
	padding: 26px 12px 10px;
	background-color: transparent;
	opacity: 1;
	transform: translateY(0);
	transition: opacity .3s ease, transform .3s ease;
}

.qkv-controls::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 0;
	display: none;
	background-image: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .35) 55%, rgba(0, 0, 0, 0) 100%);
	pointer-events: none;
}

.qkv-player.qkv-bargrad .qkv-controls::before {
	display: block;
}

.qkv-controls > * {
	position: relative;
	z-index: 1;
}

.qkv-player.qkv-hide-controls .qkv-controls {
	opacity: 0;
	transform: translateY(100%);
	pointer-events: none;
}

.qkv-bar {
	display: flex;
	align-items: center;
	gap: 6px;
}

.qkv-player.qkv-dir-rtl .qkv-bar {
	flex-direction: row-reverse;
}

.qkv-spacer {
	flex: 1 1 auto;
}

.qkv-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	border-radius: 8px;
	transition: background-color .2s ease;
}

.qkv-btn:hover {
	background-color: rgba(255, 255, 255, .12);
}

.qkv-btn svg {
	width: 18px;
	height: 18px;
	fill: #fff;
	display: block;
	transition: fill .2s ease;
}

.qkv-i {
	display: none;
	line-height: 0;
}

/* وضعیت آیکون‌ها */
.qkv-btn--play .qkv-i--play { display: block; }
.qkv-player.qkv-playing .qkv-btn--play .qkv-i--play { display: none; }
.qkv-player.qkv-playing .qkv-btn--play .qkv-i--pause { display: block; }
.qkv-player.qkv-ended .qkv-btn--play .qkv-i--play,
.qkv-player.qkv-ended .qkv-btn--play .qkv-i--pause { display: none; }
.qkv-player.qkv-ended .qkv-btn--play .qkv-i--replay { display: block; }

.qkv-btn--mute .qkv-i--vol { display: block; }
.qkv-player.qkv-muted .qkv-btn--mute .qkv-i--vol { display: none; }
.qkv-player.qkv-muted .qkv-btn--mute .qkv-i--mute { display: block; }

.qkv-btn--fs .qkv-i--fs { display: block; }
.qkv-player.qkv-fullscreen .qkv-btn--fs .qkv-i--fs { display: none; }
.qkv-player.qkv-fullscreen .qkv-btn--fs .qkv-i--fsexit { display: block; }

/* ---------- زمان ---------- */
.qkv-time {
	display: flex;
	align-items: center;
	gap: 4px;
	direction: ltr;
	color: #fff;
	font-size: 13px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	padding: 0 4px;
	white-space: nowrap;
	user-select: none;
}

.qkv-time__sep {
	opacity: .6;
}

/* ---------- نوار پیشرفت ---------- */
.qkv-progress {
	position: relative;
	padding: 8px 0;
	margin: 0 2px 2px;
	cursor: pointer;
	touch-action: none;
	direction: ltr;
}

.qkv-progress__track {
	position: relative;
	width: 100%;
	height: 5px;
	border-radius: 5px;
	background-color: rgba(255, 255, 255, .25);
	overflow: visible;
	transition: height .15s ease;
}

.qkv-progress__buffer,
.qkv-progress__played {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0;
	border-radius: inherit;
}

.qkv-progress__buffer {
	background-color: rgba(255, 255, 255, .45);
}

.qkv-progress__played {
	background-color: #ff5252;
	z-index: 2;
}

.qkv-progress__thumb {
	position: absolute;
	top: 50%;
	right: 0;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background-color: #fff;
	transform: translate(50%, -50%) scale(0);
	transition: transform .18s ease;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.qkv-progress:hover .qkv-progress__thumb,
.qkv-progress.is-dragging .qkv-progress__thumb {
	transform: translate(50%, -50%) scale(1);
}

.qkv-tooltip {
	position: absolute;
	bottom: 100%;
	left: 0;
	transform: translateX(-50%);
	margin-bottom: 6px;
	padding: 3px 8px;
	border-radius: 6px;
	background-color: rgba(20, 20, 20, .95);
	color: #fff;
	font-size: 12px;
	line-height: 1.4;
	pointer-events: none;
	opacity: 0;
	transition: opacity .15s ease;
	white-space: nowrap;
}

.qkv-progress:hover .qkv-tooltip,
.qkv-progress.is-dragging .qkv-tooltip {
	opacity: 1;
}

/* ---------- صدا ---------- */
.qkv-volume {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

.qkv-vol {
	width: 0;
	overflow: hidden;
	cursor: pointer;
	touch-action: none;
	padding: 10px 0;
	transition: width .25s ease, margin .25s ease;
	direction: ltr;
}

.qkv-volume:hover .qkv-vol,
.qkv-vol.is-dragging,
.qkv-vol:focus-within {
	width: 70px;
	margin-inline-end: 6px;
}

.qkv-vol__track {
	position: relative;
	width: 70px;
	height: 4px;
	border-radius: 4px;
	background-color: rgba(255, 255, 255, .3);
}

.qkv-vol__fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
	border-radius: inherit;
	background-color: #fff;
}

/* ---------- سرعت پخش ---------- */
.qkv-speed {
	position: relative;
	flex: 0 0 auto;
}

.qkv-btn--speed {
	width: auto;
	min-width: 38px;
	padding: 0 8px;
}

.qkv-speed__label {
	color: #fff;
	font-size: 13px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	direction: ltr;
}

.qkv-speed__menu {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(6px);
	min-width: 74px;
	max-height: 190px;
	overflow-y: auto;
	padding: 5px;
	border-radius: 10px;
	background-color: rgba(20, 20, 20, .95);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
	z-index: 12;
}

.qkv-speed.is-open .qkv-speed__menu {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.qkv-speed__item {
	display: block;
	width: 100%;
	padding: 7px 10px;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 13px;
	line-height: 1;
	text-align: center;
	cursor: pointer;
	border-radius: 7px;
	direction: ltr;
	transition: background-color .2s ease, color .2s ease;
}

.qkv-speed__item:hover {
	background-color: rgba(255, 255, 255, .12);
}

.qkv-speed__item.is-active {
	color: #ff5252;
	font-weight: 700;
}

/* ---------- تمام صفحه ---------- */
.qkv-player:fullscreen {
	max-width: none !important;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	background-color: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qkv-player:-webkit-full-screen {
	max-width: none !important;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	background-color: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qkv-player:fullscreen .qkv-stage {
	padding-top: 0 !important;
	width: 100%;
	height: 100%;
	border-radius: 0 !important;
	border: 0 !important;
}

.qkv-player:-webkit-full-screen .qkv-stage {
	padding-top: 0 !important;
	width: 100%;
	height: 100%;
	border-radius: 0 !important;
	border: 0 !important;
}

.qkv-player:fullscreen .qkv-video {
	object-fit: contain !important;
}

.qkv-player:-webkit-full-screen .qkv-video {
	object-fit: contain !important;
}

/* ---------- پیام ویرایشگر ---------- */
.qkv-empty {
	padding: 28px 20px;
	border: 2px dashed rgba(0, 0, 0, .18);
	border-radius: 12px;
	text-align: center;
	color: #6b6b6b;
	font-size: 14px;
	direction: rtl;
}

/* ---------- موبایل ---------- */
@media (max-width: 600px) {
	.qkv-vol,
	.qkv-volume:hover .qkv-vol {
		width: 0;
		margin: 0;
	}

	.qkv-btn {
		width: 32px;
		height: 32px;
	}

	.qkv-time {
		font-size: 12px;
	}

	.qkv-controls {
		padding-top: 20px;
	}
}

/* ---------- کاهش انیمیشن ---------- */
@media (prefers-reduced-motion: reduce) {
	.qkv-player * {
		animation: none !important;
		transition-duration: .01ms !important;
	}
}

/* ---------- پنهان بودن نوار کنترل پیش از شروع پخش ---------- */
.qkv-player.qkv-has-bigplay:not(.qkv-started) .qkv-controls {
	opacity: 0;
	visibility: hidden;
	transform: translateY(100%);
	pointer-events: none;
}

/* ==========================================================================
   سازگاری با پاپ‌آپ، آف‌کنواس، تب و اسلایدر
   ========================================================================== */

.elementor-popup-modal .qkv-wrap,
.elementor-popup-modal .qkv-player,
.elementor-off-canvas .qkv-wrap,
.elementor-off-canvas .qkv-player {
	width: 100%;
}

/* پاپ‌آپ‌ها معمولاً overflow پنهان دارند؛ منوی سرعت نباید بریده شود */
.elementor-popup-modal .dialog-message,
.elementor-popup-modal .dialog-widget-content {
	overflow: visible;
}

/* پلیر داخل عنصر مخفی (تب بسته / پاپ‌آپ بسته) نباید انیمیشن اجرا کند */
.qkv-player:not(.qkv-ready) .qkv-controls {
	opacity: 0;
}

/* ---------- تمام‌صفحه جایگزین (وقتی مرورگر یا پاپ‌آپ اجازه Fullscreen ندهد) ---------- */
.qkv-player.qkv-pseudo-fs {
	position: fixed !important;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	z-index: 999999;
	background-color: #000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qkv-player.qkv-pseudo-fs .qkv-stage {
	padding-top: 0 !important;
	width: 100%;
	height: 100%;
	border-radius: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
}

.qkv-player.qkv-pseudo-fs .qkv-video {
	object-fit: contain !important;
}

body.qkv-noscroll {
	overflow: hidden !important;
}

/* ==========================================================================
   دکمه پخش + پاپ‌آپ ویدیو
   ========================================================================== */

.qkv-btn-root {
	display: flex;
	justify-content: flex-start;
}

.qkv-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-direction: row-reverse; /* آیکون سمت راست */
	gap: 14px;
	direction: ltr;
	margin: 0;
	padding: 14px 26px;
	border: 0;
	cursor: pointer;
	background-color: #0b0b0b;
	border-radius: 10px;
	font-family: inherit;
	line-height: 1;
	text-decoration: none;
	transition: background-color .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease, border-color .25s ease;
	-webkit-tap-highlight-color: transparent;
}

.qkv-trigger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.qkv-trigger__text {
	color: #fff;
	font-size: 16px;
	line-height: 1.6;
	/* تشخیص خودکار جهت متن: فارسی راست‌چین، انگلیسی چپ‌چین */
	unicode-bidi: plaintext;
	white-space: nowrap;
}

.qkv-trigger__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .65);
	transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
	overflow: hidden;
}

.qkv-trigger:hover .qkv-trigger__icon {
	transform: scale(1.05);
}

.qkv-trigger__icon svg {
	width: 14px;
	height: 14px;
	fill: #fff;
	display: block;
	transition: fill .25s ease;
}

.qkv-trigger__icon i {
	font-size: 14px;
	color: #fff;
	line-height: 1;
	transition: color .25s ease;
}

/* ---------- پاپ‌آپ ---------- */
.qkv-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99998;
	align-items: center;
	justify-content: center;
	padding: 60px 20px 30px;
	opacity: 0;
	transition: opacity .28s ease;
}

.qkv-modal.is-active {
	display: flex;
}

.qkv-modal.is-open {
	opacity: 1;
}

.qkv-modal__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, .88);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	cursor: pointer;
}

.qkv-modal__dialog {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 900px;
	max-height: 100%;
	transform: scale(.94) translateY(12px);
	transition: transform .3s cubic-bezier(.2, .8, .3, 1);
}

.qkv-modal.is-open .qkv-modal__dialog {
	transform: none;
}

.qkv-modal__body {
	width: 100%;
}

.qkv-modal__close {
	position: absolute;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	cursor: pointer;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, .12);
	transition: background-color .25s ease, transform .25s ease;
}

.qkv-modal__close:hover {
	background-color: #c62828;
	transform: rotate(90deg);
}

.qkv-modal__close svg {
	width: 20px;
	height: 20px;
	fill: #fff;
	display: block;
}

.qkv-close-outside .qkv-modal__close {
	top: -52px;
	inset-inline-end: 0;
}

.qkv-close-inside .qkv-modal__close {
	top: 12px;
	inset-inline-end: 12px;
}

/* پلیر داخل پاپ‌آپ نباید از ارتفاع صفحه بزند بیرون */
.qkv-modal .qkv-player {
	width: 100%;
}

@media (max-height: 560px) {
	.qkv-modal {
		padding-top: 54px;
	}

	.qkv-close-outside .qkv-modal__close {
		top: -46px;
	}
}

@media (max-width: 480px) {
	.qkv-trigger__text {
		white-space: normal;
	}
}
