/**
 * Frontend Gallery Stylesheet.
 *
 * @package Emmad_Video_Gallery
 */

/* ==========================================
   VIDEO GALLERY
========================================== */

.vg-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: left;
	gap: 12px;
	margin-bottom: 40px;
}

.vg-filters button {
	background: none;
	border: none;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 2px;
	padding: 0 5px;
	color: #777;
	position: relative;
	cursor: pointer;
}

.vg-filters button.active {
	color: white;
}

.vg-filters button.active::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -8px;
	width: 100%;
	height: 1px;
	background: grey;
}


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

.vg-gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 25px;
}

.vg-gallery.columns-1 {
	grid-template-columns: 1fr;
}

.vg-gallery.columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.vg-gallery.columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.vg-gallery.columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.vg-gallery.columns-5 {
	grid-template-columns: repeat(5, 1fr);
}

.vg-gallery.columns-6 {
	grid-template-columns: repeat(6, 1fr);
}


/* ==========================================
   GALLERY ITEMS
========================================== */

.vg-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	background: #000;
}

.vg-item img {
	display: block;
	width: 100%;
	aspect-ratio: 16/9;
	object-fit: cover;
	transition: .5s;
}

.vg-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .35);
	display: flex;
	justify-content: center;
	align-items: center;
	opacity: 0;
	transition: .35s;
}

.vg-item:hover .vg-overlay {
	opacity: 1;
}

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

.vg-play {
	width: 74px;
	height: 74px;
	border-radius: 50%;
	border: 2px solid #fff;
	color: #fff;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 30px;
	transition: .3s;
	backdrop-filter: blur(4px);
}

.vg-item:hover .vg-play {
	transform: scale(1.12);
}

.vg-video {
	display: block;
	text-decoration: none;
	color: inherit;
}


/* ==========================================
   PLAYER
========================================== */

#vg-player {
	position: fixed;
	inset: 0;
	background: #000;
	display: none;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	opacity: 0;
	transition: .3s;
	z-index: 999999;
}

#vg-player.active {
	opacity: 1;
}

#vg-video-player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
}

#vg-iframe-player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	background: #000;
	display: none;
}

/* ==========================================
   HEADER
========================================== */

.vg-player-header {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	box-sizing: border-box !important;
	padding: 24px 36px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 16px !important;
	z-index: 100 !important;
	pointer-events: none !important;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%) !important;
}

.vg-header-left {
	flex: 1 1 0 !important;
	min-width: 60px !important;
}

.vg-header-center {
	flex: 0 0 auto !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	max-width: 60% !important;
}

.vg-header-right {
	flex: 1 1 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: flex-end !important;
	min-width: 60px !important;
}

.vg-player-logo {
	display: block !important;
	max-height: 48px !important;
	max-width: 220px !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain !important;
	margin: 0 auto !important;
	pointer-events: auto !important;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5)) !important;
}

#vg-player .vg-close,
.vg-player-header .vg-close {
	position: relative !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	background: rgba(0, 0, 0, 0.45) !important;
	backdrop-filter: blur(8px) !important;
	-webkit-backdrop-filter: blur(8px) !important;
	border: 1px solid rgba(255, 255, 255, 0.3) !important;
	border-radius: 6px !important;
	color: #ffffff !important;
	cursor: pointer !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	letter-spacing: 1.5px !important;
	text-transform: uppercase !important;
	padding: 8px 14px !important;
	margin: 0 !important;
	line-height: 1 !important;
	min-height: 0 !important;
	height: auto !important;
	width: auto !important;
	box-shadow: none !important;
	outline: none !important;
	text-shadow: none !important;
	transition: all 0.2s ease !important;
	pointer-events: auto !important;
	z-index: 100 !important;
}

#vg-player .vg-close svg,
.vg-player-header .vg-close svg {
	width: 13px !important;
	height: 13px !important;
	stroke: currentColor !important;
	fill: none !important;
	display: inline-block !important;
	vertical-align: middle !important;
	flex-shrink: 0 !important;
	margin: 0 !important;
}

