/* ======================================================================
   DH Video Overlay (v2.8 — Network-Aware + Top-Right Icon Edition)
   ----------------------------------------------------------------------
   PURPOSE
   • Provides full-screen overlay for contextual help videos (Vimeo)
   • SVG “video” icon trigger floating top-right (pulses twice)
   • Includes loader loop video + blocked/no-video fallbacks
   • Maximum z-index safety, drag support, and accessibility
   ====================================================================== */

/* --------------------------------------------------------------
 * Floating Help Icon — Top Right, 120px from Top
 * ------------------------------------------------------------ */
#dh-help-icon {
	position: fixed !important;
	top: 120px !important;
	right: 24px !important;
	width: 50px;
	height: 50px;
	background: #811DD1;
	border-radius: 50%;
	box-shadow: 0 3px 10px rgba(0,0,0,0.35);
	cursor: pointer;
	z-index: 2147483646 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease-in-out, background 0.15s ease-in-out;
	animation: dh-pulse 3s ease-in-out 0s 2; /* pulses twice then stops */
}

/* SVG Icon */
#dh-help-icon svg {
	width: 24px;
	height: 24px;
	fill: #ffffff !important;
	pointer-events: none;
	user-select: none;
	transition: transform 0.15s ease-in-out, fill 0.15s ease-in-out;
}

/* Hover */
#dh-help-icon:hover {
	background: #D11D8D;
	transform: scale(1.1);
}
#dh-help-icon:hover svg {
	transform: scale(1.05);
	fill: #ffffff !important;
}

/* Pulse Animation */
@keyframes dh-pulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 0 8px rgba(129,29,209,0.45);
	}
	50% {
		transform: scale(1.08);
		box-shadow: 0 0 20px rgba(209,29,141,0.85);
	}
}

/* Accessibility Focus Outline */
#dh-help-icon:focus {
	outline: 2px solid #D11D8D;
	outline-offset: 3px;
}

/* --------------------------------------------------------------
 * Fullscreen Overlay
 * ------------------------------------------------------------ */
#dh-video-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,0.85);
	z-index: 2147483647;
	animation: dh-overlay-fadein 0.15s ease-in-out;
}
@keyframes dh-overlay-fadein {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* --------------------------------------------------------------
 * Video Container (Draggable Frame)
 * ------------------------------------------------------------ */
.dh-video-container {
	position: fixed;
	width: 80%;
	max-width: 960px;
	aspect-ratio: 16 / 9;
	background: #000;
	border: 4px solid rgba(255,255,255,0.6);
	outline: 1px solid rgba(0,0,0,0.9);
	border-radius: 10px;
	box-shadow: 0 12px 45px rgba(0,0,0,0.9);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: move;
	user-select: none;
	overflow: hidden;
	transition: box-shadow 0.25s ease-in-out, border-color 0.25s ease-in-out, transform 0.15s ease;
	backdrop-filter: blur(2px);
}
.dh-video-container:hover {
	border-color: rgba(255,255,255,0.8);
	box-shadow: 0 12px 50px rgba(0,0,0,0.95);
	transform: translateY(-2px);
}
.dh-video-container.dragging {
	border-color: rgba(0,180,255,0.9);
	box-shadow: 0 0 60px rgba(0,180,255,0.6);
}

/* --------------------------------------------------------------
 * Vimeo Iframe
 * ------------------------------------------------------------ */
.dh-video-container iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
	pointer-events: auto;
	object-fit: cover;
}

/* --------------------------------------------------------------
 * Close Button
 * ------------------------------------------------------------ */
.dh-close-btn {
	position: absolute;
	top: 6px;
	right: 10px;
	font-size: 28px;
	color: #fff;
	background: rgba(0,0,0,0.4);
	border: none;
	border-radius: 6px;
	padding: 0 6px;
	line-height: 1;
	cursor: pointer;
	z-index: 10;
}
.dh-close-btn:hover {
	background: rgba(255,255,255,0.25);
	color: #00aaff;
}

/* --------------------------------------------------------------
 * Loading Spinner + Message
 * ------------------------------------------------------------ */
.dh-spinner {
	width: 48px;
	height: 48px;
	border: 4px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: dh-spin 0.8s linear infinite;
	margin-bottom: 14px;
}
@keyframes dh-spin {
	to { transform: rotate(360deg); }
}

.dh-message,
.dh-no-video {
	color: #fff;
	font-size: 1.2rem;
	text-align: center;
	padding: 20px;
}
.dh-no-video small {
	display: block;
	margin-top: 6px;
	font-size: 0.9rem;
	opacity: 0.8;
}

/* --------------------------------------------------------------
 * Blocked / Network Fallback Overlay
 * ------------------------------------------------------------ */
.dh-blocked-fallback h1 {
	color: #FFD966; /* golden warning tone */
	font-weight: 600;
}
.dh-blocked-fallback p strong {
	color: #ffffff;
}
.dh-blocked-fallback {
	animation: dh-fadein 0.6s ease-in-out;
}
@keyframes dh-fadein {
	from { opacity: 0; transform: scale(0.98); }
	to   { opacity: 1; transform: scale(1); }
}

/* --------------------------------------------------------------
 * Adaptive / Small Screens
 * ------------------------------------------------------------ */
@media (max-width: 768px) {
	#dh-help-icon {
		top: 80px !important;
		right: 16px !important;
		width: 44px;
		height: 44px;
	}
	#dh-help-icon svg {
		width: 20px;
		height: 20px;
	}
	.dh-video-container {
		width: 95%;
		border-radius: 6px;
	}
	.dh-close-btn {
		font-size: 26px;
	}
	.dh-message,
	.dh-no-video {
		font-size: 1rem;
		padding: 14px;
	}
}

/* --------------------------------------------------------------
 * Focus States
 * ------------------------------------------------------------ */
#dh-help-icon:focus,
.dh-close-btn:focus {
	outline: 2px solid #0096d6;
	outline-offset: 3px;
}