/*
 * YouTube Playlist by Vero — Stylesheet
 * Version: 1.0
 * Author:  Vero (https://vero.am)
 *
 * Sections:
 *  1. Wrapper & Grid
 *  2. Card
 *  3. Thumbnail & Overlay
 *  4. Play Button
 *  5. Card Body & Title
 *  6. Pagination / Load More
 *  7. State Messages
 *  8. Lightbox
 *  9. Admin Plugin Modal
 * 10. Responsive Defaults
 */

/* ─────────────────────────────────────────────────────────────────────────────
 * 1. Wrapper & Grid
 * ───────────────────────────────────────────────────────────────────────────── */

.ypv-wrapper {
	width: 100%;
}

.ypv-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 24px;
	row-gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 2. Card
 * ───────────────────────────────────────────────────────────────────────────── */

.ypv-card {
	background: #1a1a1a;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ypv-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 3. Thumbnail & Overlay
 * ───────────────────────────────────────────────────────────────────────────── */

.ypv-card__thumb-link {
	display: block;
	text-decoration: none;
}

.ypv-card__thumb {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #111;
}

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

.ypv-card__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.25s ease;
}

.ypv-card:hover .ypv-card__overlay {
	background: rgba(0, 0, 0, 0.55);
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 4. Play Button
 * ───────────────────────────────────────────────────────────────────────────── */

.ypv-play-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0.9;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.ypv-card:hover .ypv-play-btn {
	opacity: 1;
	transform: scale(1.12);
}

.ypv-play-btn svg {
	width: 52px;
	height: auto;
	filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.7));
}

.ypv-play-btn__bg {
	fill: #cc0000;
	transition: fill 0.2s ease;
}

.ypv-card:hover .ypv-play-btn__bg {
	fill: #ff0000;
}

.ypv-play-btn__icon {
	fill: #ffffff;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 5. Card Body & Title
 * ───────────────────────────────────────────────────────────────────────────── */

.ypv-card__body {
	padding: 14px 16px 16px;
	flex: 1;
}

.ypv-card__title {
	margin: 0;
	font-size: 0.925rem;
	font-weight: 600;
	line-height: 1.45;
	letter-spacing: 0.01em;
}

.ypv-card__title a {
	color: #ffffff;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s ease;
}

.ypv-card__title a:hover {
	color: #ff4444;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 6. Pagination / Load More
 * ───────────────────────────────────────────────────────────────────────────── */

.ypv-pagination {
	margin-top: 36px;
	text-align: center;
}

.ypv-load-more {
	display: inline-block;
	background: #cc0000;
	color: #ffffff;
	border: none;
	padding: 12px 32px;
	border-radius: 4px;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
	outline-offset: 3px;
}

.ypv-load-more:hover {
	background: #990000;
	transform: translateY(-1px);
}

.ypv-load-more:active {
	transform: translateY(0);
}

.ypv-load-more:focus-visible {
	outline: 2px solid #ff4444;
}

.ypv-load-more:disabled,
.ypv-load-more.is-loading {
	opacity: 0.6;
	cursor: wait;
	pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 7. State Messages
 * ───────────────────────────────────────────────────────────────────────────── */

.ypv-placeholder,
.ypv-error,
.ypv-empty {
	padding: 28px 24px;
	border-radius: 6px;
	text-align: center;
	font-size: 0.9rem;
	line-height: 1.6;
}

.ypv-placeholder {
	background: #f5f5f5;
	border: 2px dashed #ccc;
	color: #555;
}

.ypv-error {
	background: #fff3f3;
	border: 1px solid #ffb3b3;
	color: #b71c1c;
}

.ypv-empty {
	background: #fafafa;
	border: 1px solid #e0e0e0;
	color: #757575;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 8. Lightbox
 * ───────────────────────────────────────────────────────────────────────────── */

.ypv-lightbox-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: ypv-fade-in 0.2s ease;
}

.ypv-lightbox-inner {
	position: relative;
	width: min(92vw, 960px);
	aspect-ratio: 16 / 9;
}

.ypv-lightbox-inner iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

.ypv-lightbox-close {
	position: absolute;
	top: -44px;
	right: 0;
	background: none;
	border: none;
	color: #ffffff;
	font-size: 2.2rem;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	transition: color 0.15s ease;
}

.ypv-lightbox-close:hover {
	color: #ff4444;
}

@keyframes ypv-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 9. Admin Plugin Modal
 * ───────────────────────────────────────────────────────────────────────────── */

.ypv-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: ypv-fade-in 0.18s ease;
}

.ypv-modal-backdrop[hidden] {
	display: none;
}

.ypv-modal-box {
	background: #ffffff;
	border-radius: 10px;
	width: 100%;
	max-width: 560px;
	max-height: 88vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.ypv-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 1.7rem;
	line-height: 1;
	color: #888;
	cursor: pointer;
	padding: 2px 6px;
	transition: color 0.15s ease;
	z-index: 1;
}

.ypv-modal-close:hover {
	color: #cc0000;
}

.ypv-modal-header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 24px 24px 16px;
	border-bottom: 1px solid #ececec;
}

.ypv-modal-header h2 {
	margin: 0 0 3px;
	font-size: 1.1rem;
	font-weight: 700;
	color: #1a1a1a;
}

.ypv-modal-version {
	margin: 0;
	font-size: 0.78rem;
	color: #999;
	font-weight: 400;
}

.ypv-modal-body {
	padding: 20px 24px 28px;
	color: #333;
	font-size: 0.875rem;
	line-height: 1.65;
}

.ypv-modal-body p {
	margin: 0 0 12px;
}

.ypv-modal-body h3 {
	margin: 20px 0 8px;
	font-size: 0.9rem;
	font-weight: 700;
	color: #111;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ypv-modal-body ol,
.ypv-modal-body ul {
	padding-left: 18px;
	margin: 0 0 14px;
}

.ypv-modal-body li {
	margin-bottom: 6px;
}

.ypv-modal-brand {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid #ececec;
	text-align: center;
	font-size: 0.82rem;
	color: #aaa;
}

.ypv-modal-brand a {
	color: #cc0000;
	text-decoration: none;
	font-weight: 700;
}

.ypv-modal-brand a:hover {
	text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 10. Responsive Defaults
 *     (Elementor overrides grid-template-columns via its own generated CSS.
 *      These are sensible fallbacks when Elementor CSS is absent.)
 * ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
	.ypv-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.ypv-grid {
		grid-template-columns: 1fr;
		column-gap: 0;
	}

	.ypv-card__title {
		font-size: 0.875rem;
	}
}
