/**
 * THX Library - Frontend Styles
 * Giao diện Tủ sách số, Tra cứu mục lục theo số trang chính xác và Tóm tắt sách.
 */

:root {
	--thx-primary: #1e3a8a;       /* Deep navy blue */
	--thx-primary-hover: #1e40af;
	--thx-primary-light: #eff6ff;
	--thx-secondary: #059669;     /* Emerald green */
	--thx-secondary-light: #ecfdf5;
	--thx-accent: #d97706;        /* Warm amber */
	--thx-accent-light: #fef3c7;
	--thx-bg: #f8fafc;
	--thx-card-bg: #ffffff;
	--thx-text: #1e293b;
	--thx-text-muted: #64748b;
	--thx-border: #e2e8f0;
	--thx-border-hover: #cbd5e1;
	--thx-radius: 12px;
	--thx-radius-sm: 8px;
	--thx-radius-lg: 16px;
	--thx-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
	--thx-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
	--thx-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
	--thx-transition: all 0.25s ease-in-out;
}

/* ==========================================================================
   1. TỦ SÁCH CATALOG (SHORTCODE [thx_library])
   ========================================================================== */

.thx-library-catalog-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1.5rem 1rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--thx-text);
}

.thx-lib-hero {
	background: linear-gradient(135deg, #1e3a8a 0%, #065f46 100%);
	color: #ffffff;
	border-radius: var(--thx-radius-lg);
	padding: 2.5rem 2rem;
	margin-bottom: 2rem;
	box-shadow: var(--thx-shadow-md);
}

.thx-lib-hero-content {
	max-width: 800px;
}

.thx-lib-title {
	margin: 0 0 0.75rem 0;
	font-size: 2rem;
	font-weight: 800;
	letter-spacing: -0.025em;
	color: #ffffff;
}

.thx-lib-subtitle {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.6;
	color: #e2e8f0;
	opacity: 0.95;
}

.thx-lib-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.75rem;
}

.thx-book-card {
	background: var(--thx-card-bg);
	border: 1px solid var(--thx-border);
	border-radius: var(--thx-radius);
	overflow: hidden;
	box-shadow: var(--thx-shadow);
	transition: var(--thx-transition);
	display: flex;
	flex-direction: column;
}

.thx-book-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--thx-shadow-md);
	border-color: var(--thx-border-hover);
}