#vg-player .vg-close:hover,
#vg-player .vg-close:focus,
.vg-player-header .vg-close:hover,
.vg-player-header .vg-close:focus {
	background: #ffffff !important;
	color: #000000 !important;
	border-color: #ffffff !important;
	transform: scale(1.04) !important;
}

/* ==========================================
   CONTROLS
========================================== */

.vg-controls {
	position: absolute;
	left: 40px;
	right: 40px;
	bottom: 35px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	color: #fff;
	z-index: 60;
}

.vg-left {
	font-size: 14px;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.vg-center {
	display: flex;
	align-items: center;
	gap: 15px;
}

.vg-right {
	text-align: right;
	font-size: 18px;
}

#vg-play,
#vg-mute {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}


/* ==========================================
   CUSTOM PROGRESS BAR
========================================== */

#vg-progress {
	position: relative;
	width: 420px;
	height: 14px;
	cursor: pointer;
}

#vg-progress-track {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	height: 2px;
	background: rgba(255, 255, 255, .30);
	border-radius: 999px;
}

#vg-progress-fill {
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 0%;
	height: 2px;
	background: #fff;
	border-radius: 999px;
}

#vg-progress-thumb {
	position: absolute;
	left: 0%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 12px;
	height: 12px;
	background: #fff;
	border-radius: 50%;
}


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

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

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

	.vg-play {
		width: 60px;
		height: 60px;
		font-size: 24px;
	}

	.vg-filters {
		gap: 6px;
	}

	.vg-filters button {
		font-size: 13px;
	}


	.vg-controls {
		left: 20px;
		right: 20px;
		bottom: 20px;
		grid-template-columns: 1fr;
		gap: 15px;
		text-align: center;
	}

	.vg-left,
	.vg-center,
	.vg-right {
		justify-content: center;
		text-align: center;
	}

	#vg-progress {
		width: 220px;
	}
}


/* ==========================================
   MOBILE PLAYER
========================================== */

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

	.vg-play {
		width: 60px;
		height: 60px;
		font-size: 24px;
	}

	.vg-filters {
		gap: 6px;
	}

	.vg-filters button {
		font-size: 13px;
	}

	/* PLAYER HEADER */
	.vg-player-header {
		padding: 16px 20px !important;
	}

	.vg-header-left {
		display: none !important;
	}

	.vg-header-center {
		justify-content: flex-start !important;
		max-width: 65% !important;
	}

	.vg-player-logo {
		max-height: 36px !important;
		max-width: 140px !important;
		margin: 0 !important;
	}

	#vg-player .vg-close,
	.vg-player-header .vg-close {
		padding: 6px 11px !important;
		font-size: 10px !important;
		letter-spacing: 1px !important;
	}

	/* VIDEO */
	#vg-video-player {
		object-fit: cover;
	}

	/* CONTROLS */
	.vg-controls {
		left: 20px;
		right: 20px;
		bottom: 22px;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.vg-left,
	.vg-right {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 13px;
	}

	.vg-right {
		order: 2;
		text-align: right;
	}

	.vg-left {
		order: 1;
	}

	.vg-center {
		order: 3;
		display: grid;
		grid-template-columns: auto auto 1fr auto auto;
		align-items: center;
		gap: 12px;
		width: 100%;
	}

	#vg-current,
	#vg-duration {
		font-size: 14px;
		white-space: nowrap;
	}

	#vg-progress {
		width: 100%;
	}

	#vg-play svg,
	#vg-mute svg {
		width: 18px;
		height: 18px;
	}
}

@media (max-width: 767px) {
	.vg-gallery,
	.vg-gallery.columns-2,
	.vg-gallery.columns-3,
	.vg-gallery.columns-4,
	.vg-gallery.columns-5,
	.vg-gallery.columns-6 {
		grid-template-columns: 1fr !important;
	}
}
