/**
 * Variations Gallery Module - Admin Styles
 *
 * @package OM_Product_Page_Essentials
 */

/* Gallery wrapper */
.om-ppe-variation-gallery {
	padding: 10px 0;
	border-top: 1px solid #eee;
	margin-top: 10px;
}

.om-ppe-variation-gallery > p:first-child {
	margin-bottom: 10px;
}

/* Sortable gallery list */
.om-ppe-variation-gallery-sortable {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	margin: 0 0 10px;
	padding: 0;
	min-height: 70px;
}

.om-ppe-variation-gallery-sortable li {
	position: relative;
	width: 60px;
	height: 60px;
	background: #f7f7f7;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: move;
}

.om-ppe-variation-gallery-sortable li figure {
	width: 100%;
	height: 100%;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.om-ppe-variation-gallery-sortable li figure img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* Remove button */
.om-ppe-remove-item {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 20px;
	height: 20px;
	background: #b32d2e;
	color: #fff;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	line-height: 1;
	opacity: 0;
	transition: opacity 0.2s;
	z-index: 10;
}

.om-ppe-variation-gallery-sortable li:hover .om-ppe-remove-item {
	opacity: 1;
}

.om-ppe-remove-item:hover {
	background: #8b0000;
}

/* Video thumbnail indicator */
.om-ppe-video-thumbnail figure::after,
.om-ppe-video-url-thumbnail figure::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 24px;
	height: 24px;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 50%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 14px;
	pointer-events: none;
}

/* Edit overlay for video URLs */
.om-ppe-video-url-thumbnail figure::before {
	content: attr(data-edit-text);
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	font-size: 10px;
	text-align: center;
	padding: 2px;
	opacity: 0;
	transition: opacity 0.2s;
	cursor: pointer;
}

.om-ppe-video-url-thumbnail:hover figure::before {
	opacity: 1;
}

/* Sortable placeholder */
.om-ppe-variation-gallery-sortable .ui-sortable-placeholder {
	visibility: visible !important;
	background: #e0e0e0;
	border: 2px dashed #999;
}

/* Buttons container */
.om-ppe-variation-gallery > p:last-child span {
	display: flex;
	gap: 10px;
}

/* Video URL Popup */
.om-ppe-video-url-popup {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	z-index: 100050;
	display: flex;
	align-items: center;
	justify-content: center;
}

.om-ppe-video-url-popup-inner {
	width: 90%;
	max-width: 500px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

.om-ppe-video-url-popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 15px 20px;
	background: #f0f0f1;
	border-bottom: 1px solid #ddd;
}

.om-ppe-video-url-popup-header h3 {
	margin: 0;
	font-size: 16px;
}

.om-ppe-video-url-popup-close {
	text-decoration: none;
	color: #666;
	font-size: 20px;
}

.om-ppe-video-url-popup-close:hover {
	color: #000;
}

.om-ppe-video-url-popup-content {
	padding: 20px;
}

.om-ppe-video-url-popup-field {
	margin-bottom: 15px;
}

.om-ppe-video-url-popup-field:last-child {
	margin-bottom: 0;
}

.om-ppe-video-url-popup-field label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
}

.om-ppe-video-url-popup-field input[type="text"],
.om-ppe-video-url-popup-field select {
	width: 100%;
}

.om-ppe-video-url-popup-field .description {
	display: block;
	margin-top: 5px;
	color: #666;
	font-size: 12px;
}

.om-ppe-video-url-popup-footer {
	padding: 15px 20px;
	background: #f0f0f1;
	border-top: 1px solid #ddd;
	text-align: right;
}
