/**
 * Cruzat Customs: Elementor Extension
 * PDF Modal & Image Zoom Widget Styles
 */

/* ============================================
   PDF MODAL WIDGET STYLES
   ============================================ */

/* PDF Modal Button */
.cc-pdf-button {
	display: inline-block;
	font-family: inherit;
	font-weight: 600;
	border: none;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.cc-pdf-button:hover {
	opacity: 0.9;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cc-pdf-button:active {
	transform: translateY(0);
}

.cc-pdf-button:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Button sizes */
.cc-pdf-button-small {
	font-size: 0.875rem;
}

.cc-pdf-button-medium {
	font-size: 1rem;
}

.cc-pdf-button-large {
	font-size: 1.125rem;
}

/* PDF Modal Dialog */
.cc-pdf-modal {
	/* Modern dialog styling */
	border: none;
	display: flex;
	flex-direction: column;
	max-width: 90vw;
	max-height: 90vh;
	margin: auto;
	padding: 0;
	
	/* Ensure modal is always on top */
	z-index: 9999;
	
	/* Smooth backdrop */
	animation: ccPdfModalFadeIn 0.3s ease-out;
}

/* Modal backdrop */
.cc-pdf-modal::backdrop {
	animation: ccPdfModalBackdropFadeIn 0.3s ease-out;
}

/* Transition animations */
@keyframes ccPdfModalFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes ccPdfModalBackdropFadeIn {
	from {
		background-color: rgba(0, 0, 0, 0);
	}
	to {
		background-color: rgba(0, 0, 0, 0.5);
	}
}

@keyframes ccPdfModalSlideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes ccPdfModalZoom {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes ccPdfModalScale {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Transition effect classes */
.cc-pdf-modal-wrapper[data-transition="fade"] .cc-pdf-modal {
	animation: ccPdfModalFadeIn 0.3s ease-out;
}

.cc-pdf-modal-wrapper[data-transition="slide-up"] .cc-pdf-modal {
	animation: ccPdfModalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cc-pdf-modal-wrapper[data-transition="zoom"] .cc-pdf-modal {
	animation: ccPdfModalZoom 0.3s ease-out;
}

.cc-pdf-modal-wrapper[data-transition="scale"] .cc-pdf-modal {
	animation: ccPdfModalScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Modal header */
.cc-pdf-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid #e0e0e0;
	flex-shrink: 0;
	gap: 20px;
}

.cc-pdf-modal-header h2 {
	margin: 0;
	padding: 0;
	font-size: 1.5rem;
	font-weight: 600;
	color: #333;
	flex: 1;
}

/* Close button */
.cc-pdf-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	background: transparent;
	color: #666;
	font-size: 28px;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.cc-pdf-modal-close:hover {
	background-color: #f5f5f5;
	color: #000;
}

.cc-pdf-modal-close:focus {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

/* Modal content area */
.cc-pdf-modal-content {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	overflow: auto;
	background: #fafafa;
}

/* PDF embed */
.cc-pdf-embed {
	width: 100%;
	height: 100%;
	border: none;
	background: white;
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
	.cc-pdf-modal {
		max-width: 95vw;
		max-height: 95vh;
		border-radius: 8px 8px 0 0;
		bottom: 0;
	}

	.cc-pdf-modal-header {
		padding: 16px 20px;
	}

	.cc-pdf-modal-header h2 {
		font-size: 1.25rem;
	}

	.cc-pdf-modal-content {
		padding: 16px;
	}

	.cc-pdf-modal-close {
		width: 36px;
		height: 36px;
		font-size: 24px;
	}
}

@media (max-width: 480px) {
	.cc-pdf-modal-header {
		flex-wrap: wrap;
		gap: 12px;
	}

	.cc-pdf-modal-header h2 {
		font-size: 1.1rem;
		flex: 1 1 100%;
	}

	.cc-pdf-modal-close {
		width: 32px;
		height: 32px;
		font-size: 20px;
	}
}

/* ============================================
   IMAGE ZOOM VIEWER WIDGET STYLES
   ============================================ */

/* Main wrapper */
.cc-image-zoom-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	box-sizing: border-box;
}

/* Image container */
.cc-image-zoom-container {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	overflow: hidden;
	box-sizing: border-box;
	
	/* Enable zooming with smooth transitions */
	touch-action: manipulation;
}

.cc-image-zoom-container.height-auto {
	height: auto;
}

.cc-image-zoom-container.height-fixed {
	overflow: auto;
}

/* Image element */
.cc-image-zoom {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	
	/* Smooth zoom transitions */
	transition: transform 0.1s ease-out;
	
	/* Prevent dragging */
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-webkit-user-drag: none;
}

/* Hover state */
.cc-image-zoom-container:hover .cc-image-zoom {
	/* Subtle scale on hover */
	transform: scale(1.01);
}

/* Focus state for accessibility */
.cc-image-zoom-container:focus {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.cc-image-zoom-container:focus:not(:focus-visible) {
	outline: none;
}

/* Caption styling */
.cc-image-zoom-caption {
	margin: 0;
	padding: 0;
	width: 100%;
	box-sizing: border-box;
	font-style: italic;
	color: #666;
	line-height: 1.4;
}

/* Zoom interactions indicator */
.cc-image-zoom-container[data-zoom-type="pinch-zoom"],
.cc-image-zoom-container[data-zoom-type="scroll-zoom"],
.cc-image-zoom-container[data-zoom-type="both"] {
	cursor: zoom-in;
}

.cc-image-zoom-container[data-zoom-type="none"] {
	cursor: default;
}

/* High DPI / Retina adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
	.cc-image-zoom {
		image-rendering: -webkit-optimize-contrast;
	}
}

/* Tablet and mobile responsive */
@media (max-width: 768px) {
	.cc-image-zoom-wrapper {
		gap: 12px;
	}

	.cc-image-zoom-container {
		/* Improve touch interaction */
		touch-action: pinch-zoom;
	}

	.cc-image-zoom-caption {
		font-size: 0.95rem;
	}
}

@media (max-width: 480px) {
	.cc-image-zoom-container {
		touch-action: pinch-zoom;
	}

	.cc-image-zoom-caption {
		font-size: 0.875rem;
	}
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.cc-pdf-button,
	.cc-pdf-modal,
	.cc-pdf-modal-close,
	.cc-image-zoom,
	.cc-image-zoom-container:hover .cc-image-zoom {
		animation: none !important;
		transition: none !important;
	}
}

/* Print styles */
@media print {
	.cc-pdf-button,
	.cc-pdf-modal-header,
	.cc-pdf-modal-close {
		display: none !important;
	}

	.cc-pdf-modal {
		position: static;
		width: 100%;
		height: auto;
		max-width: 100%;
		max-height: none;
	}

	.cc-image-zoom-wrapper {
		page-break-inside: avoid;
	}
}
