/* gigahaber - QbitDM WebRTC Video & Voice Call Module (Desktop + Mobile) */
.qbdm-vid-hdr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	cursor: pointer;
}
.qbdm-vid-hdr-btn svg {
	width: 15px;
	height: 15px;
	display: block;
}
.qbdm-vid-admin-btn {
	background: #eef2ff !important;
	border: 1.5px solid #818cf8 !important;
	color: #312e81 !important;
	font-weight: 700 !important;
}
.qbdm-vid-admin-btn:hover {
	background: #4f46e5 !important;
	border-color: #4f46e5 !important;
	color: #ffffff !important;
}

/* Incoming Call Toast / Modal */
#qbdm-vid-ring {
	display: none;
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 2147483645;
	width: 340px;
	max-width: calc(100vw - 28px);
	background: #0f172a;
	color: #f8fafc;
	border: 2px solid #6366f1;
	border-radius: 18px;
	padding: 18px;
	box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	animation: qbdmVidSlideUp 0.22s ease-out;
}
@keyframes qbdmVidSlideUp {
	from { transform: translateY(18px); opacity: 0; }
	to   { transform: translateY(0); opacity: 1; }
}
.qbdm-vr-top {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}
.qbdm-vr-pulse {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: linear-gradient(135deg, #4f46e5, #06b6d4);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
	animation: qbdmVidPulse 1.5s infinite;
}
@keyframes qbdmVidPulse {
	0%   { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
	70%  { box-shadow: 0 0 0 14px rgba(99, 102, 241, 0); }
	100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
.qbdm-vr-title {
	font-weight: 800;
	font-size: 15px;
	color: #ffffff;
	line-height: 1.3;
}
.qbdm-vr-sub {
	font-size: 12.5px;
	color: #cbd5e1;
	margin-top: 2px;
}
.qbdm-vr-acts {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.qbdm-vr-btn {
	flex: 1;
	min-width: 90px;
	border: none;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	color: #ffffff;
}
.qbdm-vr-acc   { background: #16a34a; }
.qbdm-vr-acc:hover { background: #15803d; }
.qbdm-vr-aud   { background: #0284c7; }
.qbdm-vr-aud:hover { background: #0369a1; }
.qbdm-vr-rej   { background: #dc2626; }
.qbdm-vr-rej:hover { background: #b91c1c; }

/* Active Call Overlay */
#qbdm-vid-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 2147483646;
	background: rgba(2, 6, 23, 0.92);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	align-items: center;
	justify-content: center;
	padding: 18px;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-sizing: border-box;
}
#qbdm-vid-overlay.is-mini {
	inset: auto 20px 20px auto;
	width: 310px;
	height: 225px;
	padding: 0;
	background: transparent;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}
.qbdm-vo-stage {
	position: relative;
	width: 100%;
	max-width: 960px;
	height: 100%;
	max-height: 680px;
	background: #0b1120;
	border-radius: 20px;
	overflow: hidden;
	border: 1.5px solid rgba(148, 163, 184, 0.28);
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
	display: flex;
	flex-direction: column;
}
#qbdm-vid-overlay.is-mini .qbdm-vo-stage {
	max-width: 100%;
	max-height: 100%;
	border-radius: 16px;
	border-color: #6366f1;
}
.qbdm-vo-topbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5;
	padding: 14px 18px;
	background: linear-gradient(180deg, rgba(2, 6, 23, 0.84) 0%, rgba(2, 6, 23, 0) 100%);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: #ffffff;
}
.qbdm-vo-peer {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
.qbdm-vo-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #f59e0b;
	flex-shrink: 0;
}
.qbdm-vo-dot.live {
	background: #22c55e;
	box-shadow: 0 0 8px #22c55e;
}
.qbdm-vo-name {
	font-weight: 800;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.qbdm-vo-status {
	font-size: 12.2px;
	color: #cbd5e1;
}
.qbdm-vo-timer {
	background: rgba(15, 23, 42, 0.72);
	border: 1px solid rgba(255, 255, 255, 0.18);
	padding: 4px 10px;
	border-radius: 99px;
	font-family: monospace;
	font-size: 12.5px;
	font-weight: 700;
	color: #f8fafc;
}
.qbdm-vo-videos {
	position: relative;
	flex: 1;
	background: radial-gradient(circle at center, #1e293b 0%, #0b1120 75%);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
#qbdm-vid-remote {
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #0b1120;
	display: block;
}
.qbdm-vo-audio-ph {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: #e2e8f0;
	pointer-events: none;
	text-align: center;
	padding: 20px;
}
.qbdm-vo-avatar {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: linear-gradient(135deg, #4f46e5, #0ea5e9);
	color: #ffffff;
	font-size: 34px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 30px rgba(79, 70, 229, 0.45);
}
#qbdm-vid-local-wrap {
	position: absolute;
	bottom: 84px;
	right: 18px;
	z-index: 6;
	width: 176px;
	height: 124px;
	border-radius: 14px;
	overflow: hidden;
	background: #1e293b;
	border: 2px solid rgba(255, 255, 255, 0.35);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
#qbdm-vid-overlay.is-mini #qbdm-vid-local-wrap {
	display: none !important;
}
#qbdm-vid-local {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
#qbdm-vid-local.is-mirrored {
	transform: scaleX(-1);
}
.qbdm-vo-controls {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 7;
	padding: 14px 16px;
	background: linear-gradient(0deg, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 0) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 11px;
	flex-wrap: wrap;
}
#qbdm-vid-overlay.is-mini .qbdm-vo-controls {
	padding: 8px;
	gap: 7px;
}
.qbdm-vc-btn {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.22);
	background: rgba(30, 41, 59, 0.85);
	color: #ffffff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.14s, background 0.14s;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
.qbdm-vc-btn:hover {
	transform: scale(1.06);
	background: rgba(51, 65, 85, 0.95);
}
.qbdm-vc-btn.is-off {
	background: #f59e0b;
	border-color: #fbbf24;
	color: #0f172a;
}
.qbdm-vc-btn.is-active {
	background: #0284c7;
	border-color: #38bdf8;
	color: #ffffff;
}
.qbdm-vc-btn.is-end {
	background: #dc2626;
	border-color: #f87171;
	width: 54px;
}
.qbdm-vc-btn.is-end:hover {
	background: #b91c1c;
}
.qbdm-vc-btn svg {
	width: 20px;
	height: 20px;
	display: block;
}
#qbdm-vid-overlay.is-mini .qbdm-vc-btn {
	width: 36px;
	height: 36px;
}
#qbdm-vid-overlay.is-mini .qbdm-vc-btn svg {
	width: 16px;
	height: 16px;
}
#qbdm-vid-overlay.is-mini .qbdm-vc-hide-mini {
	display: none !important;
}
.qbdm-vo-err {
	position: absolute;
	top: 64px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 8;
	background: rgba(185, 28, 28, 0.94);
	color: #ffffff;
	padding: 8px 14px;
	border-radius: 10px;
	font-size: 12.8px;
	font-weight: 700;
	max-width: 90%;
	text-align: center;
	display: none;
}

@media (max-width: 640px) {
	#qbdm-vid-overlay:not(.is-mini) {
		padding: 0;
	}
	#qbdm-vid-overlay:not(.is-mini) .qbdm-vo-stage {
		max-width: 100vw;
		max-height: 100dvh;
		height: 100dvh;
		border-radius: 0;
		border: none;
	}
	#qbdm-vid-overlay:not(.is-mini) .qbdm-vo-topbar {
		padding-top: calc(12px + env(safe-area-inset-top, 0px));
	}
	#qbdm-vid-overlay:not(.is-mini) .qbdm-vo-controls {
		padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		gap: 10px;
	}
	#qbdm-vid-local-wrap {
		width: 112px;
		height: 152px;
		bottom: calc(92px + env(safe-area-inset-bottom, 0px));
		right: 12px;
	}
	#qbdm-vid-ring {
		left: 14px;
		right: 14px;
		width: auto;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}
}

