:root {
	--yt-primary: #002366;
	--yt-accent: #00bcd4;
	--yt-white: #ffffff;
	--yt-bg-card: #f8f9fa;
	--yt-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--yt-radius: 12px;
}

/* Container */
.yt-gallery-container {
	max-width: 1200px;
	margin: 20px auto;
	padding: 10px;
	font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	background: #fff;
	border-radius: var(--yt-radius);
	box-shadow: var(--yt-shadow);
	overflow: hidden;
}

/* Header styled as image */
.yt-gallery-header {
	background: linear-gradient(90deg, #001f4c 0%, #003a8c 100%);
	color: #fff;
	padding: 15px 20px;
	border-radius: 8px 8px 0 0;
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	box-shadow: inset 0 -2px 10px rgba(0,0,0,0.1);
}

.yt-gallery-header-inner {
	display: flex;
	align-items: center;
	gap: 10px;
}

.yt-calendar-icon {
	font-size: 1.2rem;
	background: #fff3;
	padding: 5px;
	border-radius: 4px;
}

.yt-header-title {
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

/* Slider Section */
.yt-video-slider {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 10px 5px 12px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--yt-primary) transparent;
}

.yt-video-slider::-webkit-scrollbar {
	height: 6px;
}

.yt-video-slider::-webkit-scrollbar-thumb {
	background-color: #ddd;
	border-radius: 10px;
}

/* Video Card */
.yt-video-card {
	flex: 0 0 calc(18.18% - 10px); /* ~5.5 items on desktop */
	min-width: 180px;
	background: #fff;
	border-radius: 12px;
	border: 1px solid #ebebeb;
	box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* Subtle shadow */
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
	overflow: hidden;
	position: relative;
}

.yt-video-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 25px rgba(0,0,0,0.12); /* Slightly stronger on hover */
}

.yt-thumbnail-wrapper {
	position: relative;
	padding-top: 56.25%; /* 16:9 */
	overflow: hidden;
	background: #000;
}

.yt-thumbnail-wrapper img {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: translate(-50%, -50%);
	transition: scale 0.4s ease;
}

.yt-video-card:hover .yt-thumbnail-wrapper img {
	scale: 1.05;
}

.yt-play-button {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 50px;
	height: 50px;
	background: #002366; /* Dark Blue Default */
	color: #fff;
	border: 2px solid #ff0000; /* Red Border Default */
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	opacity: 0.9;
	transition: all 0.3s ease;
}

.yt-play-button svg {
	width: 22px;
	height: 22px;
}

.yt-video-card:hover .yt-play-button {
	background: #ff0000; /* Swap to Red */
	border-color: #002366; /* Swap to Dark Blue */
	transform: translate(-50%, -50%) scale(1.1);
}

.yt-video-info {
	padding: 12px;
}

.yt-video-title {
	font-size: 0.95rem;
	margin: 0;
	color: #333;
	font-weight: 600;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.4;
}

/* Modal Styling */
.yt-modal {
	display: none;
	position: fixed;
	z-index: 999999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.9);
	backdrop-filter: blur(5px);
}

.yt-modal-content {
	position: relative;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 90%;
	max-width: 900px;
	aspect-ratio: 16 / 9;
}

.yt-close {
	position: absolute;
	top: -45px;
	right: 0;
	color: #fff;
	font-size: 35px;
	font-weight: bold;
	cursor: pointer;
}

.yt-player-container {
	width: 100%;
	height: 100%;
}

.yt-player-container iframe {
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.yt-video-card {
		flex: 0 0 66%; /* Shows ~1.5 items (1 full + 0.5 of next) */
		min-width: 200px;
	}
	
	.yt-gallery-header {
		padding: 12px 15px;
	}
	
	.yt-header-title {
		font-size: 0.95rem;
	}
}

/* Fallback button in modal */
.yt-modal-footer {
	text-align: center;
	margin-top: 15px;
}

.yt-view-on-youtube {
	display: inline-block;
	background: #ff0000;
	color: #fff !important;
	padding: 10px 20px;
	border-radius: 25px;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 14px;
	transition: background 0.3s ease;
	box-shadow: 0 4px 10px rgba(255,0,0,0.3);
}

.yt-view-on-youtube:hover {
	background: #cc0000;
}

/* Progress bar (Visual feedback for scroll) */
.yt-slider-progress {
	height: 3px;
	background: #eee;
	width: 100px;
	margin: 0 auto;
	border-radius: 3px;
	overflow: hidden;
}

/* Spinner */
.yt-loading-spinner-container {
	padding: 50px;
	text-align: center;
	color: var(--yt-primary);
}

.yt-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid var(--yt-primary);
	border-radius: 50%;
	margin: 0 auto 15px;
	animation: yt-spin 1s linear infinite;
}

@keyframes yt-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}
