/* Secure PDF Folder Showcase — frontend styles */

.spf-folder-heading {
	font-size: 22px;
	font-weight: 600;
	color: #202124;
	margin: 0 0 16px;
	text-align: center;
}

.spf-folder-grid {
	display: grid;
	grid-template-columns: repeat(var(--spf-columns, 4), 1fr);
	gap: 16px;
	margin: 1em 0;
}

@media (max-width: 768px) {
	.spf-folder-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.spf-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
	padding: 18px 10px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
	font-family: inherit;
}

.spf-card:hover {
	box-shadow: 0 4px 10px rgba(60, 64, 67, 0.2);
	transform: translateY(-2px);
}

.spf-card-title {
	font-size: 13px;
	font-weight: 500;
	color: #3c4043;
	word-break: break-word;
	line-height: 1.3;
}

/* --- New folder card design: icon on left, name + colored count badge stacked on right --- */
.spf-folder-card {
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	text-align: left;
	gap: 14px;
	padding: 16px 20px;
}

.spf-folder-icon-circle {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: linear-gradient(135deg, #eef2ff, #e0e7ff);
	display: flex;
	align-items: center;
	justify-content: center;
}

.spf-folder-icon-circle svg {
	width: 28px;
	height: 28px;
}

.spf-folder-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	min-width: 0;
}

.spf-folder-card .spf-card-title {
	font-size: 14px;
	font-weight: 600;
	color: #202124;
}

.spf-folder-count-badge {
	font-size: 12px;
	font-weight: 600;
	padding: 3px 12px;
	border-radius: 999px;
	background: #eef2ff;
	color: #4f46e5;
}

