/* =========================================================================
   Amal Journal — Halal & Haram Guide
   Path:   assets/css/halal-haram.css
   Since:  4.0.4
   v4.0.5 — Category row is now a dropdown toggle.
   ========================================================================= */

/* ---------- Modal ---------- */

.aj-hh-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483440;
	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-hh-modal[hidden] { display: none !important; }

.aj-hh-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;
}

/* ---------- Header ---------- */

.aj-hh-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	background: linear-gradient(135deg, #0d9488, #0f766e);
	color: #fff;
	flex-shrink: 0;
}
.aj-hh-head h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	flex: 1;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
}
.aj-hh-head .aj-hh-count {
	font-size: 11px;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .18);
	flex-shrink: 0;
}
.aj-hh-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;
	font-family: inherit;
	flex-shrink: 0;
}
.aj-hh-close:hover { background: rgba(255, 255, 255, .28); }

/* ---------- Body ---------- */

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

/* ---------- Search ---------- */

.aj-hh-search {
	width: 100%;
	padding: 10px 14px;
	font-size: 14px;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #f8fafc;
	color: #1f2933;
	margin-bottom: 12px;
	outline: none;
}
.aj-hh-search:focus {
	border-color: #0d9488;
	background: #f0fdfa;
	box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}

/* ---------- Category dropdown ---------- */

.aj-hh-cats {
	position: relative;
	margin-bottom: 10px;
	z-index: 20;
}

.aj-hh-cat-trigger {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	background: #f8fafc;
	color: #1f2933;
	font-size: 13.5px;
	font-weight: 600;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
	cursor: pointer;
	transition: border-color .14s, background .14s, box-shadow .14s;
	text-align: left;
}
.aj-hh-cat-trigger:hover {
	background: #f0fdfa;
	border-color: #14b8a6;
}
.aj-hh-cats.is-open .aj-hh-cat-trigger {
	background: #f0fdfa;
	border-color: #0d9488;
	box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.aj-hh-cat-trigger-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
.aj-hh-cat-trigger-label { flex: 1; min-width: 0; }
.aj-hh-cat-trigger-chevron {
	font-size: 12px;
	color: #6b7280;
	transition: transform .18s;
	flex-shrink: 0;
}
.aj-hh-cats.is-open .aj-hh-cat-trigger-chevron { transform: rotate(180deg); }

.aj-hh-cat-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	max-height: 60vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
	padding: 6px;
	z-index: 30;
}
.aj-hh-cat-menu[hidden] { display: none !important; }

