/* =========================================================================
   Amal Journal — Qadiri Library
   Path:   assets/css/qadiri-library.css
   Since:  4.2.0
   ========================================================================= */

.aj-qlib-modal {
	position: fixed; inset: 0;
	z-index: 2147483445;
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
	background: rgba(8,12,20,.72);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}
.aj-qlib-modal[hidden] { display: none !important; }

.aj-qlib-panel {
	position: relative;
	background: #fff; color: #1f2933;
	width: min(720px, 96vw); max-height: 92vh;
	border-radius: 18px;
	display: flex; flex-direction: column; overflow: hidden;
	box-shadow: 0 24px 72px rgba(0,0,0,.45);
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
}

.aj-qlib-head {
	display: flex; align-items: center; gap: 10px;
	padding: 14px 18px;
	background: linear-gradient(135deg, #7c3aed, #5b21b6);
	color: #fff; flex-shrink: 0;
}
.aj-qlib-head h3 {
	margin: 0; font-size: 16px; font-weight: 700; flex: 1;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	min-width: 0;
}
.aj-qlib-count {
	font-size: 11px; font-weight: 700;
	padding: 3px 9px; border-radius: 999px;
	background: rgba(255,255,255,.18);
	flex-shrink: 0;
}
.aj-qlib-back {
	background: rgba(255,255,255,.15);
	border: none; color: #fff;
	font-size: 20px; line-height: 1; cursor: pointer;
	padding: 4px 10px; border-radius: 8px;
	flex-shrink: 0;
}
.aj-qlib-back:hover { background: rgba(255,255,255,.28); }
.aj-qlib-back[hidden] { display: none !important; }
.aj-qlib-close {
	background: rgba(255,255,255,.15);
	border: none; color: #fff;
	font-size: 22px; line-height: 1; cursor: pointer;
	padding: 4px 10px; border-radius: 8px;
	flex-shrink: 0;
}
.aj-qlib-close:hover { background: rgba(255,255,255,.28); }

.aj-qlib-body {
	flex: 1 1 auto; overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 20px 24px;
	min-height: 0;
}

.aj-qlib-search {
	width: 100%;
	padding: 10px 14px;
	font-size: 14px;
	font-family: inherit;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #f8fafc; color: #1f2933;
	margin-bottom: 12px;
	outline: none;
	box-sizing: border-box;
}
.aj-qlib-search:focus {
	border-color: #7c3aed;
	background: #f5f3ff;
	box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}

.aj-qlib-tags {
	display: flex; gap: 6px;
	overflow-x: auto; -webkit-overflow-scrolling: touch;
	padding-bottom: 6px; margin-bottom: 12px;
	scrollbar-width: none;
}
.aj-qlib-tags::-webkit-scrollbar { display: none; }
.aj-qlib-tag {
	flex-shrink: 0;
	display: inline-flex; align-items: center; gap: 5px;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid #e5e7eb;
	background: #f8fafc; color: #4b5563;
	font-size: 12px; font-weight: 700;
	font-family: inherit; cursor: pointer;
	white-space: nowrap;
	transition: background .14s, border-color .14s, color .14s;
}
.aj-qlib-tag:hover { background: #f5f3ff; border-color: #c4b5fd; }
.aj-qlib-tag.is-active {
	background: linear-gradient(135deg, #7c3aed, #5b21b6);
	border-color: #5b21b6; color: #fff;
}

.aj-qlib-list {
	display: flex; flex-direction: column; gap: 10px;
}
.aj-qlib-card {
	display: flex; align-items: center; gap: 14px;
	padding: 14px 16px;
	border: 1px solid #e5e7eb; border-radius: 14px;
	background: #fff; cursor: pointer;
	transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
}
.aj-qlib-card:hover {
	border-color: #7c3aed; background: #faf5ff;
	box-shadow: 0 6px 18px rgba(124,58,237,.08);
	transform: translateY(-1px);
}
.aj-qlib-card:active { transform: scale(.99); }
.aj-qlib-card-icon {
	width: 48px; height: 48px;
	border-radius: 12px;
	background: linear-gradient(135deg, #a78bfa, #7c3aed);
	color: #fff;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 24px; flex-shrink: 0;
	box-shadow: 0 4px 10px rgba(124,58,237,.25);
}
.aj-qlib-card-meta { flex: 1; min-width: 0; }
.aj-qlib-card-title {
	margin: 0 0 3px;
	font-size: 15px; font-weight: 700;
	color: #1f2933;
	font-family: inherit;
	line-height: 1.3;
}
.aj-qlib-card-title-en {
	font-size: 11px;
	color: #9ca3af;
	font-weight: 500;
	font-family: -apple-system, sans-serif;
	margin-left: 4px;
}
.aj-qlib-card-sub {
	margin: 0 0 6px;
	font-size: 12.5px; color: #6b7280;
	line-height: 1.5;
}
.aj-qlib-card-tags {
	display: flex; gap: 4px; flex-wrap: wrap;
}
.aj-qlib-card-tag {
	font-size: 10px; font-weight: 700;
	padding: 2px 7px; border-radius: 999px;
	background: #f5f3ff; color: #6d28d9;
}
.aj-qlib-card-arrow {
	font-size: 18px; color: #c4b5fd;
	flex-shrink: 0;
}

.aj-qlib-empty {
	text-align: center; padding: 40px 20px;
	color: #9ca3af; font-size: 13.5px;
	font-family: inherit;
}

.aj-qlib-doc-head {
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 2px solid #ede9fe;
}
.aj-qlib-doc-title {
	margin: 0 0 6px;
	font-size: 22px; font-weight: 800;
	color: #1f2933; line-height: 1.3;
	font-family: inherit;
}
.aj-qlib-doc-sub {
	margin: 0;
	font-size: 13px; color: #6b7280;
	line-height: 1.6;
	font-family: inherit;
}

.aj-qlib-section {
	margin-bottom: 24px;
}
.aj-qlib-section:last-child { margin-bottom: 0; }
.aj-qlib-section-heading {
	margin: 0 0 12px;
	font-size: 16px; font-weight: 800;
	color: #5b21b6;
	font-family: inherit;
	line-height: 1.4;
	padding-left: 12px;
	border-left: 4px solid #7c3aed;
}
.aj-qlib-p {
	margin: 0 0 12px;
	font-size: 14px; line-height: 1.8;
	color: #374151;
	font-family: inherit;
}
.aj-qlib-p:last-child { margin-bottom: 0; }

.aj-qlib-subhead {
	margin: 16px 0 8px;
	font-size: 13.5px; font-weight: 800;
	color: #6d28d9;
	font-family: inherit;
	letter-spacing: .02em;
}

.aj-qlib-terms {
	margin: 0 0 12px;
	display: flex; flex-direction: column; gap: 10px;
}
.aj-qlib-term {
	padding: 12px 14px;
	background: #faf5ff;
	border-left: 3px solid #a78bfa;
	border-radius: 0 10px 10px 0;
}
.aj-qlib-term-name {
	display: block;
	font-size: 13.5px; font-weight: 800;
	color: #5b21b6;
	margin-bottom: 4px;
	font-family: inherit;
	line-height: 1.4;
}
.aj-qlib-term-def {
	font-size: 13.5px; line-height: 1.75;
	color: #374151;
	font-family: inherit;
}

.aj-qlib-quote {
	margin: 14px 0;
	padding: 14px 18px;
	background: linear-gradient(135deg, #f5f3ff, #ede9fe);
	border-left: 4px solid #7c3aed;
	border-radius: 0 12px 12px 0;
	font-size: 14px; line-height: 1.75;
	color: #4c1d95;
	font-style: italic;
	font-family: inherit;
}

.aj-qlib-list-ul {
	margin: 0 0 12px;
	padding-left: 22px;
	font-size: 14px; line-height: 1.8;
	color: #374151;
	font-family: inherit;
}
.aj-qlib-list-ul li { margin-bottom: 6px; }

@media (max-width: 700px) {
	.aj-qlib-modal { padding: 0; align-items: stretch; }
	.aj-qlib-panel {
		width: 100%; max-width: 100%;
		max-height: 100vh; max-height: 100dvh;
		border-radius: 0;
	}
	.aj-qlib-body { padding: 14px 16px 20px; }
	.aj-qlib-head h3 { font-size: 14.5px; }
	.aj-qlib-card { padding: 12px 14px; gap: 12px; }
	.aj-qlib-card-icon { width: 42px; height: 42px; font-size: 21px; }
	.aj-qlib-card-title { font-size: 14px; }
	.aj-qlib-doc-title { font-size: 19px; }
	.aj-qlib-section-heading { font-size: 15px; }
	.aj-qlib-p,
	.aj-qlib-term-def,
	.aj-qlib-quote,
	.aj-qlib-list-ul { font-size: 13.5px; }
}

@media (prefers-color-scheme: dark) {
	.aj-qlib-panel { background: #1e1e1e; color: #e6e8eb; }
	.aj-qlib-body { background: #1e1e1e; }
	.aj-qlib-search {
		background: #14181f; border-color: #2a313b; color: #e6e8eb;
	}
	.aj-qlib-search:focus {
		background: rgba(124,58,237,.1);
		border-color: #a78bfa;
	}
	.aj-qlib-tag {
		background: #14181f; border-color: #2a313b; color: #94a3b8;
	}
	.aj-qlib-tag:hover { background: rgba(124,58,237,.12); }
	.aj-qlib-tag.is-active {
		background: linear-gradient(135deg, #7c3aed, #5b21b6);
		border-color: #a78bfa; color: #fff;
	}
	.aj-qlib-card {
		background: #14181f; border-color: #2a313b;
	}
	.aj-qlib-card:hover {
		background: rgba(124,58,237,.08);
		border-color: #7c3aed;
	}
	.aj-qlib-card-title { color: #e6e8eb; }
	.aj-qlib-card-title-en { color: #64748b; }
	.aj-qlib-card-sub { color: #94a3b8; }
	.aj-qlib-card-tag {
		background: rgba(124,58,237,.2); color: #c4b5fd;
	}
	.aj-qlib-empty { color: #64748b; }

	.aj-qlib-doc-head { border-bottom-color: #3f2f5c; }
	.aj-qlib-doc-title { color: #e6e8eb; }
	.aj-qlib-doc-sub { color: #94a3b8; }
	.aj-qlib-section-heading { color: #c4b5fd; }
	.aj-qlib-p { color: #cbd5e1; }
	.aj-qlib-subhead { color: #c4b5fd; }
	.aj-qlib-term {
		background: rgba(124,58,237,.1);
		border-left-color: #7c3aed;
	}
	.aj-qlib-term-name { color: #c4b5fd; }
	.aj-qlib-term-def { color: #cbd5e1; }
	.aj-qlib-quote {
		background: rgba(124,58,237,.15);
		border-left-color: #a78bfa;
		color: #ddd6fe;
	}
	.aj-qlib-list-ul { color: #cbd5e1; }
}