/**
 * Review Photos Frontend Styles
 *
 * @package MioAnimale
 */

/* Hidden by default (shown via JS) */
.mio-animale-hidden {
	display: none;
}

/* Upload Form */
.mio-animale-review-photos-upload {
	margin: 1em 0;
}

.mio-animale-upload-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5em;
}

.mio-animale-upload-optional {
	font-weight: 400;
	color: #666;
	font-size: 0.875em;
}

/* Dropzone */
.mio-animale-upload-dropzone {
	position: relative;
	border: 2px dashed #ddd;
	border-radius: 8px;
	padding: 2em;
	text-align: center;
	background: #fafafa;
	cursor: pointer;
	transition: all 0.2s ease;
}

.mio-animale-upload-dropzone:hover,
.mio-animale-upload-dropzone.dragover {
	border-color: #2271b1;
	background: #f0f6fc;
}

.mio-animale-dropzone-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5em;
}

.mio-animale-upload-icon {
	color: #999;
}

.mio-animale-upload-dropzone:hover .mio-animale-upload-icon,
.mio-animale-upload-dropzone.dragover .mio-animale-upload-icon {
	color: #2271b1;
}

.mio-animale-upload-text {
	font-size: 0.9375em;
	color: #333;
}

.mio-animale-upload-info {
	font-size: 0.8125em;
	color: #666;
}

.mio-animale-photo-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

/* Preview Grid */
.mio-animale-upload-preview {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 10px;
	margin-top: 1em;
}

.mio-animale-preview-item {
	position: relative;
	aspect-ratio: 1;
	border-radius: 8px;
	overflow: hidden;
	background: #f0f0f0;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.mio-animale-preview-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.mio-animale-preview-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mio-animale-preview-item.uploading {
	opacity: 0.6;
}

.mio-animale-preview-item.uploading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 24px;
	height: 24px;
	margin: -12px 0 0 -12px;
	border: 2px solid #fff;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: mio-animale-spin 0.8s linear infinite;
}

@keyframes mio-animale-spin {
	to {
		transform: rotate(360deg);
	}
}

.mio-animale-preview-remove {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.mio-animale-preview-remove:hover {
	background: rgba(220, 53, 69, 0.9);
}

/* Progress Bar */
.mio-animale-upload-progress {
	margin-top: 1em;
}

.mio-animale-progress-bar {
	height: 4px;
	background: #e0e0e0;
	border-radius: 2px;
	overflow: hidden;
}

.mio-animale-progress-fill {
	height: 100%;
	background: #2271b1;
	width: 0;
	transition: width 0.2s ease;
}

.mio-animale-progress-text {
	display: block;
	font-size: 0.8125em;
	color: #666;
	margin-top: 0.5em;
}

/* Error Message */
.mio-animale-upload-error {
	margin-top: 1em;
	padding: 0.75em 1em;
	background: #fef0f0;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	color: #721c24;
	font-size: 0.875em;
}

/* Photo Display in Reviews */
.mio-animale-review-photos {
	margin-top: 1em;
	padding-top: 1em;
	border-top: 1px solid #eee;
}

.mio-animale-photos-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
	gap: 8px;
	max-width: 400px;
}

.mio-animale-photo-item {
	aspect-ratio: 1;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mio-animale-photo-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.mio-animale-photo-link {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
}

.mio-animale-photo-thumbnail {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.mio-animale-photo-link:hover .mio-animale-photo-thumbnail {
	transform: scale(1.05);
}

.mio-animale-photo-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
	color: #fff;
}

.mio-animale-photo-link:hover .mio-animale-photo-overlay {
	opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
	.mio-animale-upload-dropzone {
		padding: 1.5em;
	}

	.mio-animale-photos-grid {
		grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
	}
}
