/**
 * Dynamic PDF Showcase - Frontend Stylesheet
 */

:root {
	--dps-primary: #2563eb;
	--dps-primary-hover: #1d4ed8;
	--dps-bg-card: #ffffff;
	--dps-border-color: #e2e8f0;
	--dps-text-title: #0f172a;
	--dps-text-desc: #475569;
	--dps-badge-bg: #eff6ff;
	--dps-badge-text: #1d4ed8;
	--dps-radius-card: 12px;
	--dps-shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
	--dps-shadow-hover: 0 12px 24px rgba(37, 99, 235, 0.12);
	--dps-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dps-pdf-container {
	width: 100%;
	box-sizing: border-box;
	font-family: inherit;
}

/* ==================== SEARCH BAR ==================== */
.dps-search-bar-wrapper {
	margin-bottom: 24px;
}

.dps-search-input-box {
	position: relative;
	max-width: 480px;
	width: 100%;
}

.dps-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	pointer-events: none;
}

.dps-search-input {
	width: 100%;
	padding: 12px 16px 12px 42px;
	font-size: 14px;
	line-height: 1.4;
	color: #1e293b;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	outline: none;
	transition: var(--dps-transition);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dps-search-input:focus {
	border-color: var(--dps-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==================== LAYOUT: GRID & LIST ==================== */
.dps-pdf-items-wrapper.dps-pdf-grid {
	display: grid;
	gap: 24px;
}

/* Desktop Grid Columns */
.dps-cols-desktop-1 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(1, 1fr); }
.dps-cols-desktop-2 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(2, 1fr); }
.dps-cols-desktop-3 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(3, 1fr); }
.dps-cols-desktop-4 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(4, 1fr); }
.dps-cols-desktop-6 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(6, 1fr); }

/* Responsive Grid Breakpoints */
@media (max-width: 991px) {
	.dps-cols-tablet-1 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(1, 1fr); }
	.dps-cols-tablet-2 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(2, 1fr); }
	.dps-cols-tablet-3 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(3, 1fr); }
	.dps-cols-tablet-4 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767px) {
	.dps-cols-mobile-1 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(1, 1fr); }
	.dps-cols-mobile-2 .dps-pdf-items-wrapper.dps-pdf-grid { grid-template-columns: repeat(2, 1fr); }
}

/* List Layout */
.dps-pdf-items-wrapper.dps-pdf-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.dps-pdf-items-wrapper.dps-pdf-list .dps-card {
	display: flex;
	flex-direction: row;
	align-items: center;
}

@media (max-width: 640px) {
	.dps-pdf-items-wrapper.dps-pdf-list .dps-card {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ==================== CARD COMPONENT ==================== */
.dps-card {
	position: relative;
	background: var(--dps-bg-card);
	border: 1px solid var(--dps-border-color);
	border-radius: var(--dps-radius-card);
	box-shadow: var(--dps-shadow-card);
	padding: 20px;
	transition: var(--dps-transition);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.dps-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--dps-shadow-hover);
	border-color: #cbd5e1;
}

/* Card Media / Thumbnail */
.dps-card-media {
	position: relative;
	width: 100%;
	min-height: 140px;
	background: #f8fafc;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
}

.dps-pdf-list .dps-card-media {
	width: 120px;
	min-width: 120px;
	height: 100px;
	min-height: 100px;
	margin-bottom: 0;
	margin-right: 20px;
}

.dps-cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dps-pdf-icon-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #dc2626;
}

.dps-file-tag {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-top: 4px;
	color: #ef4444;
}

.dps-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: var(--dps-badge-bg);
	color: var(--dps-badge-text);
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 20px;
	letter-spacing: 0.3px;
}

/* Card Content */
.dps-card-content {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.dps-card-title {
	font-size: 17px;
	font-weight: 600;
	color: var(--dps-text-title);
	margin: 0 0 8px 0;
	line-height: 1.35;
}

.dps-card-desc {
	font-size: 14px;
	color: var(--dps-text-desc);
	margin: 0 0 16px 0;
	line-height: 1.5;
	flex: 1;
}

/* Actions & Buttons */
.dps-card-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;
	flex-wrap: wrap;
}

.dps-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 6px;
	text-decoration: none;
	cursor: pointer;
	border: none;
	outline: none;
	transition: var(--dps-transition);
	line-height: 1;
}

.dps-btn-view {
	background: var(--dps-primary);
	color: #ffffff;
}

.dps-btn-view:hover {
	background: var(--dps-primary-hover);
	color: #ffffff;
}

.dps-btn-download {
	background: #f1f5f9;
	color: #0f172a;
	border: 1px solid #e2e8f0;
}

.dps-btn-download:hover {
	background: #e2e8f0;
	color: #0f172a;
}

/* ==================== LIGHTBOX MODAL ==================== */
.dps-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dps-modal.dps-modal-open {
	opacity: 1;
	visibility: visible;
}

.dps-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.75);
	backdrop-filter: blur(4px);
}

.dps-modal-container {
	position: relative;
	width: 90%;
	max-width: 960px;
	height: 85vh;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 2;
	transform: scale(0.95);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dps-modal.dps-modal-open .dps-modal-container {
	transform: scale(1);
}

.dps-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
}

.dps-modal-title {
	font-size: 16px;
	font-weight: 600;
	color: #0f172a;
	margin: 0;

	/* Truncate text */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 70%;
}

.dps-modal-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.dps-modal-external-link {
	color: #64748b;
	transition: color 0.2s;
	display: flex;
	align-items: center;
}

.dps-modal-external-link:hover {
	color: var(--dps-primary);
}

.dps-modal-close {
	background: transparent;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
	padding: 0 4px;
	transition: color 0.2s;
}

.dps-modal-close:hover {
	color: #0f172a;
}

.dps-modal-body {
	flex: 1;
	width: 100%;
	height: 100%;
	background: #525659;
}

.dps-pdf-iframe {
	width: 100%;
	height: 100%;
	border: none;
}