/* Localized Video Toast & RTL Support */
#qbdm-vid-toast {
	display: none;
	position: fixed;
	bottom: 92px;
	right: 24px;
	z-index: 2147483647;
	max-width: min(340px, calc(100vw - 28px));
	background: #0f172a;
	color: #f8fafc;
	border: 1.5px solid #6366f1;
	border-radius: 12px;
	padding: 11px 15px;
	font-size: 13.2px;
	font-weight: 700;
	line-height: 1.45;
	box-shadow: 0 14px 36px rgba(2, 6, 23, 0.42);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#qbdm-vid-ring[dir="rtl"],
#qbdm-vid-overlay[dir="rtl"],
#qbdm-vid-toast[dir="rtl"] {
	text-align: right;
}
#qbdm-vid-ring[dir="rtl"] .qbdm-vr-top,
#qbdm-vid-overlay[dir="rtl"] .qbdm-vo-topbar,
#qbdm-vid-overlay[dir="rtl"] .qbdm-vo-peer {
	flex-direction: row-reverse;
}
#qbdm-vid-overlay[dir="rtl"] #qbdm-vid-local-wrap {
	right: auto;
	left: 18px;
}
@media (max-width: 640px) {
	#qbdm-vid-overlay[dir="rtl"] #qbdm-vid-local-wrap {
		left: 12px;
	}
	#qbdm-vid-toast {
		left: 14px;
		right: 14px;
		max-width: none;
		bottom: calc(86px + env(safe-area-inset-bottom, 0px));
	}
}