.thx-book-cover-wrap {
	position: relative;
	height: 240px;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.thx-book-cover {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: var(--thx-transition);
}

.thx-book-card:hover .thx-book-cover {
	transform: scale(1.03);
}

.thx-book-cover-placeholder {
	font-size: 3.5rem;
	color: #94a3b8;
}

.thx-badge-toc {
	position: absolute;
	top: 12px;
	right: 12px;
	background: rgba(16, 185, 129, 0.95);
	color: #ffffff;
	padding: 4px 10px;
	font-size: 0.75rem;
	font-weight: 700;
	border-radius: 9999px;
	backdrop-filter: blur(4px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.thx-book-details {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.thx-book-title {
	margin: 0 0 0.5rem 0;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.4;
}

.thx-book-title a {
	color: var(--thx-primary);
	text-decoration: none;
	transition: var(--thx-transition);
}

.thx-book-title a:hover {
	color: var(--thx-primary-hover);
	text-decoration: underline;
}

.thx-book-meta-author {
	font-size: 0.875rem;
	color: var(--thx-text-muted);
	margin-bottom: 0.35rem;
}

.thx-book-meta-pages {
	font-size: 0.825rem;
	color: var(--thx-secondary);
	font-weight: 600;
	margin-bottom: 1.25rem;
}

.thx-book-card-actions {
	margin-top: auto;
	display: flex;
	gap: 0.5rem;
}

.thx-btn-view-toc {
	flex: 1;
	background: var(--thx-primary);
	color: #ffffff !important;
	text-align: center;
	padding: 0.65rem 1rem;
	font-size: 0.9rem;
	font-weight: 600;
	border-radius: var(--thx-radius-sm);
	text-decoration: none !important;
	transition: var(--thx-transition);
	display: inline-block;
}

.thx-btn-view-toc:hover {
	background: var(--thx-primary-hover);
	transform: translateY(-1px);
}

.thx-btn-view-pdf {
	background: #fee2e2;
	color: #dc2626 !important;
	border: 1px solid #fecaca;
	padding: 0.65rem 0.85rem;
	font-size: 0.85rem;
	font-weight: 700;
	border-radius: var(--thx-radius-sm);
	text-decoration: none !important;
	transition: var(--thx-transition);
}

.thx-btn-view-pdf:hover {
	background: #fecaca;
	color: #991b1b !important;
}

/* ==========================================================================
   2. KHÁM PHÁ MỤC LỤC & SỐ TRANG (EXPLORER & SINGLE BOOK)
   ========================================================================== */

.thx-book-toc-explorer {
	max-width: 1100px;
	margin: 2rem auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--thx-text);
}

/* Header Bar */
.thx-toc-header-bar {
	background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
	color: #ffffff;
	border-radius: var(--thx-radius-lg);
	padding: 2rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.5rem;
	margin-bottom: 1.75rem;
	box-shadow: var(--thx-shadow-md);
}

.thx-toc-book-cover {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.thx-toc-cover-img {
	width: 130px;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	object-fit: cover;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thx-toc-cover-img:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.thx-toc-tag {
	display: inline-block;
	background: rgba(255, 255, 255, 0.18);
	color: #dbeafe;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	padding: 4px 10px;
	border-radius: 9999px;
	margin-bottom: 0.65rem;
	text-transform: uppercase;
}

.thx-toc-book-heading {
	margin: 0 0 0.5rem 0;
	font-size: 1.85rem;
	font-weight: 800;
	color: #ffffff;
	line-height: 1.3;
}

.thx-toc-book-meta {
	margin: 0;
	font-size: 0.95rem;
	color: #e2e8f0;
}

.thx-toc-book-meta strong {
	color: #ffffff;
}

.thx-toc-clb-badge {
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.25);
	padding: 1rem 1.25rem;
	border-radius: var(--thx-radius);
	text-align: center;
	min-width: 200px;
	backdrop-filter: blur(4px);
}

.thx-toc-clb-badge span {
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	color: #a7f3d0;
	margin-bottom: 0.35rem;
}

.thx-link-event {
	color: #ffffff !important;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: underline !important;
	transition: var(--thx-transition);
}

.thx-link-event:hover {
	color: #fef08a !important;
}

/* Search & Jump Section */
.thx-toc-search-container {
	background: var(--thx-card-bg);
	border: 1px solid var(--thx-border);
	border-radius: var(--thx-radius);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	box-shadow: var(--thx-shadow);
}

.thx-search-split {
	display: grid;
	grid-template-columns: 1fr 1.4fr;
	gap: 1.5rem;
}

.thx-page-jump-box label,
.thx-keyword-search-box label {
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--thx-text);
	margin-bottom: 0.5rem;
}

.thx-input-group {
	display: flex;
	gap: 0.5rem;
}

.thx-input-group input {
	flex: 1;
	padding: 0.75rem 1rem;
	border: 1.5px solid var(--thx-border);
	border-radius: var(--thx-radius-sm);
	font-size: 0.95rem;
	outline: none;
	transition: var(--thx-transition);
	background: #ffffff;
}

.thx-input-group input:focus {
	border-color: var(--thx-primary);
	box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.thx-btn-primary {
	background: var(--thx-primary);
	color: #ffffff;
	border: none;
	padding: 0.75rem 1.25rem;
	font-size: 0.9rem;
	font-weight: 700;
	border-radius: var(--thx-radius-sm);
	cursor: pointer;
	transition: var(--thx-transition);
	white-space: nowrap;
}

.thx-btn-primary:hover {
	background: var(--thx-primary-hover);
}

.thx-btn-secondary {
	background: var(--thx-secondary);
	color: #ffffff;
	border: none;
	padding: 0.75rem 1.25rem;
	font-size: 0.9rem;
	font-weight: 700;
	border-radius: var(--thx-radius-sm);
	cursor: pointer;
	transition: var(--thx-transition);
	white-space: nowrap;
}

.thx-btn-secondary:hover {
	background: #047857;
}

/* Live Result Card */
.thx-toc-highlight-card {
	background: #f0fdf4;
	border: 2px solid #86efac;
	border-radius: var(--thx-radius);
	padding: 1.5rem;
	margin-bottom: 1.75rem;
	box-shadow: var(--thx-shadow-md);
	animation: thxSlideDown 0.3s ease;
}

@keyframes thxSlideDown {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.thx-live-result-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 0.75rem;
	flex-wrap: wrap;
}

.thx-live-result-title {
	font-size: 1.25rem;
	font-weight: 800;
	color: #14532d;
	margin: 0;
	line-height: 1.35;
}

.thx-live-badges {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
}

.thx-badge-live-page {
	background: #15803d;
	color: #ffffff;
	font-size: 0.8rem;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 9999px;
}

.thx-badge-live-habit {
	background: #f59e0b;
	color: #ffffff;
	font-size: 0.8rem;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 9999px;
}

.thx-live-breadcrumb {
	font-size: 0.825rem;
	color: #166534;
	background: rgba(255, 255, 255, 0.7);
	padding: 6px 12px;
	border-radius: 6px;
	margin-bottom: 1rem;
	border-left: 3px solid #16a34a;
}

.thx-live-summary {
	background: #ffffff;
	border: 1px solid #bbf7d0;
	border-radius: var(--thx-radius-sm);
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
	color: #1e293b;
	line-height: 1.6;
	font-size: 0.95rem;
}

.thx-live-summary strong {
	color: #166534;
	display: block;
	margin-bottom: 0.35rem;
}

.thx-live-keywords {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 1.25rem;
}

.thx-live-keywords-label {
	font-size: 0.8rem;
	font-weight: 700;
	color: #166534;
}

.thx-live-actions {
	display: flex;
	gap: 0.75rem;
	align-items: center;
}

.thx-btn-locate {
	background: #16a34a;
	color: #ffffff;
	border: none;
	padding: 0.6rem 1.1rem;
	font-size: 0.875rem;
	font-weight: 700;
	border-radius: var(--thx-radius-sm);
	cursor: pointer;
	transition: var(--thx-transition);
}

.thx-btn-locate:hover {
	background: #15803d;
}

.thx-btn-close-result {
	background: transparent;
	border: 1px solid #86efac;
	color: #166534;
	padding: 0.6rem 0.9rem;
	font-size: 0.85rem;
	font-weight: 600;
	border-radius: var(--thx-radius-sm);
	cursor: pointer;
	transition: var(--thx-transition);
}

.thx-btn-close-result:hover {
	background: #dcfce7;
}

/* Multi-result Search List */
.thx-search-results-list {
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	max-height: 480px;
	overflow-y: auto;
	padding-right: 6px;
}

.thx-search-result-item {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: var(--thx-radius-sm);
	padding: 0.85rem 1rem;
	cursor: pointer;
	transition: var(--thx-transition);
}

.thx-search-result-item:hover {
	border-color: var(--thx-secondary);
	box-shadow: var(--thx-shadow);
	transform: translateX(4px);
}

.thx-search-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.35rem;
}

.thx-search-item-title {
	font-weight: 700;
	color: var(--thx-primary);
	font-size: 0.95rem;
}

.thx-search-item-pages {
	font-size: 0.75rem;
	font-weight: 700;
	background: #eff6ff;
	color: #1d4ed8;
	padding: 2px 8px;
	border-radius: 9999px;
}

.thx-search-item-snippet {
	font-size: 0.85rem;
	color: var(--thx-text-muted);
	line-height: 1.45;
}

/* Habit Shortcuts */
.thx-habits-shortcuts {
	background: var(--thx-card-bg);
	border: 1px solid var(--thx-border);
	border-radius: var(--thx-radius);
	padding: 1rem 1.25rem;
	margin-bottom: 1.75rem;
	box-shadow: var(--thx-shadow);
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.thx-habits-label {
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--thx-text);
	white-space: nowrap;
}

.thx-habits-buttons {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	flex: 1;
}

.thx-habit-pill {
	background: var(--thx-bg);
	border: 1px solid var(--thx-border);
	color: var(--thx-text);
	font-size: 0.8rem;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 9999px;
	cursor: pointer;
	transition: var(--thx-transition);
	white-space: nowrap;
}

.thx-habit-pill:hover,
.thx-habit-pill.active {
	background: var(--thx-primary);
	color: #ffffff;
	border-color: var(--thx-primary);
	transform: translateY(-1px);
}

/* TOC Tree Section */
.thx-toc-tree-wrap {
	background: var(--thx-card-bg);
	border: 1px solid var(--thx-border);
	border-radius: var(--thx-radius);
	box-shadow: var(--thx-shadow);
	overflow: hidden;
}

.thx-toc-tree-header {
	background: #f8fafc;
	border-bottom: 1px solid var(--thx-border);
	padding: 1.25rem 1.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
}

.thx-toc-tree-header h3 {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--thx-text);
}

.thx-toc-tree-toggle {
	display: flex;
	gap: 0.75rem;
}

.thx-btn-text {
	background: transparent;
	border: none;
	color: var(--thx-primary);
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	transition: var(--thx-transition);
}

.thx-btn-text:hover {
	background: #eff6ff;
	text-decoration: underline;
}

/* TOC List & Items */
.thx-toc-list {
	padding: 0.5rem 0;
}

.thx-toc-item {
	border-bottom: 1px solid #f1f5f9;
	transition: background-color 0.2s ease;
}

.thx-toc-item:last-child {
	border-bottom: none;
}

.thx-toc-item-header {
	padding: 0.85rem 1.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	gap: 1rem;
	user-select: none;
	transition: var(--thx-transition);
}

.thx-toc-item-header:hover {
	background-color: #f8fafc;
}

.thx-toc-item-title-wrap {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex: 1;
}

.thx-toc-toggle-icon {
	display: inline-block;
	font-size: 0.7rem;
	color: #94a3b8;
	transition: transform 0.25s ease;
	width: 14px;
	text-align: center;
}

.thx-toc-item.is-open > .thx-toc-item-header .thx-toc-toggle-icon {
	transform: rotate(90deg);
	color: var(--thx-primary);
}

.thx-toc-title-text {
	font-size: 0.95rem;
	color: var(--thx-text);
	line-height: 1.4;
}

/* Level styling */
.thx-level-chapter > .thx-toc-item-header {
	background: #f8fafc;
	border-left: 4px solid var(--thx-primary);
	padding-top: 1.1rem;
	padding-bottom: 1.1rem;
}

.thx-level-chapter .thx-toc-title-text {
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--thx-primary);
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.thx-level-section > .thx-toc-item-header {
	border-left: 3px solid var(--thx-secondary);
	padding-left: 2rem;
}

.thx-level-section .thx-toc-title-text {
	font-weight: 700;
	color: #0f172a;
}

.thx-level-subsection > .thx-toc-item-header {
	padding-left: 2.75rem;
}

.thx-level-subsection .thx-toc-title-text {
	font-weight: 600;
	color: #334155;
}

.thx-level-item > .thx-toc-item-header {
	padding-left: 3.5rem;
}

.thx-level-item .thx-toc-title-text {
	font-weight: 500;
	color: #475569;
}

/* Badges & Pills */
.thx-badge-habit {
	background: #fef3c7;
	color: #b45309;
	font-size: 0.72rem;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 9999px;
	white-space: nowrap;
}

.thx-toc-page-pill {
	background: #f1f5f9;
	color: #475569;
	font-size: 0.775rem;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 9999px;
	white-space: nowrap;
	border: 1px solid #e2e8f0;
	transition: var(--thx-transition);
}

.thx-toc-page-pill:hover {
	background: #eff6ff;
	color: var(--thx-primary);
	border-color: #bfdbfe;
	transform: scale(1.04);
}

/* Item Body (Collapsible) */
.thx-toc-item-body {
	padding: 1rem 1.5rem 1.25rem 3.5rem;
	background: #fafafa;
	border-top: 1px solid #f1f5f9;
}

.thx-level-chapter > .thx-toc-item-body {
	padding-left: 2rem;
}
.thx-level-section > .thx-toc-item-body {
	padding-left: 2.75rem;
}
.thx-level-subsection > .thx-toc-item-body {
	padding-left: 3.25rem;
}

.thx-toc-summary-box {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-left: 3px solid var(--thx-secondary);
	border-radius: var(--thx-radius-sm);
	padding: 0.85rem 1.15rem;
	margin-bottom: 0.85rem;
}

.thx-toc-summary-box strong {
	display: block;
	font-size: 0.85rem;
	color: var(--thx-secondary);
	margin-bottom: 0.35rem;
}

.thx-toc-summary-box p {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.55;
	color: #334155;
}

.thx-toc-keywords-box {
	margin-bottom: 0.75rem;
}

.thx-toc-keywords-box strong {
	display: inline-block;
	font-size: 0.8rem;
	color: var(--thx-text-muted);
	margin-right: 0.5rem;
}

.thx-kw-tags {
	display: inline-flex;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.thx-kw-tag {
	background: #f1f5f9;
	color: #475569;
	font-size: 0.75rem;
	padding: 2px 8px;
	border-radius: 4px;
	border: 1px solid #e2e8f0;
}

.thx-toc-breadcrumb-trail {
	font-size: 0.75rem;
	color: #94a3b8;
}

/* Glowing Pulse Animation when locating an item */
.thx-toc-highlight-pulse {
	animation: thxGlow 2.5s ease-out;
}

@keyframes thxGlow {
	0% {
		background-color: #fef08a;
		box-shadow: 0 0 15px rgba(234, 179, 8, 0.6);
	}
	50% {
		background-color: #fef9c3;
		box-shadow: 0 0 8px rgba(234, 179, 8, 0.3);
	}
	100% {
		background-color: transparent;
		box-shadow: none;
	}
}

/* ==========================================================================
   3. RESPONSIVE DESIGN (MOBILE & TABLETS)
   ========================================================================== */

@media (max-width: 860px) {
	.thx-toc-header-bar {
		flex-direction: column;
		align-items: flex-start;
		padding: 1.5rem;
	}
	.thx-toc-clb-badge {
		width: 100%;
		text-align: left;
	}
	.thx-search-split {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}
}

@media (max-width: 640px) {
	.thx-toc-book-cover {
		width: 100%;
		justify-content: center;
		margin-bottom: 0.75rem;
	}
	.thx-toc-cover-img {
		width: 110px;
	}
	.thx-lib-title {
		font-size: 1.6rem;
	}
	.thx-toc-book-heading {
		font-size: 1.4rem;
	}
	.thx-input-group {
		flex-direction: column;
	}
	.thx-btn-primary,
	.thx-btn-secondary {
		width: 100%;
	}
	.thx-level-section > .thx-toc-item-header {
		padding-left: 1.25rem;
	}
	.thx-level-subsection > .thx-toc-item-header {
		padding-left: 1.5rem;
	}
	.thx-level-item > .thx-toc-item-header {
		padding-left: 1.75rem;
	}
	.thx-toc-item-body {
		padding-left: 1.5rem;
	}
}

/* ==========================================================================
   PUBLIC CATALOG ARCHIVE (/library/) - ENHANCEMENTS
   ========================================================================== */
.thx-lib-hero-topline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 12px;
}

.thx-lib-pill-badge {
	background: rgba(255, 255, 255, 0.2);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	padding: 4px 10px;
	border-radius: 20px;
	text-transform: uppercase;
}

.thx-lib-admin-link-badge {
	background: #ffffff;
	color: var(--thx-primary);
	font-size: 12px;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 20px;
	text-decoration: none;
	transition: all 0.2s;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.thx-lib-admin-link-badge:hover {
	background: #f8fafc;
	transform: translateY(-1px);
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Catalog Toolbar */
.thx-catalog-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 16px;
	background: #ffffff;
	padding: 12px 18px;
	border-radius: var(--thx-radius);
	border: 1px solid var(--thx-border);
	box-shadow: var(--thx-shadow);
}

.thx-catalog-cats-scroll {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 2px;
}

.thx-cat-tab {
	background: #f1f5f9;
	border: 1px solid transparent;
	color: var(--thx-text-muted);
	font-size: 13px;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 20px;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.2s ease;
}

.thx-cat-tab:hover {
	background: #e2e8f0;
	color: var(--thx-text);
}

.thx-cat-tab.active {
	background: var(--thx-primary);
	color: #ffffff;
}

.thx-catalog-search-wrap input {
	padding: 8px 14px;
	border: 1px solid var(--thx-border);
	border-radius: 20px;
	font-size: 13px;
	width: 240px;
	outline: none;
	transition: border-color 0.2s;
}

.thx-catalog-search-wrap input:focus {
	border-color: var(--thx-primary);
}

/* Status Bar */
.thx-catalog-status-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding: 0 4px;
	font-size: 13px;
	color: var(--thx-text-muted);
}

.thx-format-notice {
	color: #059669;
	font-weight: 500;
}

.thx-catalog-count {
	font-weight: 700;
	color: var(--thx-text);
}

/* Badges overlay */
.thx-card-badges-overlay {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	pointer-events: none;
}

.thx-badge-thx-verified {
	background: #ecfdf5;
	color: #059669;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 12px;
	border: 1px solid #a7f3d0;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.thx-card-cat-badge {
	display: inline-block;
	background: #eff6ff;
	color: #1d4ed8;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 6px;
	margin-bottom: 6px;
	width: fit-content;
}

.thx-book-excerpt {
	font-size: 13px;
	color: var(--thx-text-muted);
	line-height: 1.5;
	margin-bottom: 12px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.thx-btn-view-doc {
	background: #eff6ff;
	color: #2563eb;
	font-size: 12px;
	font-weight: 600;
	padding: 8px 12px;
	border-radius: var(--thx-radius-sm);
	text-decoration: none;
	border: 1px solid #bfdbfe;
	transition: var(--thx-transition);
}

.thx-btn-view-doc:hover {
	background: #dbeafe;
}

/* ==========================================================================
   PUBLIC KEYWORD SEARCH & ACL ACCESS BADGES (TASK 318)
   ========================================================================== */

.thx-search-kw-highlight {
	background: #fef08a !important;
	color: #854d0e !important;
	padding: 1px 4px;
	border-radius: 3px;
	font-weight: 700;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.thx-search-item-path {
	font-size: 11px;
	color: var(--thx-text-muted);
	margin-top: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.thx-toc-acl-status {
	display: inline-flex;
	align-items: center;
	margin-top: 8px;
}

/* ==========================================================================
   NAVIGATION, TABS & RESEARCH ASSISTANT TOOLS (Task 672)
   ========================================================================== */

/* Breadcrumbs */
.thx-lib-breadcrumbs {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #64748b;
	margin-bottom: 16px;
	padding: 8px 14px;
	background: rgba(248, 250, 252, 0.85);
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	backdrop-filter: blur(8px);
	flex-wrap: wrap;
}
.thx-lib-breadcrumbs a {
	color: #059669;
	text-decoration: none;
	font-weight: 600;
	transition: color 0.15s ease;
}
.thx-lib-breadcrumbs a:hover {
	color: #047857;
	text-decoration: underline;
}
.thx-crumb-sep {
	color: #cbd5e1;
	font-weight: 700;
}
.thx-crumb-current {
	color: #1e293b;
	font-weight: 600;
}

/* Tabs Navigation in Book Details */
.thx-book-tabs-nav {
	display: flex;
	gap: 8px;
	margin: 20px 0 16px 0;
	border-bottom: 2px solid #e2e8f0;
	padding-bottom: 0;
	overflow-x: auto;
	scrollbar-width: none;
}
.thx-book-tabs-nav::-webkit-scrollbar {
	display: none;
}

.thx-book-tab-btn {
	padding: 10px 18px;
	border: none;
	background: transparent;
	color: #64748b;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: all 0.2s ease;
	white-space: nowrap;
	border-radius: 8px 8px 0 0;
}
.thx-book-tab-btn:hover {
	color: #059669;
	background: #f0fdf4;
}
.thx-book-tab-btn.active {
	color: #059669;
	border-bottom-color: #059669;
	background: #ffffff;
	font-weight: 700;
}

.thx-book-tab-pane {
	animation: thxPaneFadeIn 0.2s ease-in-out;
}
@keyframes thxPaneFadeIn {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

.thx-pane-intro-banner {
	padding: 14px 18px;
	border-radius: 10px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #334155;
	font-size: 13px;
	line-height: 1.6;
	margin-bottom: 20px;
}
.thx-pane-intro-banner strong {
	display: block;
	font-size: 14px;
	margin-bottom: 4px;
}
.thx-pane-intro-banner p {
	margin: 0;
}

/* Tab 2: Concepts Grid */
.thx-concepts-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}
@media (min-width: 768px) {
	.thx-concepts-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.thx-concept-detail-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 18px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.thx-concept-detail-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0,0,0,0.08);
	border-color: #059669;
}
.thx-concept-card-top {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}
.thx-concept-badge {
	font-size: 10px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}
.thx-concept-heading {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
}
.thx-concept-model-tag {
	font-size: 12px;
	font-weight: 600;
	color: #2563eb;
	background: #eff6ff;
	padding: 3px 10px;
	border-radius: 6px;
	display: inline-block;
	margin-bottom: 10px;
}
.thx-concept-description {
	font-size: 13px;
	line-height: 1.6;
	color: #475569;
	margin-bottom: 12px;
}
.thx-concept-links-section {
	border-top: 1px dashed #e2e8f0;
	padding-top: 10px;
	font-size: 12px;
}
.thx-concept-book-list {
	list-style: none;
	padding: 0;
	margin: 8px 0 0 0;
}
.thx-concept-book-list li {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 8px 10px;
	margin-bottom: 6px;
}
.thx-conn-book-title {
	font-weight: 700;
	color: #059669;
	display: block;
}
.thx-conn-ch-title {
	color: #64748b;
	font-size: 11px;
	display: block;
}
.thx-conn-quote {
	margin: 4px 0 0 0;
	font-style: italic;
	color: #334155;
	font-size: 12px;
}

/* Tab 3: Citations Grid */
.thx-citations-grid {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.thx-citation-item-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 14px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.thx-cite-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 13px;
	color: #1e293b;
}
.thx-btn-copy-cite-text {
	background: #059669;
	color: #fff;
	border: none;
	padding: 5px 12px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}
.thx-btn-copy-cite-text:hover {
	background: #047857;
}
.thx-cite-content-box {
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.6;
	color: #334155;
	word-break: break-word;
	user-select: all;
}

/* Tab 4: Analytics Cards */
.thx-analytics-overview-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin-bottom: 24px;
}
.thx-stat-big-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.thx-big-num {
	font-size: 24px;
	font-weight: 800;
	color: #059669;
	margin-bottom: 4px;
}
.thx-big-lbl {
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
}
.thx-top-terms-section {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 18px;
}
.thx-top-terms-section h4 {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
}

/* ==========================================================================
   TASK 708: Ẩn các phần liên quan đến nghiên cứu chuyên sâu trên website THX Library
   (Tạm thời cất đi để anh Thanh xem lại sau)
   ========================================================================== */
.thx-btn-view-research,
.thx-book-tabs-nav,
#thx-tab-pane-concepts,
#thx-tab-pane-citations,
#thx-tab-pane-analytics {
	display: none !important;
}



