/**
 * Styles for Extravío Modal
 *
 * @package    Fgrweb_Plugin
 * @subpackage Fgrweb_Plugin/public/css
 */

/* Shortcode button */
.extravio-shortcode-wrapper {
	display: inline-block;
}

.extravio-ver-detalles-btn {
	background-color: transparent;
	border: none;
	text-decoration: underline;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.extravio-ver-detalles-btn:hover {
	text-decoration: none;
}

.extravio-ver-detalles-btn:focus {
	outline: none;
	outline-offset: 2px;
}

/* Modal overlay */
.modal {
	display: none;
}

.modal.is-open {
	display: block;
}

.modal__overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 9999;
}

.modal__container {
	background-color: #fff;
	padding: 30px;
	max-width: 800px;
	max-height: 90vh;
	border-radius: 8px;
	overflow-y: auto;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	position: relative;
	width: 90%;
}

/* Modal header */
header.modal__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	background-color: transparent!important;
}

.modal__title {
	margin: 0;
}

.modal__close {
	background: transparent;
	border: none;
	font-size: 28px;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #000;
	transition: color 0.3s ease;
}

.modal__close:hover {
	color: #000;
}

.modal__close::before {
	content: "×";
}

/* Modal content */
.modal__content {
	margin-top: 20px;
}

/* Extravío details grid */
.extravio-details-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 15px;
	margin-bottom: 20px;
}

.extravio-detail-item {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.extravio-detail-item.extravio-detail-full {
	grid-column: 1 / -1;
}

.extravio-detail-item strong {
	font-size: clamp(0.8125rem, 0.7292rem + 0.3704vw, 1.0625rem);
	font-weight: 600;
}

.extravio-detail-item span {
	color: #333;
	font-size: clamp(0.8125rem, 0.7292rem + 0.3704vw, 1rem);
}

/* Photo container */
.extravio-photo-container {
	margin-top: 30px;
	padding-top: 20px;
}

.extravio-photo-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 20px;
	color: #666;
}

.extravio-photo-loader .spinner {
	width: 20px;
	height: 20px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #0073aa;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.extravio-photo-container.loaded .extravio-photo-loader {
	display: none;
}

.extravio-photo-wrapper {
	text-align: center;
}

.extravio-photo-wrapper h3 {
	margin-bottom: 15px;
	color: #0073aa;
	font-size: 18px;
}

.extravio-photo-wrapper img {
	max-width: 100%;
	height: auto;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.extravio-no-photo {
	text-align: center;
	padding: 20px;
	color: #666;
	font-style: italic;
}

/* Animations */
@keyframes mmfadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes mmfadeOut {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

@keyframes mmslideIn {
	from {
		transform: translateY(15%);
	}
	to {
		transform: translateY(0);
	}
}

@keyframes mmslideOut {
	from {
		transform: translateY(0);
	}
	to {
		transform: translateY(-10%);
	}
}

.micromodal-slide {
	display: none;
}

.micromodal-slide.is-open {
	display: block;
}

.micromodal-slide[aria-hidden="false"] .modal__overlay {
	animation: mmfadeIn 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide[aria-hidden="false"] .modal__container {
	animation: mmslideIn 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__overlay {
	animation: mmfadeOut 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__container {
	animation: mmslideOut 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide .modal__container,
.micromodal-slide .modal__overlay {
	will-change: transform;
}

/* Responsive */
@media (max-width: 768px) {
	.modal__container {
		width: 95%;
		padding: 20px;
		max-height: 95vh;
	}

	.modal__title {
		font-size: 20px;
	}

	.extravio-details-grid {
		grid-template-columns: 1fr;
	}
}
