/**
 * Clanto AntiCopia – PDF Viewer Styles
 * Modern, clean design with enhanced visibility
 *
 * @package ClantoAntiCopia
 */

/* ------------------------------------------------------------------ */
/* Inline Viewer (shortcode)                                            */
/* ------------------------------------------------------------------ */
.clantoacp-pdf-viewer {
	position: relative;
	border: 2px solid #d0d0d0;
	border-radius: 8px;
	overflow: hidden;
	background: #f8f9fa;
	margin: 24px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.clantoacp-pdf-viewer:fullscreen {
	border-radius: 0;
	margin: 0;
	width: 100vw;
	height: 100vh;
	display: flex;
	flex-direction: column;
}

.clantoacp-pdf-viewer:fullscreen .clantoacp-canvas-wrap {
	flex: 1;
	min-height: auto;
	height: 100%;
}

.clantoacp-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: linear-gradient(135deg, #2c3338 0%, #1d2327 100%);
	color: #fff;
	flex-wrap: wrap;
	border-bottom: 2px solid #2271b1;
}

.clantoacp-btn {
	background: rgba(255,255,255,0.15);
	color: #fff;
	border: 1px solid rgba(255,255,255,0.3);
	border-radius: 6px;
	padding: 8px 14px;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 600;
	transition: all 0.2s ease;
}

.clantoacp-btn:hover:not(:disabled) {
	background: rgba(255,255,255,0.3);
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.clantoacp-btn:active:not(:disabled) {
	transform: translateY(0);
}

.clantoacp-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.clantoacp-page-info {
	font-size: 0.9rem;
	color: #e0e0e0;
	margin: 0 auto;
	font-weight: 600;
}

.clantoacp-page-info .cur-page {
	color: #2271b1;
	background: #ffffff;
	padding: 2px 8px;
	border-radius: 4px;
	font-weight: 700;
}

.clantoacp-zoom-in,
.clantoacp-zoom-out {
	font-size: 1.2rem;
	padding: 6px 12px;
	font-weight: 700;
}

.clantoacp-canvas-wrap {
	background: #3c4349;
	overflow: auto;
	position: relative;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
}

.clantoacp-canvas-wrap canvas {
	display: block;
	margin: 16px auto;
	box-shadow: 0 6px 20px rgba(0,0,0,0.5);
	border-radius: 4px;
}

.clantoacp-spinner {
	text-align: center;
	padding: 48px;
	color: #646970;
	font-size: 1rem;
	font-weight: 600;
}

.clantoacp-spinner::after {
	content: "";
	display: block;
	width: 36px;
	height: 36px;
	margin: 16px auto 0;
	border: 4px solid #e0e0e0;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

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

/* ------------------------------------------------------------------ */
/* Modal Viewer                                                          */
/* ------------------------------------------------------------------ */
#clantoacp-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483646;
	animation: fadeIn 0.2s ease;
}

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

.clantoacp-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	backdrop-filter: blur(4px);
}

.clantoacp-modal-box {
	background: #1d2327;
	border-radius: 12px;
	width: 100%;
	max-width: 920px;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
	border: 2px solid #2271b1;
	animation: slideUp 0.3s ease;
}

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

.clantoacp-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: linear-gradient(135deg, #2c3338 0%, #1d2327 100%);
	border-bottom: 2px solid #2271b1;
	flex-shrink: 0;
}

.clantoacp-modal-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: #ffffff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 80%;
}

.clantoacp-modal-close {
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.3);
	color: #ffffff;
	border-radius: 6px;
	width: 36px;
	height: 36px;
	font-size: 1.5rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	flex-shrink: 0;
	transition: all 0.2s ease;
	font-weight: 700;
}

.clantoacp-modal-close:hover {
	background: rgba(255,255,255,0.3);
	transform: rotate(90deg);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.clantoacp-pdf-viewer-inner {
	flex: 1;
	overflow: auto;
	background: #3c4349;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
}

.clantoacp-pdf-viewer-inner canvas {
	display: block;
	margin: 16px auto;
	box-shadow: 0 6px 20px rgba(0,0,0,0.5);
	border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* Prevent right-click context menu visual feedback on canvases        */
/* ------------------------------------------------------------------ */
.clantoacp-canvas-wrap canvas,
.clantoacp-pdf-viewer-inner canvas {
	pointer-events: auto;
}

/* ------------------------------------------------------------------ */
/* PDF Trigger Links                                                    */
/* ------------------------------------------------------------------ */
.clantoacp-pdf-trigger {
	cursor: pointer;
	color: #2271b1;
	text-decoration: underline;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.clantoacp-pdf-trigger:hover {
	color: #1a5a8a;
	text-decoration: none;
}

.clantoacp-pdf-trigger::after {
	content: "📄";
	font-size: 0.9em;
	opacity: 0.7;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */
@media ( max-width: 768px ) {
	.clantoacp-toolbar {
		padding: 10px 12px;
		gap: 8px;
	}
	
	.clantoacp-btn {
		padding: 6px 10px;
		font-size: 0.85rem;
	}
	
	.clantoacp-page-info {
		font-size: 0.85rem;
	}
	
	.clantoacp-modal-box {
		max-width: 100%;
		border-radius: 0;
		max-height: 100vh;
		border-left: none;
		border-right: none;
	}

	.clantoacp-modal-overlay {
		padding: 0;
		align-items: flex-end;
	}
	
	.clantoacp-modal-header {
		padding: 12px 16px;
	}
	
	.clantoacp-modal-title {
		font-size: 0.95rem;
	}
}
