/* Custom Image Uploader Component - Generic Styles */

.custom-image-uploader {
	position: relative;
}

.custom-image-uploader .file-input-wrapper {
	position: relative;
	display: inline-block;
	width: 100%;
}

.custom-image-uploader .file-input-wrapper input[type="file"] {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	cursor: pointer;
	z-index: 2;
}

.custom-image-uploader .file-input-label {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	background-color: #f8f9fa;
	border: 2px dashed #dee2e6;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
	min-height: 45px;
	color: #495057;
	font-weight: 500;
}

.custom-image-uploader .file-input-label:hover {
	background-color: #e9ecef;
	border-color: #007bff;
	color: #007bff;
}

.custom-image-uploader .file-input-label i {
	margin-right: 8px;
	font-size: 1.1rem;
}

.custom-image-uploader .file-input-label .file-name {
	flex: 1;
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-left: 8px;
}

.custom-image-uploader .file-input-label .file-name.has-file {
	color: #28a745;
	font-weight: 600;
}

.custom-image-uploader .file-input-label .btn-remove {
	margin-left: 10px;
	padding: 4px 8px;
	background-color: #dc3545;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 0.875rem;
	cursor: pointer;
	transition: all 0.2s ease;
}

.custom-image-uploader .file-input-label .btn-remove:hover {
	background-color: #c82333;
	transform: scale(1.05);
}

/* Image Preview Styles */
.custom-image-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	border: 2px dashed #dee2e6;
	border-radius: 6px;
	padding: 20px;
	background-color: #f8f9fa;
	margin-top: 15px;
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	box-sizing: border-box;
	overflow: visible;
}

.custom-image-preview.empty {
	flex-direction: column;
	text-align: center;
}

.custom-image-preview.empty:hover {
	border-color: #007bff;
	background-color: #f0f8ff;
	box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
}

/* Drag and drop styles */
.custom-image-preview.drag-over {
	border-color: #007bff;
	background-color: #e7f3ff;
	box-shadow: 0 0 0 0.3rem rgba(0, 123, 255, 0.25);
	transform: scale(1.02);
}

.custom-image-preview.empty .empty-message {
	color: #6c757d;
	font-size: 0.95rem;
	pointer-events: none;
}

.custom-image-preview.empty .empty-sub-message {
	color: #adb5bd;
	font-size: 0.8rem;
	margin-top: 8px;
	pointer-events: none;
}

/* Wraps img + remove control; stays centered in .custom-image-preview */
.custom-image-preview-inner {
	position: relative;
	max-width: 100%;
	line-height: 0;
	overflow: visible;
}

.custom-image-preview img {
	display: block;
	max-width: 100%;
	max-height: 300px;
	width: auto;
	height: auto;
	margin-left: auto;
	margin-right: auto;
	object-fit: contain;
	border-radius: 6px;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	transition: transform 0.2s ease;
	cursor: pointer;
}

.custom-image-preview img:hover {
	transform: scale(1.02);
}

/* Center of button on image top-right corner; ~half sits outside the image */
.custom-image-preview .btn-remove-preview {
	position: absolute;
	top: 0;
	right: 0;
	transform: translate(50%, -50%);
	width: 32px;
	height: 32px;
	background: rgba(220, 53, 69, 0.9);
	border: 2px solid #fff;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
	z-index: 10;
}

.custom-image-preview .btn-remove-preview:hover {
	background: #dc3545;
	transform: translate(50%, -50%) scale(1.1);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.custom-image-preview .btn-remove-preview i {
	font-size: 0.875rem;
}

/* Image Preview Modal */
.image-preview-modal .modal-body img {
	max-width: 100%;
	max-height: 70vh;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
