/* YouTube Lessons Gallery - Frontend Styles */
.ylg-gallery {
	--ylg-bg: #ffffff;
	--ylg-border: #e5e7eb;
	--ylg-text: #111827;
	--ylg-muted: #6b7280;
	--ylg-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
	--ylg-shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.13);
	--ylg-accent: #e11d48;
	--ylg-radius: 14px;

	width: 100%;
	margin: 1.5rem 0;
	box-sizing: border-box;
}

.ylg-gallery *,
.ylg-gallery *::before,
.ylg-gallery *::after {
	box-sizing: border-box;
}

.ylg-gallery.ylg-theme-dark {
	--ylg-bg: #18181b;
	--ylg-border: #27272a;
	--ylg-text: #f4f4f5;
	--ylg-muted: #a1a1aa;
	--ylg-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
	--ylg-shadow-hover: 0 14px 32px rgba(0, 0, 0, 0.55);
}

.ylg-grid {
	display: grid;
	gap: 22px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ylg-cols-2 .ylg-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ylg-cols-3 .ylg-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ylg-cols-4 .ylg-grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1024px) {
	.ylg-cols-4 .ylg-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 780px) {
	.ylg-cols-3 .ylg-grid,
	.ylg-cols-4 .ylg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.ylg-grid,
	.ylg-cols-2 .ylg-grid,
	.ylg-cols-3 .ylg-grid,
	.ylg-cols-4 .ylg-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

.ylg-card {
	background: var(--ylg-bg);
	border: 1px solid var(--ylg-border);
	border-radius: var(--ylg-radius);
	overflow: hidden;
	box-shadow: var(--ylg-shadow);
	display: flex;
	flex-direction: column;
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.ylg-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--ylg-shadow-hover);
}

.ylg-media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #09090b;
	overflow: hidden;
}

.ylg-media iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ylg-trigger {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	text-decoration: none;
}

.ylg-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.ylg-card:hover .ylg-thumb {
	transform: scale(1.04);
}

.ylg-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.08));
	opacity: 0.7;
	transition: opacity 0.25s ease;
}

.ylg-card:hover .ylg-overlay {
	opacity: 0.95;
}

.ylg-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.95);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.22s ease, filter 0.22s ease;
	filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.ylg-play-btn .ylg-play-bg {
	fill: rgba(24, 24, 27, 0.82);
	transition: fill 0.22s ease;
}

.ylg-card:hover .ylg-play-btn {
	transform: translate(-50%, -50%) scale(1.06);
}

.ylg-card:hover .ylg-play-btn .ylg-play-bg {
	fill: #ff0000;
}

.ylg-card-body {
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.ylg-card-title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.45;
	font-weight: 600;
	color: var(--ylg-text);
}

.ylg-card-title a,
.ylg-title-btn {
	color: inherit;
	text-decoration: none;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	text-align: inherit;
	cursor: pointer;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	width: 100%;
	transition: color 0.2s ease;
}

.ylg-card-title a:hover,
.ylg-title-btn:hover {
	color: var(--ylg-accent);
}

.ylg-card-meta {
	margin-top: auto;
	font-size: 0.82rem;
	color: var(--ylg-muted);
}

.ylg-footer-actions {
	margin-top: 24px;
	text-align: center;
}

.ylg-channel-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 22px;
	border-radius: 999px;
	background: #dc2626;
	color: #ffffff !important;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none !important;
	box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
	transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ylg-channel-btn:hover {
	background: #b91c1c;
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(220, 38, 38, 0.35);
}

.ylg-empty-notice {
	padding: 14px 18px;
	border-radius: 10px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
	font-size: 0.95rem;
}

/* Lightbox Modal */
.ylg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.22s ease, visibility 0.22s ease;
}

.ylg-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.ylg-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(9, 9, 11, 0.84);
	backdrop-filter: blur(4px);
}

.ylg-lightbox-dialog {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 940px;
	background: #18181b;
	color: #f4f4f5;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
	transform: scale(0.95);
	transition: transform 0.22s ease;
}

.ylg-lightbox.is-open .ylg-lightbox-dialog {
	transform: scale(1);
}

.ylg-lightbox-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid #27272a;
}

.ylg-lightbox-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: #ffffff;
	line-height: 1.4;
}

.ylg-lightbox-close {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.18s ease;
}

.ylg-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.22);
}

.ylg-lightbox-player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000000;
}

.ylg-lightbox-player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ylg-lightbox-footer {
	padding: 10px 18px;
	display: flex;
	justify-content: flex-end;
	border-top: 1px solid #27272a;
}

.ylg-lightbox-external {
	color: #d4d4d8 !important;
	font-size: 0.85rem;
	text-decoration: none;
	transition: color 0.18s ease;
}

.ylg-lightbox-external:hover {
	color: #ffffff !important;
}

body.ylg-modal-open {
	overflow: hidden;
}
