/* Template Library Pro */
#tlp-library-root {
	--tlp-ink: #111827;
	--tlp-muted: #667085;
	--tlp-subtle: #eef2f7;
	--tlp-panel: #ffffff;
	--tlp-line: #d9e2ef;
	--tlp-blue: #2563eb;
	--tlp-blue-dark: #1d4ed8;
	--tlp-teal: #0f766e;
	--tlp-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);

	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 22px;
	background: #f6f8fb;
	color: var(--tlp-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
	line-height: 1.5;
	text-align: left;
	box-sizing: border-box;
	position: relative;
	padding: 26px;
	border: 1px solid var(--tlp-line);
	border-radius: 8px;
	overflow: hidden;
}

#tlp-library-root * {
	box-sizing: border-box !important;
	letter-spacing: 0;
}

#tlp-library-root button,
#tlp-library-root input {
	font: inherit;
}

#tlp-library-root .tlp-library-hero {
	min-height: 260px;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 28px;
	padding: 34px;
	position: relative;
	overflow: hidden;
	background:
		linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 118, 110, 0.12)),
		linear-gradient(180deg, #ffffff, #f7fbff);
	border: 1px solid #dbe7f6;
	border-radius: 8px;
	box-shadow: var(--tlp-shadow);
}

#tlp-library-root .tlp-library-hero::before {
	content: "";
	position: absolute;
	inset: 18px 18px auto auto;
	width: 300px;
	height: 160px;
	background:
		linear-gradient(90deg, rgba(255,255,255,0.7) 1px, transparent 1px),
		linear-gradient(180deg, rgba(255,255,255,0.7) 1px, transparent 1px);
	background-size: 24px 24px;
	opacity: 0.6;
	pointer-events: none;
}

#tlp-library-root .tlp-hero-copy,
#tlp-library-root .tlp-hero-panel {
	position: relative;
	z-index: 1;
}

#tlp-library-root .tlp-kicker,
#tlp-library-root .tlp-section-label {
	display: block;
	color: var(--tlp-blue);
	font-size: 11px;
	font-weight: 900;
	text-transform: uppercase;
}

#tlp-library-root .tlp-hero-copy h1 {
	max-width: 780px;
	margin: 9px 0 0;
	color: var(--tlp-ink);
	font-size: clamp(34px, 5vw, 58px);
	line-height: 1.02;
	font-weight: 950;
}

#tlp-library-root .tlp-hero-copy p {
	max-width: 660px;
	margin: 16px 0 0;
	color: #475467;
	font-size: 16px;
}

#tlp-library-root .tlp-hero-panel {
	width: 190px;
	flex: 0 0 auto;
	padding: 22px;
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(185, 204, 235, 0.9);
	border-radius: 8px;
	box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11);
}

#tlp-library-root .tlp-hero-panel strong {
	display: block;
	color: var(--tlp-blue);
	font-size: 44px;
	line-height: 1;
	font-weight: 950;
}

#tlp-library-root .tlp-hero-panel span {
	display: block;
	margin-top: 8px;
	color: var(--tlp-muted);
	font-size: 12px;
	font-weight: 900;
	text-transform: uppercase;
}

.tlp-mobile-header {
	display: none;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--tlp-panel);
	border: 1px solid var(--tlp-line);
	border-radius: 8px;
}

.tlp-mobile-title {
	font-size: 15px;
	font-weight: 900;
}

.tlp-btn-icon {
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f8fafc;
	border: 1px solid var(--tlp-line);
	border-radius: 8px;
	color: var(--tlp-ink);
	cursor: pointer;
	font-size: 18px;
}

#tlp-library-root .tlp-sidebar {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 18px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid var(--tlp-line);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

#tlp-library-root .tlp-filter-primary {
	display: grid;
	grid-template-columns: minmax(260px, 1fr) auto;
	align-items: end;
	gap: 14px;
}

#tlp-library-root .tlp-sidebar-section {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

#tlp-library-root .tlp-search-box {
	position: relative;
	width: 100%;
}

#tlp-library-root #tl-search {
	width: 100%;
	min-height: 50px;
	padding: 12px 14px 12px 44px;
	border: 1px solid var(--tlp-line);
	border-radius: 8px;
	background: #fff;
	color: var(--tlp-ink);
	font-size: 15px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#tlp-library-root #tl-search:focus {
	border-color: var(--tlp-blue);
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

#tlp-library-root .tlp-search-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: #8a98aa;
	font-size: 14px;
}

#tlp-library-root .tlp-btn-clear {
	min-height: 50px;
	padding: 12px 18px;
	background: #eef2f7;
	color: #7b8798;
	border: 1px solid var(--tlp-line);
	border-radius: 8px;
	cursor: not-allowed;
	font-size: 13px;
	font-weight: 900;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

#tlp-library-root .tlp-btn-clear.enabled {
	background: var(--tlp-ink);
	color: #fff;
	cursor: pointer;
}

#tlp-library-root .tlp-btn-clear.enabled:hover {
	transform: translateY(-1px);
}

#tlp-library-root .tlp-filter-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

