/* ---------------------------------------------------------------
 * Video Lectures — card grid
 * --------------------------------------------------------------- */
.vln-videos-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 18px;
	margin-top: 16px;
}

.vln-video-card {
	display: flex;
	flex-direction: column;
	background: var(--vln-surface);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--vln-radius-m);
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.vln-video-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--vln-shadow);
	border-color: rgba(0, 0, 0, 0.15);
}

.vln-video-card.is-completed {
	border-color: var(--vln-accent);
}

.vln-video-card-thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--vln-surface);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.vln-video-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vln-video-card-thumb > .dashicons:not(.vln-video-card-play-icon) {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: var(--vln-text-muted);
}

.vln-video-card-play-icon {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 44px;
	height: 44px;
	font-size: 44px;
	color: var(--vln-text);
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
	pointer-events: none;
}

.vln-video-card-duration {
	position: absolute;
	right: 8px;
	bottom: 8px;
	background: rgba(0, 0, 0, 0.75);
	color: var(--vln-text);
	font-size: 11px;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 4px;
}

.vln-video-card-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 16px 16px;
}

.vln-video-card-title {
	font-weight: 600;
	font-size: 14px;
	line-height: 1.35;
	color: var(--vln-on-accent);
}

.vln-video-card-langs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.vln-video-card-langs .vln-pro-lms-btn {
	flex: 1 1 auto;
	font-size: 12px;
	padding: 8px 10px;
	white-space: nowrap;
}

.vln-video-card-complete {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--vln-text-muted);
	cursor: pointer;
	user-select: none;
}

.vln-video-card-complete input[type='checkbox'] {
	accent-color: var(--vln-accent);
	width: 15px;
	height: 15px;
	cursor: pointer;
}

/* ---------------------------------------------------------------
 * Chromeless player modal
 * --------------------------------------------------------------- */
body.vln-video-player-open {
	overflow: hidden;
}

.vln-video-player-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: var(--vln-bg);
	display: flex;
	flex-direction: column;
}

.vln-video-player-modal[hidden] {
	display: none;
}

.vln-video-player-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: var(--vln-surface);
	color: var(--vln-text);
	flex-shrink: 0;
}

.vln-video-player-title {
	font-weight: 600;
	font-size: 15px;
}

.vln-video-player-close {
	background: none;
	border: none;
	color: var(--vln-text);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

.vln-video-player-frame-wrap {
	flex: 1;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--vln-bg);
	overflow: hidden;
}

#vln-video-player-target,
#vln-video-player-target iframe {
	/* !important is deliberate: the YouTube IFrame API sets a fixed
	   pixel width/height (640x390 by default) as an inline style on
	   the iframe it creates, which otherwise wins over this rule
	   regardless of selector specificity. Without this, the iframe
	   renders at that fixed size — often far larger or smaller than
	   this modal, and on narrow screens mostly clipped outside the
	   visible, overflow:hidden frame — so the video plays (audio
	   keeps going, since clipping doesn't pause playback) while
	   almost none of the picture is actually on screen. */
	width: 100% !important;
	height: 100% !important;
	border: none !important;
}

/* The IFrame API's own chrome, including Share, never appears since
   controls: 0 is set when the player is created — but a small
   translucent shield keeps a stray click on the always-present
   YouTube logo/title overlay from opening a new tab mid-lecture. */
.vln-video-player-frame-wrap::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.vln-video-player-spinner {
	position: absolute;
	width: 36px;
	height: 36px;
	border: 3px solid color-mix(in srgb, var(--vln-text) 20%, transparent);
	border-top-color: var(--vln-accent);
	border-radius: 50%;
	animation: vln-video-spin 0.8s linear infinite;
}

.vln-video-player-spinner[hidden] {
	display: none;
}

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

.vln-video-player-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 20px;
	background: var(--vln-surface);
	flex-shrink: 0;
}

.vln-video-player-controls button {
	background: none;
	border: none;
	color: var(--vln-text);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
}

.vln-video-player-controls .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}

.vln-video-player-seek {
	flex: 1;
	accent-color: var(--vln-accent);
	cursor: pointer;
}

.vln-video-player-time {
	color: var(--vln-text-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.vln-video-player-fullscreen {
	font-size: 18px;
}
