.custom-modal {
	display: none;
	/* Sembunyikan secara default */
	position: fixed;
	z-index: 1050;
	/* Z-index tinggi untuk menghindari konflik */
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow-y: auto;
	/* Memungkinkan scroll jika kontennya panjang */
	background-color: rgba(0, 0, 0, 0.6);
	/* Transparan hitam */
}

/* Isi dari Modal */
.custom-modal-content {
	background-color: #fff;
	margin: 50px auto;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	width: 90%;
	max-width: 900px;
	position: relative;
}

/* Tombol Close */
.custom-close {
	color: #aaa;
	float: right;
	font-size: 28px;
	font-weight: bold;
	position: absolute;
	top: 10px;
	right: 20px;
	cursor: pointer;
}

.custom-close:hover,
.custom-close:focus {
	color: #000;
	text-decoration: none;
}

/* Layout Flexbox untuk konten utama */
.media-row {
	display: flex;
	flex-direction: row;
	/* Default: susunan horizontal */
	flex-wrap: wrap;
	/* Izinkan wrap ke baris baru */
	gap: 20px;
	justify-content: center;
	align-items: flex-start;
	margin-top: 20px;
}

.media-item {
	flex: 1 1 300px;
	/* Flexbox item akan tumbuh/menyusut dan memiliki basis 300px */
	text-align: center;
	min-width: 250px;
}

/* Gambar dan Canvas akan responsif di dalam Flexbox item */
.media-item img,
.media-item canvas,
.media-item #container video {
	max-width: 100%;
	height: auto;
	border: 1px solid #ddd;
	border-radius: 4px;
}

/* Responsif untuk layar mobile (maksimal 768px) */
@media screen and (max-width: 768px) {
	.custom-modal-content {
		margin: 0;
		width: 100%;
		height: 100%;
		max-width: none;
		border-radius: 0;
		overflow-y: auto;
	}

	.custom-modal {
		background-color: #fff;
	}

	.media-row {
		flex-direction: column;
		/* Ubah ke susunan vertikal */
		align-items: center;
	}
}

.webcam-preview {
	max-width: 100%;
	height: auto;
	margin-top: 20px;
	border: 2px solid #0d6efd;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.responsive-video {
	width: 100%;
	height: auto;
}