#tlp-library-root .tlp-filter-heading strong {
	color: var(--tlp-muted);
	font-size: 12px;
	font-weight: 900;
}

#tlp-library-root .tlp-category-list {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
}

#tlp-library-root .tlp-category-item {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 38px;
	padding: 8px 11px;
	border: 1px solid var(--tlp-line);
	border-radius: 8px;
	background: #fff;
	color: #40516a;
	cursor: pointer;
	font-size: 13px;
	font-weight: 800;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

#tlp-library-root .tlp-category-item:hover {
	transform: translateY(-1px);
	border-color: #b9cceb;
	box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

#tlp-library-root .tlp-category-item.active {
	background: #eef5ff;
	border-color: #9fbdf5;
	color: #143b85;
	box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

#tlp-library-root .tlp-category-item input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

#tlp-library-root .tlp-cat-name {
	min-width: 0;
	overflow-wrap: anywhere;
}

#tlp-library-root .tlp-cat-count {
	min-width: 24px;
	padding: 2px 7px;
	background: #f1f5f9;
	border-radius: 999px;
	color: #64748b;
	font-size: 11px;
	text-align: center;
}

#tlp-library-root .tlp-category-item.active .tlp-cat-count {
	background: #dbeafe;
	color: #1d4ed8;
}

#tlp-library-root .tlp-main-content {
	min-width: 0;
	position: relative;
}

#tlp-library-root .tlp-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	gap: 22px;
	transition: opacity 0.18s ease;
}

#tlp-library-root .tlp-item {
	background: var(--tlp-panel);
	border: 1px solid var(--tlp-line);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#tlp-library-root .tlp-item:hover {
	transform: translateY(-5px);
	border-color: #a9bfdf;
	box-shadow: 0 22px 42px rgba(15, 23, 42, 0.14);
}

#tlp-library-root .tlp-item-inner {
	height: 100%;
	display: flex;
	flex-direction: column;
}

#tlp-library-root .tlp-thumbnail-preview {
	height: 246px;
	background: #e9eef5;
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--tlp-line);
	display: flex;
	flex-direction: column;
}

#tlp-library-root .tlp-featured-thumb {
	flex: 1 1 auto;
	min-height: 0;
	background: #f1f5f9;
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

#tlp-library-root .tlp-featured-thumb .tlp-featured-img {
	width: 100%;
	height: 246px;
	display: block;
	transition: transform 0.28s ease;
}

#tlp-library-root .tlp-item:hover .tlp-featured-img {
	transform: scale(1.035);
}

#tlp-library-root .tlp-image-badge {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 6;
	max-width: calc(100% - 28px);
	padding: 6px 9px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(217, 226, 239, 0.95);
	border-radius: 8px;
	color: var(--tlp-teal);
	font-size: 11px;
	font-weight: 950;
	text-transform: uppercase;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

#tlp-library-root .tlp-iframe-wrapper {
	width: 100%;
	height: 100%;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	background: #fff;
}

#tlp-library-root .tlp-iframe-wrapper iframe {
	width: 1280px;
	height: 820px;
	border: none;
	transform: scale(0.3);
	transform-origin: 0 0;
	pointer-events: none;
}

#tlp-library-root .tlp-iframe-overlay {
	position: absolute;
	inset: 0;
	z-index: 5;
	cursor: pointer;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 14px;
	background: linear-gradient(to bottom, rgba(17, 24, 39, 0), rgba(17, 24, 39, 0.32));
	opacity: 0;
	transition: opacity 0.18s ease;
}

#tlp-library-root .tlp-item:hover .tlp-iframe-overlay,
#tlp-library-root .tlp-iframe-overlay:focus-visible {
	opacity: 1;
}

#tlp-library-root .tlp-iframe-overlay span {
	padding: 8px 10px;
	background: #fff;
	border-radius: 8px;
	color: var(--tlp-ink);
	font-size: 12px;
	font-weight: 900;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

#tlp-library-root .tlp-no-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--tlp-muted);
	font-size: 13px;
	font-weight: 900;
}

#tlp-library-root .tlp-item-footer {
	flex: 1 1 auto;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

#tlp-library-root .tlp-item-info {
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-width: 0;
}

#tlp-library-root .tlp-card-category {
	color: var(--tlp-teal);
	font-size: 11px;
	font-weight: 950;
	text-transform: uppercase;
}

#tlp-library-root .tlp-title {
	margin: 0;
	min-width: 0;
	color: var(--tlp-ink);
	font-size: 18px;
	font-weight: 950;
	line-height: 1.24;
	overflow-wrap: anywhere;
}

#tlp-library-root .tlp-item-actions {
	margin-top: auto;
}

#tlp-library-root .tlp-btn-preview {
	width: 100%;
	min-height: 44px;
	padding: 10px 13px;
	background: var(--tlp-ink);
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 950;
	transition: background 0.15s ease, transform 0.15s ease;
}

#tlp-library-root .tlp-btn-preview:hover {
	background: var(--tlp-blue);
	transform: translateY(-1px);
}

