/* YouTube Playlist for Elementor */

.ype-playlist {
	width: 100%;
}

/* ==============================
   CAROUSEL LAYOUT
   ============================== */

.ype-carousel {
	width: 100%;
}

.ype-player-wrap {
	width: 100%;
	margin-bottom: 16px;
}

.ype-player-inner {
	position: relative;
	width: 100%;
	padding-bottom: 42%;
	overflow: hidden;
	background: #000;
	border-radius: 4px;
}

.ype-player-inner iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.ype-player-info {
	padding: 12px 0 8px;
}

.ype-player-title {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

.ype-player-description {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: #666;
}

/* Thumbnails Section */

.ype-thumbnails-section {
	position: relative;
	width: 100%;
}

.ype-thumbnails-viewport {
	overflow-x: auto;
	overflow-y: hidden;
	width: 100%;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.ype-thumbnails-viewport::-webkit-scrollbar {
	display: none;
}

.ype-thumbnails-track {
	display: flex;
	gap: 12px;
	width: max-content;
	min-width: 100%;
}

.ype-carousel-nav {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	padding-top: 12px;
}

.ype-carousel-btn {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border: 1px solid #ddd;
	border-radius: 50%;
	background: #fff;
	color: #666;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	z-index: 10;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ype-carousel-btn:hover {
	background: #e91e63;
	color: #fff;
	border-color: #e91e63;
}

.ype-carousel-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	box-shadow: none;
}

.ype-carousel-btn:disabled:hover {
	background: #fff;
	color: #666;
	border-color: #ddd;
}

.ype-carousel-btn i {
	font-size: 12px;
}

/* Thumbnails grid */

.ype-thumb-item {
	position: relative;
	cursor: pointer;
	border-radius: 4px;
	border: 2px solid transparent;
	transition: border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
	overflow: hidden;
	background: #f5f5f5;
	flex-shrink: 0;
	width: 250px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.ype-thumb-item:hover,
.ype-thumb-item:hover * {
	cursor: pointer;
}

.ype-thumb-item.active {
	border-color: #e91e63;
	box-shadow: 0 0 0 2px #e91e63;
}

.ype-thumb-num {
	position: absolute;
	top: 6px;
	left: 6px;
	width: 24px;
	height: 24px;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 3;
	line-height: 1;
}

.ype-thumb-img-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	line-height: 0;
}

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

.ype-thumb-item:hover .ype-thumb-img {
	transform: scale(1.03);
}

.ype-play-icon {
	display: none;
}

.ype-thumb-label {
	padding: 10px 6px 8px;
}

.ype-thumb-title {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	color: inherit;
}

/* ==============================
   LIST LAYOUT
   ============================== */

.ype-layout-list .ype-video-item + .ype-video-item {
	margin-top: 16px;
}

.ype-layout-list .ype-video-link {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	text-decoration: none;
	color: inherit;
	transition: opacity 0.2s ease;
}

.ype-layout-list .ype-video-link:hover {
	opacity: 0.8;
}

.ype-layout-list .ype-thumbnail-wrap {
	flex: 0 0 160px;
}

/* ==============================
   GRID LAYOUT
   ============================== */

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

.ype-layout-grid .ype-video-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	transition: opacity 0.2s ease;
}

.ype-layout-grid .ype-video-link:hover {
	opacity: 0.8;
}

/* ==============================
   SHARED THUMBNAIL STYLES
   ============================== */

.ype-thumbnail-wrap {
	position: relative;
	line-height: 0;
}

.ype-thumbnail {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
	object-fit: cover;
}

.ype-layout-list .ype-thumbnail {
	width: 160px;
	height: 90px;
}

.ype-layout-grid .ype-thumbnail {
	width: 100%;
	aspect-ratio: 16/9;
	object-fit: cover;
}

.ype-video-info {
	flex: 1;
	min-width: 0;
}

.ype-layout-grid .ype-video-info {
	padding-top: 8px;
}

.ype-video-title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ype-video-description {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: #666;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

/* ==============================
   NOTICES
   ============================== */

.ype-notice {
	padding: 12px 16px;
	background: #f0f0f0;
	border-left: 4px solid #aaa;
	font-size: 13px;
	border-radius: 2px;
}

.ype-notice.ype-error {
	background: #fef2f2;
	border-color: #ef4444;
	color: #b91c1c;
}

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 1024px) {
	.ype-thumb-item {
		width: calc(50% - 6px);
	}
}

@media (max-width: 768px) {
	.ype-thumbnails-carousel {
		gap: 8px;
	}

	.ype-thumbnails-track {
		gap: 8px;
	}

	.ype-carousel-btn {
		width: 32px;
		height: 32px;
	}

	.ype-carousel-btn svg {
		width: 16px;
		height: 16px;
	}

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

	.ype-layout-list .ype-video-link {
		flex-direction: column;
	}

	.ype-layout-list .ype-thumbnail-wrap,
	.ype-layout-list .ype-thumbnail {
		width: 100%;
		height: auto;
	}
}

@media (max-width: 480px) {
	.ype-thumb-item {
		width: calc(100% - 0px);
	}

	.ype-layout-grid {
		grid-template-columns: 1fr !important;
	}
}
