/* ==========================================================================
   Hana Video Gallery — Styles
   Version: 1.0.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
	--hana-vg-columns: 3;
	--hana-vg-ratio: 56.25%;
	--hana-vg-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	--hana-vg-transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */
.hana-vg-wrapper {
	position: relative;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --------------------------------------------------------------------------
   Category Filters
   -------------------------------------------------------------------------- */
.hana-vg-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 32px;
	justify-content: center;
}

.hana-vg-filter-btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 22px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 50px;
	background: rgba(255, 255, 255, 0.05);
	color: rgba(255, 255, 255, 0.65);
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.03em;
	cursor: pointer;
	transition: all var(--hana-vg-transition-fast);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	text-transform: uppercase;
}

.hana-vg-filter-btn:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	border-color: rgba(255, 255, 255, 0.3);
}

.hana-vg-filter-btn.active {
	background: linear-gradient(135deg, rgba(200, 160, 110, 0.25) 0%, rgba(180, 130, 80, 0.35) 100%);
	color: #ffffff;
	border-color: rgba(200, 160, 110, 0.5);
	box-shadow: 0 0 20px rgba(200, 160, 110, 0.15);
}

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */
.hana-vg-grid {
	display: grid;
	grid-template-columns: repeat(var(--hana-vg-columns, 3), 1fr);
	gap: 24px;
}

/* --------------------------------------------------------------------------
   Card Item
   -------------------------------------------------------------------------- */
.hana-vg-item {
	position: relative;
	background-color: #1a1a2e;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	transition: transform var(--hana-vg-transition),
	            box-shadow var(--hana-vg-transition);
	will-change: transform;
}

.hana-vg-item:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
	            0 0 30px rgba(200, 160, 110, 0.08);
}

/* Filter animation */
.hana-vg-item.hana-vg-hidden {
	opacity: 0;
	transform: scale(0.85);
	pointer-events: none;
	position: absolute;
	visibility: hidden;
}

.hana-vg-item.hana-vg-visible {
	opacity: 1;
	transform: scale(1);
	transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --------------------------------------------------------------------------
   Thumbnail
   -------------------------------------------------------------------------- */
.hana-vg-thumbnail {
	position: relative;
	width: 100%;
	padding-top: var(--hana-vg-ratio, 56.25%);
	overflow: hidden;
	background: #0d0d1a;
}

.hana-vg-thumbnail img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hana-vg-item:hover .hana-vg-thumbnail img {
	transform: scale(1.08);
}

/* Placeholder */
.hana-vg-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */
.hana-vg-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--hana-vg-transition);
}

.hana-vg-item:hover .hana-vg-overlay {
	background: rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   Play Button
   -------------------------------------------------------------------------- */
.hana-vg-play-btn {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 2px solid rgba(255, 255, 255, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--hana-vg-transition);
	cursor: pointer;
	outline: none;
}

.hana-vg-play-btn svg {
	width: 40%;
	height: 40%;
	fill: #ffffff;
	margin-left: 3px; /* optical centering for play triangle */
	filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.3));
	transition: transform var(--hana-vg-transition-fast);
}

.hana-vg-item:hover .hana-vg-play-btn {
	background-color: rgba(255, 255, 255, 0.3);
	border-color: rgba(255, 255, 255, 0.45);
	transform: scale(1.12);
	box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.hana-vg-play-btn:focus-visible {
	outline: 2px solid rgba(200, 160, 110, 0.8);
	outline-offset: 4px;
}

/* Pulse animation */
.hana-vg-play-btn::before {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.2);
	opacity: 0;
	transition: opacity var(--hana-vg-transition);
}

.hana-vg-item:hover .hana-vg-play-btn::before {
	opacity: 1;
	animation: hana-vg-pulse 1.8s ease-out infinite;
}

@keyframes hana-vg-pulse {
	0% {
		transform: scale(1);
		opacity: 0.6;
	}
	100% {
		transform: scale(1.6);
		opacity: 0;
	}
}