#tlp-library-root .tlp-no-results {
	grid-column: 1 / -1;
	padding: 44px;
	background: #fff;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	color: var(--tlp-muted);
	text-align: center;
	font-weight: 900;
}

#tlp-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999999 !important;
	background: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

#tlp-modal .tlp-modal-content {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}

#tlp-modal .tlp-modal-header {
	height: 68px;
	padding: 0 24px;
	background: #fff;
	display: grid;
	grid-template-columns: minmax(180px, 1fr) auto minmax(60px, 1fr);
	align-items: center;
	gap: 16px;
	border-bottom: 1px solid #dfe5ee;
	flex-shrink: 0;
}

#tlp-modal .tlp-modal-header-left {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

#tlp-modal .tlp-btn-back {
	width: 38px;
	height: 38px;
	background: #f8fafc;
	border: 1px solid #dfe5ee;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #172033;
	font-size: 18px;
}

#tlp-modal .tlp-modal-title {
	margin: 0;
	color: #172033;
	font-size: 17px;
	font-weight: 900;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#tlp-modal .tlp-modal-toolbar {
	display: flex;
	gap: 6px;
	background: #f1f5f9;
	padding: 5px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

#tlp-modal .tlp-responsive-btn {
	width: 38px;
	height: 38px;
	border: none;
	background: transparent;
	cursor: pointer;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, box-shadow 0.15s ease;
	font-size: 17px;
	position: relative;
}

#tlp-modal .tlp-responsive-btn.active {
	background: #fff;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

#tlp-modal .tlp-responsive-btn::after {
	content: attr(data-tooltip);
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #172033;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	padding: 6px 8px;
	border-radius: 6px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease;
	z-index: 20;
}

#tlp-modal .tlp-responsive-btn:hover::after,
#tlp-modal .tlp-responsive-btn:focus-visible::after {
	opacity: 1;
	visibility: visible;
}

#tlp-modal .tlp-modal-body {
	flex: 1;
	background: #eef2f7;
	display: flex;
	justify-content: center;
	overflow: hidden;
	padding: 32px 18px;
}

#tlp-modal .tlp-iframe-container {
	background: #fff;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
	transition: width 0.25s ease;
	margin: 0 auto;
	height: 100%;
	border-radius: 8px;
	overflow: hidden;
}

#tlp-modal .tlp-iframe-container.desktop-1440 { width: min(1440px, 100%); }
#tlp-modal .tlp-iframe-container.laptop-1280 { width: min(1280px, 100%); }
#tlp-modal .tlp-iframe-container.tablet-landscape-1024 { width: min(1024px, 100%); }
#tlp-modal .tlp-iframe-container.tablet-portrait-768 { width: min(768px, 100%); }
#tlp-modal .tlp-iframe-container.phone-standard-430 { width: min(430px, 100%); }
#tlp-modal .tlp-iframe-container.phone-small-390 { width: min(390px, 100%); }

#tlp-modal #tlp-preview-iframe {
	width: 100%;
	height: 100%;
	border: none;
}

#tlp-library-root .tlp-loader {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 100;
}

#tlp-library-root .tlp-spinner {
	width: 38px;
	height: 38px;
	border: 4px solid #dbe4f0;
	border-top: 4px solid var(--tlp-blue);
	border-radius: 50%;
	animation: tlp-spin 1s linear infinite;
}

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

@media (max-width: 992px) {
	#tlp-library-root {
		padding: 18px;
		gap: 16px;
	}

	#tlp-library-root .tlp-library-hero {
		align-items: flex-start;
		flex-direction: column;
		min-height: auto;
		padding: 26px;
	}

	#tlp-library-root .tlp-hero-panel {
		width: 100%;
	}

	.tlp-mobile-header {
		display: flex;
	}

	#tlp-library-root .tlp-sidebar {
		display: none;
	}

	#tlp-library-root .tlp-sidebar.open {
		display: flex;
	}

	#tlp-library-root .tlp-filter-primary {
		grid-template-columns: 1fr;
	}

	#tlp-library-root .tlp-category-list {
		flex-direction: column;
	}

	#tlp-library-root .tlp-category-item {
		width: 100%;
		justify-content: space-between;
	}

	#tlp-library-root .tlp-grid {
		grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
		gap: 16px;
	}
}

@media (max-width: 640px) {
	#tlp-library-root {
		padding: 12px;
	}

	#tlp-library-root .tlp-library-hero {
		padding: 22px;
	}

	#tlp-library-root .tlp-hero-copy h1 {
		font-size: 32px;
	}

	#tlp-library-root .tlp-hero-copy p {
		font-size: 14px;
	}

	#tlp-library-root .tlp-grid {
		grid-template-columns: 1fr;
	}

	#tlp-modal .tlp-modal-header {
		height: auto;
		min-height: 64px;
		padding: 10px 12px;
		grid-template-columns: 1fr;
		gap: 10px;
	}

	#tlp-modal .tlp-modal-toolbar {
		width: 100%;
		justify-content: space-between;
	}

	#tlp-modal .tlp-responsive-btn {
		width: 34px;
		height: 34px;
		font-size: 14px;
	}
}