.spf-badge-blue   { background: #EEF2FF; color: #4F46E5; }
.spf-badge-green  { background: #ECFDF5; color: #059669; }
.spf-badge-orange { background: #FFF7ED; color: #EA580C; }
.spf-badge-purple { background: #F5F3FF; color: #7C3AED; }

/* --- Big Card folder design --- */
.spf-grid-big {
	gap: 22px;
}

.spf-folder-card-big {
	position: relative;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 30px 18px 22px;
	border-radius: 16px;
	gap: 10px;
	overflow: hidden;
	border: 1px solid #eef0f3;
}

.spf-folder-card-big.spf-badge-blue   { --spf-theme: #4F46E5; --spf-theme-tint: #EEF2FF; }
.spf-folder-card-big.spf-badge-green  { --spf-theme: #059669; --spf-theme-tint: #ECFDF5; }
.spf-folder-card-big.spf-badge-orange { --spf-theme: #EA580C; --spf-theme-tint: #FFF7ED; }
.spf-folder-card-big.spf-badge-purple { --spf-theme: #7C3AED; --spf-theme-tint: #F5F3FF; }

.spf-big-top-bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 5px;
	background: var(--spf-theme, #4F46E5);
}

.spf-big-icon-wrap {
	position: relative;
	width: 130px;
	height: 130px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 6px;
}

.spf-big-icon-circle {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--spf-theme-tint, #eef2ff);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--spf-theme, #4F46E5);
}

.spf-big-count-chip {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #fff;
	border-radius: 50%;
	width: 64px;
	height: 64px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

.spf-big-count-number {
	font-size: 19px;
	font-weight: 800;
	color: var(--spf-theme, #4F46E5);
	line-height: 1.1;
}

.spf-big-count-label {
	font-size: 9px;
	font-weight: 700;
	color: var(--spf-theme, #4F46E5);
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.spf-big-title {
	font-size: 19px;
	font-weight: 800;
	color: #1f2937;
	margin-top: 4px;
}

.spf-big-subtext {
	font-size: 14px;
	font-weight: 700;
	color: var(--spf-theme, #4F46E5);
}

.spf-big-view-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 2px solid var(--spf-theme, #4F46E5);
	color: var(--spf-theme, #4F46E5);
	border-radius: 999px;
	padding: 8px 20px;
	font-weight: 700;
	font-size: 14px;
	margin-top: 6px;
	transition: background 0.15s ease, color 0.15s ease;
}

.spf-folder-card-big:hover .spf-big-view-btn {
	background: var(--spf-theme, #4F46E5);
	color: #fff;
}

/* --- Featured (cover image) PDF card --- */
.spf-pdf-card-featured {
	padding: 0;
	overflow: hidden;
	text-align: left;
	align-items: stretch;
	gap: 0;
}

.spf-pdf-thumb-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 210 / 297;
	background: #f1f3f4;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.spf-pdf-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #fff;
	display: block;
}

.spf-pdf-thumb-fallback svg {
	width: 48px;
	height: 48px;
}

.spf-pdf-corner-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	background: #e2574c;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.5px;
	padding: 2px 7px;
	border-radius: 4px;
}

.spf-pdf-card-featured .spf-card-title {
	padding: 10px 12px 0;
	font-size: 13px;
	font-weight: 600;
	color: #202124;
}

.spf-pdf-meta {
	padding: 2px 12px 12px;
	font-size: 11px;
	color: #6b6b6b;
}

.spf-empty {
	grid-column: 1 / -1;
	color: #6b6b6b;
	font-style: italic;
}

.spf-explorer-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 6px;
}

.spf-back-btn {
	background: none;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	padding: 6px 14px;
	font-size: 13px;
	cursor: pointer;
	color: #3c4043;
}

.spf-back-btn:hover {
	background: #f1f3f4;
}

.spf-explorer-path {
	font-size: 13px;
	color: #6b6b6b;
	font-weight: 500;
}

.spf-error {
	padding: 14px 18px;
	background: #fdecea;
	border: 1px solid #f5c2c0;
	color: #a52019;
	border-radius: 8px;
	font-size: 14px;
}

/* Modal viewer */
.spf-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
}

.spf-modal-overlay[hidden] {
	display: none;
}

.spf-modal-box {
	width: var(--spf-modal-desktop-width, 900px);
	height: var(--spf-modal-desktop-height, 80vh);
	max-width: 96vw;
	max-height: 96vh;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
	.spf-modal-box {
		width: var(--spf-modal-mobile-width, 95vw);
		height: var(--spf-modal-mobile-height, 85vh);
	}
}

.spf-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px;
	background: #f8f9fa;
	border-bottom: 1px solid #eceff1;
	flex: 0 0 auto;
	flex-wrap: wrap;
}

.spf-modal-title {
	font-size: 14px;
	font-weight: 500;
	color: #3c4043;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1 1 auto;
	min-width: 60px;
}

.spf-modal-header .spf-page-controls {
	flex: 0 0 auto;
}

.spf-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #5f6368;
	padding: 0 6px;
}

.spf-modal-close:hover {
	color: #202124;
}

.spf-modal-body {
	flex: 1 1 auto;
	position: relative;
	min-height: 0;
	overflow: auto;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	background: #525659;
	padding: 16px;
	touch-action: pan-y;
}

.spf-modal-body .spf-pdf-canvas {
	max-width: 100%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	background: #fff;
}

.spf-modal-body .spf-viewer-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #fff;
	font-size: 14px;
}

.spf-page-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	white-space: nowrap;
}

.spf-page-controls button {
	background: #fff;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	padding: 5px 12px;
	cursor: pointer;
	font-size: 13px;
}

.spf-page-controls button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.spf-zoom-btn {
	padding: 5px 10px !important;
	font-weight: 700;
	line-height: 1;
}

.spf-modal-fullscreen {
	background: none;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	color: #5f6368;
	padding: 5px 9px;
	flex: 0 0 auto;
}

.spf-modal-fullscreen:hover {
	background: #f1f3f4;
	color: #202124;
}

.spf-modal-box.spf-is-fullscreen {
	width: 100vw !important;
	height: 100vh !important;
	max-width: 100vw;
	max-height: 100vh;
	border-radius: 0;
}

.spf-explorer-toolbar-bottom {
	justify-content: center;
	margin-top: 14px;
	margin-bottom: 0;
}

.spf-page-indicator {
	font-size: 13px;
	color: #5f6368;
	min-width: 90px;
	text-align: center;
}

body.spf-modal-open {
	overflow: hidden;
}