/* --------------------------------------------------------------------------
   Info (Title + Subtitle)
   -------------------------------------------------------------------------- */
.hana-vg-info {
	padding: 14px 16px 18px;
}

.hana-vg-title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: #ffffff;
	letter-spacing: 0.01em;
	transition: color var(--hana-vg-transition-fast);
}

.hana-vg-item:hover .hana-vg-title {
	color: rgba(220, 185, 140, 1);
}

.hana-vg-subtitle {
	margin: 0;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.55);
	letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Popup / Lightbox
   -------------------------------------------------------------------------- */
.hana-vg-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.hana-vg-popup.active {
	opacity: 1;
	visibility: visible;
}

/* Backdrop */
.hana-vg-popup-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--popup-overlay-color, rgba(0, 0, 0, 0.85));
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

/* Inner */
.hana-vg-popup-inner {
	position: relative;
	width: 90%;
	max-width: 900px;
	z-index: 2;
}

/* Animation: Zoom */
.hana-vg-popup[data-animation="zoom"] .hana-vg-popup-inner {
	transform: scale(0.85);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hana-vg-popup.active[data-animation="zoom"] .hana-vg-popup-inner {
	transform: scale(1);
}

/* Animation: Fade */
.hana-vg-popup[data-animation="fade"] .hana-vg-popup-inner {
	opacity: 0;
	transition: opacity 0.35s ease;
}

.hana-vg-popup.active[data-animation="fade"] .hana-vg-popup-inner {
	opacity: 1;
}

/* Animation: Slide Up */
.hana-vg-popup[data-animation="slide-up"] .hana-vg-popup-inner {
	transform: translateY(60px);
	opacity: 0;
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.hana-vg-popup.active[data-animation="slide-up"] .hana-vg-popup-inner {
	transform: translateY(0);
	opacity: 1;
}

/* Close Button */
.hana-vg-popup-close {
	position: absolute;
	top: -48px;
	right: 0;
	width: 40px;
	height: 40px;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 50%;
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--hana-vg-transition-fast);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 3;
}

.hana-vg-popup-close svg {
	width: 18px;
	height: 18px;
}

.hana-vg-popup-close:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: rotate(90deg);
}

/* Video Container */
.hana-vg-popup-video {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.hana-vg-popup-video iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}

/* Popup Title */
.hana-vg-popup-title {
	margin: 16px 0 0;
	text-align: center;
	font-size: 18px;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: 0.01em;
	opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Body Lock (when popup is open)
   -------------------------------------------------------------------------- */
body.hana-vg-popup-open {
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.hana-vg-grid {
		--hana-vg-columns: 2;
	}
}

@media (max-width: 767px) {
	.hana-vg-grid {
		--hana-vg-columns: 1;
	}

	.hana-vg-filters {
		gap: 8px;
		margin-bottom: 24px;
	}

	.hana-vg-filter-btn {
		padding: 6px 16px;
		font-size: 12px;
	}

	.hana-vg-popup-inner {
		width: 95%;
	}

	.hana-vg-popup-close {
		top: -44px;
		width: 36px;
		height: 36px;
	}

	.hana-vg-popup-title {
		font-size: 15px;
	}

	.hana-vg-play-btn {
		width: 48px;
		height: 48px;
	}
}

/* --------------------------------------------------------------------------
   Accessibility: Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.hana-vg-item,
	.hana-vg-thumbnail img,
	.hana-vg-play-btn,
	.hana-vg-overlay,
	.hana-vg-popup,
	.hana-vg-popup-inner,
	.hana-vg-popup-close {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* --------------------------------------------------------------------------
   Loading state for thumbnails
   -------------------------------------------------------------------------- */
.hana-vg-thumbnail img {
	background: linear-gradient(
		110deg,
		#1a1a2e 8%,
		#22224a 18%,
		#1a1a2e 33%
	);
	background-size: 200% 100%;
	animation: hana-vg-shimmer 1.5s linear infinite;
}

.hana-vg-thumbnail img.loaded {
	animation: none;
	background: none;
}

@keyframes hana-vg-shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}
