.vpw-playlist-widget * {
	box-sizing: border-box;
}

.vpw-empty-notice {
	padding: 20px;
	background: #f5f5f5;
	color: #999;
	text-align: center;
}

/* ---------- Sidebar layout ---------- */
.vpw-sidebar-layout {
	display: flex;
	width: 100%;
	gap: 0;
}

.vpw-player-area {
	flex: 1 1 auto;
	position: relative;
	height: 500px;
	background: #000;
	overflow: hidden;
}

.vpw-player-area .vpw-video-el,
.vpw-player-area .vpw-iframe-el {
	width: 100%;
	height: 100%;
	display: block;
}

.vpw-playlist-panel {
	flex: 0 0 30%;
	width: 30%;
	max-height: 500px;
	overflow-y: auto;
	background: #fff;
}

.vpw-topbar {
	padding: 14px 16px;
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.vpw-item-list {
	display: flex;
	flex-direction: column;
}

.vpw-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.vpw-item-thumb {
	position: relative;
	flex: 0 0 90px;
	width: 90px;
	height: 54px;
	overflow: hidden;
	border-radius: 4px;
	background: #ddd;
}

.vpw-item-thumb img,
.vpw-item-thumb video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vpw-item-info {
	flex: 1 1 auto;
	min-width: 0;
}

.vpw-item-title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.vpw-item-duration {
	font-size: 12px;
	opacity: 0.6;
}

/* ---------- Grid layout ---------- */
.vpw-grid-layout {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.vpw-grid-item {
	cursor: pointer;
	padding: 0;
}

.vpw-grid-item .vpw-item-thumb {
	width: 100%;
	height: 160px;
	flex: none;
	border-radius: 6px;
}

.vpw-grid-item .vpw-play-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 28px;
	background: rgba(0, 0, 0, 0.25);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.vpw-grid-item:hover .vpw-play-icon {
	opacity: 1;
}

.vpw-grid-item .vpw-item-title {
	margin-top: 8px;
	white-space: normal;
}

.vpw-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: 999999;
	align-items: center;
	justify-content: center;
}

.vpw-lightbox.vpw-open {
	display: flex;
}

.vpw-lightbox-inner {
	position: relative;
	width: min(90vw, 1100px);
	aspect-ratio: 16 / 9;
	background: #000;
}

.vpw-lightbox-player,
.vpw-lightbox-player video,
.vpw-lightbox-player iframe {
	width: 100%;
	height: 100%;
	display: block;
}

.vpw-lightbox-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 32px;
	cursor: pointer;
	line-height: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
	.vpw-sidebar-layout {
		flex-direction: column !important;
	}

	.vpw-playlist-panel {
		width: 100% !important;
		flex: 1 1 auto !important;
		max-height: 300px;
	}

	.vpw-grid-layout {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}