.aj-hh-cat-option {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: none;
	background: transparent;
	border-radius: 8px;
	color: #1f2933;
	font-size: 13.5px;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
	cursor: pointer;
	text-align: left;
	transition: background .12s, color .12s;
}
.aj-hh-cat-option:hover { background: #f0fdfa; }
.aj-hh-cat-option.is-selected {
	background: linear-gradient(135deg, #0d9488, #0f766e);
	color: #fff;
	font-weight: 700;
}
.aj-hh-cat-option-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
.aj-hh-cat-option-label { flex: 1; min-width: 0; }
.aj-hh-cat-option-check {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	opacity: 0;
	position: relative;
}
.aj-hh-cat-option.is-selected .aj-hh-cat-option-check { opacity: 1; }
.aj-hh-cat-option.is-selected .aj-hh-cat-option-check::before {
	content: '✓';
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 800;
}

/* ---------- Verdict chips ---------- */

.aj-hh-verdicts {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}
.aj-hh-vchip {
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid #e5e7eb;
	background: #fff;
	color: #4b5563;
	font-size: 11.5px;
	font-weight: 700;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
	cursor: pointer;
	transition: background .14s, border-color .14s, color .14s;
}
.aj-hh-vchip:hover { background: #f8fafc; }
.aj-hh-vchip.is-active {
	background: #0f172a;
	border-color: #0f172a;
	color: #fff;
}

/* ---------- Entry cards ---------- */

.aj-hh-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.aj-hh-card {
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 14px 16px;
	background: #fff;
	position: relative;
	border-left-width: 5px;
	border-left-style: solid;
	border-left-color: #e5e7eb;
	transition: box-shadow .16s, transform .12s;
}
.aj-hh-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
	transform: translateY(-1px);
}
.aj-hh-card[data-verdict="halal"]     { border-left-color: #16a34a; }
.aj-hh-card[data-verdict="haram"]     { border-left-color: #dc2626; }
.aj-hh-card[data-verdict="makruh"]    { border-left-color: #f59e0b; }
.aj-hh-card[data-verdict="mustahabb"] { border-left-color: #0891b2; }
.aj-hh-card[data-verdict="mixed"]     { border-left-color: #7c3aed; }

.aj-hh-card-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.aj-hh-card-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	flex: 1;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
	line-height: 1.4;
}

.aj-hh-badge {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
	letter-spacing: .2px;
}
.aj-hh-badge[data-v="halal"]     { background: #dcfce7; color: #166534; }
.aj-hh-badge[data-v="haram"]     { background: #fee2e2; color: #991b1b; }
.aj-hh-badge[data-v="makruh"]    { background: #fef3c7; color: #92400e; }
.aj-hh-badge[data-v="mustahabb"] { background: #cffafe; color: #155e75; }
.aj-hh-badge[data-v="mixed"]     { background: #ede9fe; color: #5b21b6; }

.aj-hh-summary {
	margin: 0 0 12px;
	font-size: 13.5px;
	color: #4b5563;
	line-height: 1.7;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
}

.aj-hh-quote {
	margin: 0 0 8px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.7;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
}
.aj-hh-quote:last-child { margin-bottom: 0; }

.aj-hh-quote[data-src="quran"] {
	background: #f0fdf4;
	border-left: 3px solid #16a34a;
}
.aj-hh-quote[data-src="hadith"] {
	background: #fffbeb;
	border-left: 3px solid #f59e0b;
}

.aj-hh-quote .aj-hh-qref {
	display: inline-block;
	font-size: 11px;
	font-weight: 800;
	color: #166534;
	text-transform: uppercase;
	letter-spacing: .4px;
	margin-right: 6px;
}
.aj-hh-quote[data-src="hadith"] .aj-hh-qref { color: #92400e; }

.aj-hh-quote .aj-hh-qtext {
	color: #1f2933;
	font-size: 13.5px;
}

/* ---------- Empty + loading ---------- */

.aj-hh-empty {
	text-align: center;
	padding: 40px 20px;
	color: #9ca3af;
	font-size: 13.5px;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
}

/* ---------- Mobile ---------- */

@media (max-width: 700px) {
	.aj-hh-modal { padding: 0; align-items: stretch; }
	.aj-hh-panel {
		width: 100%;
		max-width: 100%;
		max-height: 100vh;
		max-height: 100dvh;
		border-radius: 0;
	}
	.aj-hh-body { padding: 14px 16px 20px; }
	.aj-hh-head h3 { font-size: 14.5px; }
	.aj-hh-card { padding: 12px 14px; }
	.aj-hh-card-title { font-size: 14px; }
	.aj-hh-cat-menu { max-height: 55vh; }
}

/* ---------- Dark mode ---------- */

@media (prefers-color-scheme: dark) {
	.aj-hh-panel { background: #1e1e1e; color: #e6e8eb; }
	.aj-hh-body { background: #1e1e1e; }

	.aj-hh-search {
		background: #14181f;
		border-color: #2a313b;
		color: #e6e8eb;
	}
	.aj-hh-search:focus {
		background: rgba(13, 148, 136, .1);
		border-color: #14b8a6;
	}

	/* Category dropdown — dark */
	.aj-hh-cat-trigger {
		background: #14181f;
		border-color: #2a313b;
		color: #e6e8eb;
	}
	.aj-hh-cat-trigger:hover {
		background: rgba(13, 148, 136, .12);
		border-color: #14b8a6;
	}
	.aj-hh-cats.is-open .aj-hh-cat-trigger {
		background: rgba(13, 148, 136, .15);
		border-color: #14b8a6;
		box-shadow: 0 0 0 3px rgba(13, 148, 136, .2);
	}
	.aj-hh-cat-trigger-chevron { color: #94a3b8; }

	.aj-hh-cat-menu {
		background: #1e1e1e;
		border-color: #2a313b;
		box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
	}
	.aj-hh-cat-option { color: #e6e8eb; }
	.aj-hh-cat-option:hover { background: rgba(13, 148, 136, .12); }
	.aj-hh-cat-option.is-selected {
		background: linear-gradient(135deg, #0d9488, #0f766e);
		color: #fff;
	}

	/* Verdict chips — dark */
	.aj-hh-vchip {
		background: #14181f;
		border-color: #2a313b;
		color: #94a3b8;
	}
	.aj-hh-vchip:hover { background: #1a1f28; }
	.aj-hh-vchip.is-active {
		background: #e6e8eb;
		border-color: #e6e8eb;
		color: #0f172a;
	}

	/* Cards — dark */
	.aj-hh-card {
		background: #14181f;
		border-color: #2a313b;
	}
	.aj-hh-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
	.aj-hh-card-title { color: #e6e8eb; }
	.aj-hh-summary { color: #94a3b8; }

	/* Badges — dark */
	.aj-hh-badge[data-v="halal"]     { background: rgba(22, 163, 74, .2); color: #86efac; }
	.aj-hh-badge[data-v="haram"]     { background: rgba(220, 38, 38, .2); color: #fca5a5; }
	.aj-hh-badge[data-v="makruh"]    { background: rgba(245, 158, 11, .2); color: #fcd34d; }
	.aj-hh-badge[data-v="mustahabb"] { background: rgba(8, 145, 178, .2); color: #67e8f9; }
	.aj-hh-badge[data-v="mixed"]     { background: rgba(124, 58, 237, .2); color: #c4b5fd; }

	/* Quotes — dark */
	.aj-hh-quote[data-src="quran"]  { background: rgba(22, 163, 74, .08); }
	.aj-hh-quote[data-src="hadith"] { background: rgba(245, 158, 11, .08); }
	.aj-hh-quote .aj-hh-qref { color: #86efac; }
	.aj-hh-quote[data-src="hadith"] .aj-hh-qref { color: #fcd34d; }
	.aj-hh-quote .aj-hh-qtext { color: #cbd5e1; }

	.aj-hh-empty { color: #64748b; }
}