/**
 * Tecology Video Uploader — Block Frontend Styles
 *
 * @package TecologyVideoUploader
 */

/* ==================================================================
   Video block wrapper
   ================================================================== */

.tvu-video-block {
	--tvu-play-color: var(--wp--preset--color--accent, #2271b1);
	max-width: 100%;
	margin-bottom: 1.5em;
}

/* ==================================================================
   Video wrapper (16:9 aspect ratio)
   ================================================================== */

.tvu-video-wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
}

.tvu-video-wrapper iframe,
.tvu-video-wrapper .tvu-iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ==================================================================
   Thumbnail overlay
   ================================================================== */

.tvu-video-wrapper--thumbnail {
	cursor: pointer;
}

.tvu-thumbnail {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ==================================================================
   Play button
   ================================================================== */

.tvu-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: var(--tvu-play-color);
	transition: transform 0.2s ease, opacity 0.2s ease;
	z-index: 2;
	line-height: 0;
}

.tvu-play-btn:hover,
.tvu-play-btn:focus-visible {
	transform: translate(-50%, -50%) scale(1.1);
	opacity: 0.95;
}

.tvu-play-icon {
	width: 68px;
	height: 68px;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* Darken thumbnail slightly for contrast */
.tvu-video-wrapper--thumbnail::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.15);
	pointer-events: none;
	transition: background 0.2s ease;
}

.tvu-video-wrapper--thumbnail:hover::after {
	background: rgba(0, 0, 0, 0.25);
}

/* ==================================================================
   Editor preview styles (used in the block editor)
   ================================================================== */

.tvu-editor-preview {
	position: relative;
	border-radius: 6px;
	overflow: hidden;
	background: #000;
	aspect-ratio: 16 / 9;
}

.tvu-editor-preview--thumbnail {
	cursor: default;
}

.tvu-editor-thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tvu-editor-iframe {
	width: 100%;
	height: 100%;
	border: 0;
	position: absolute;
	top: 0;
	left: 0;
}

.tvu-editor-play-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	line-height: 0;
}

.tvu-editor-play-icon {
	width: 68px;
	height: 68px;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* Label at bottom */
.tvu-editor-label {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
	color: #fff;
	padding: 24px 14px 10px;
	font-size: 13px;
	z-index: 3;
}

.tvu-editor-label .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	vertical-align: middle;
	margin-right: 4px;
}

/* Responsive play button */
@media (max-width: 600px) {
	.tvu-play-icon,
	.tvu-editor-play-icon {
		width: 48px;
		height: 48px;
	}
}
