/* =========================================================================
   Amal Journal — Quran reader polish
   =========================================================================
   Path:   assets/css/quran-reader-polish.css
   Since:  3.8.8
   Update: 3.9.0 — Language filter (Arabic / Bengali / English / All)

   Visual polish for the Quran reader modal. Loaded AFTER quran-sprint4.css
   so these rules override the reader defaults.

   What this adds:
   - Soft gradient hero behind the reader header.
   - Modern, pill-shaped header toggles (☰ সূরা, 📖 মোড).
   - Gradient full-surah button (cyan) + word-audio button (purple).
   - A subtle top-fade on the reading content so ayahs float in.
   - Rounded corners on the panel + deeper shadow.
   - Refined empty state ("Select a surah to begin").
   - Full dark + night mode support for every new element.
   - 3.9.0 — Reader language filter (floating pill + show/hide rules).
   ========================================================================= */

/* ---------- Reader panel — softer chrome ---------- */

.aj-quran-reader-panel {
	border-radius: 16px !important;
	box-shadow: 0 32px 80px rgba(0, 0, 0, .5) !important;
}

@media (max-width: 700px) {
	.aj-quran-reader-panel {
		border-radius: 0 !important;
	}
}

/* ---------- Header — gradient hero ---------- */

.aj-quran-reader-head {
	background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%) !important;
	border-bottom: 1px solid rgba(15, 23, 42, .07) !important;
	position: relative;
	padding-top: 10px !important;
	padding-bottom: 10px !important;
}

.aj-quran-reader-head::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: linear-gradient(90deg, #2f80ed 0%, #7c3aed 50%, #2f80ed 100%);
	opacity: .9;
	pointer-events: none;
	z-index: 2;
}

.aj-quran-reader-head h3,
.aj-quran-reader-head #aj-reader-title {
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	letter-spacing: -.005em;
}

/* ---------- Header toggles — pill style ---------- */

.aj-hdr-surah-toggle,
.aj-hdr-modes-toggle {
	border: 1.5px solid #2f80ed !important;
	background: linear-gradient(180deg, #ffffff, #f5f9ff) !important;
	color: #1e40af !important;
	box-shadow: 0 1px 2px rgba(47, 128, 237, .08);
	transition: background .15s, color .15s, box-shadow .15s, transform .1s;
	border-radius: 999px !important;
	padding: 7px 13px !important;
}

.aj-hdr-surah-toggle:hover,
.aj-hdr-modes-toggle:hover {
	background: linear-gradient(180deg, #eff6ff, #dbeafe) !important;
	box-shadow: 0 2px 6px rgba(47, 128, 237, .15);
}

.aj-hdr-surah-toggle:active,
.aj-hdr-modes-toggle:active {
	transform: scale(.96);
}

.aj-quran-reader.aj-surah-menu-open .aj-hdr-surah-toggle,
.aj-quran-reader.aj-modes-menu-open .aj-hdr-modes-toggle {
	background: linear-gradient(180deg, #3b82f6, #2563eb) !important;
	color: #fff !important;
	box-shadow: 0 4px 14px rgba(47, 128, 237, .35);
}

/* ---------- Full-surah + Word-audio buttons — vibrant gradients ---------- */

.aj-quran-reader-head .aj-full-surah-btn {
	background: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #22d3ee 100%) !important;
	box-shadow: 0 4px 12px rgba(6, 182, 212, .3);
	border-radius: 999px !important;
	transition: transform .12s, box-shadow .15s;
}

.aj-quran-reader-head .aj-full-surah-btn:hover {
	box-shadow: 0 6px 20px rgba(6, 182, 212, .4);
	transform: translateY(-1px);
}

.aj-quran-reader-head .aj-full-surah-btn:active {
	transform: translateY(0);
}

.aj-quran-reader-head .aj-word-audio-btn,
.aj-quran-reader-head .aj-word-audio,
.aj-quran-reader-head [class*="word-audio"],
.aj-quran-reader-head [class*="word_audio"] {
	background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%) !important;
	color: #fff !important;
	border: none !important;
	box-shadow: 0 4px 12px rgba(124, 58, 237, .3);
	border-radius: 999px !important;
	transition: transform .12s, box-shadow .15s;
}

.aj-quran-reader-head .aj-word-audio-btn:hover,
.aj-quran-reader-head [class*="word-audio"]:hover {
	box-shadow: 0 6px 20px rgba(124, 58, 237, .4);
	transform: translateY(-1px);
}

/* ---------- Reading content — smooth scroll + top fade ---------- */

.aj-quran-reader [data-aj-reader-content] {
	scroll-behavior: smooth;
	position: relative;
}

.aj-quran-reader [data-aj-reader-content]::before {
	content: '';
	position: sticky;
	top: 0;
	display: block;
	height: 22px;
	margin: -14px -16px -8px;
	background: linear-gradient(180deg, rgba(248, 250, 252, .95), rgba(248, 250, 252, 0));
	pointer-events: none;
	z-index: 4;
}

/* ---------- Mode strip in header — rounded pill ---------- */

.aj-quran-reader-modes {
	background: rgba(241, 243, 245, .7) !important;
	border-radius: 12px !important;
	padding: 4px !important;
}

.aj-mode-btn {
	border-radius: 8px !important;
	transition: background .15s, color .15s, box-shadow .15s;
}

.aj-mode-btn:hover {
	color: #2f80ed !important;
}

.aj-mode-btn.is-active {
	background: #ffffff !important;
	color: #2f80ed !important;
	box-shadow:
		0 1px 2px rgba(15, 23, 42, .08),
		0 2px 6px rgba(47, 128, 237, .12) !important;
}

@media (max-width: 700px) {
	.aj-quran-reader-modes {
		background: #fff !important;
		border: 1px solid rgba(15, 23, 42, .07) !important;
		border-top: none !important;
		box-shadow:
			0 12px 32px rgba(15, 23, 42, .15),
			0 2px 6px rgba(15, 23, 42, .06) !important;
	}

	.aj-quran-reader.aj-modes-menu-open .aj-quran-reader-modes .aj-mode-btn {
		border-bottom: 1px solid rgba(15, 23, 42, .06) !important;
		transition: background .12s, color .12s, padding-left .15s;
	}

	.aj-quran-reader.aj-modes-menu-open .aj-quran-reader-modes .aj-mode-btn:hover {
		padding-left: 22px !important;
	}

	.aj-quran-reader.aj-modes-menu-open .aj-quran-reader-modes .aj-mode-btn.is-active {
		background: linear-gradient(90deg, #eff6ff, #ffffff) !important;
		color: #1e40af !important;
		font-weight: 700;
		border-left: 3px solid #2f80ed !important;
		padding-left: 15px !important;
	}
}

/* ---------- Surah sidebar / dropdown — modern look ---------- */

[data-aj-reader-sidebar] {
	background: #f8fafc !important;
	border-right: 1px solid rgba(15, 23, 42, .06) !important;
}

[data-aj-reader-sidebar] button {
	border-bottom: 1px solid rgba(15, 23, 42, .05) !important;
	transition: background .12s, color .12s;
}

[data-aj-reader-sidebar] button:hover {
	background: #eef4ff !important;
	color: #1e40af !important;
}

[data-aj-reader-sidebar] button.is-active {
	background: linear-gradient(135deg, #2f80ed, #1e40af) !important;
	color: #fff !important;
	box-shadow: 0 2px 8px rgba(47, 128, 237, .25);
}

.aj-quran-reader-sidebar button.aj-sidebar-favorites {
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
	color: #78350f !important;
	font-weight: 700;
	text-align: center;
}

.aj-quran-reader-sidebar button.aj-sidebar-favorites.is-active {
	background: linear-gradient(135deg, #d97706, #b45309) !important;
	color: #fff !important;
}

.aj-quran-reader-sidebar button.aj-juz-full-btn {
	background: linear-gradient(135deg, #2f80ed 0%, #1e40af 100%) !important;
	color: #fff !important;
	font-weight: 700;
	text-align: center;
}

.aj-quran-reader-sidebar button.aj-juz-full-btn.is-active {
	background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%) !important;
}

.aj-quran-reader-sidebar button.aj-juz-full-btn small {
	color: rgba(255, 255, 255, .85) !important;
}

/* ---------- Empty state ---------- */

.aj-quran-reader [data-aj-reader-content] > p:first-child {
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
	color: #94a3b8 !important;
	font-size: 14px;
	line-height: 1.7;
	max-width: 340px;
	margin-left: auto;
	margin-right: auto;
}

/* ---------- Reading footer divider ---------- */

.aj-quran-reader [data-aj-reader-content]::after {
	content: '';
	display: block;
	height: 1px;
	margin-top: 24px;
	background: linear-gradient(90deg, transparent, rgba(15, 23, 42, .08), transparent);
}

/* ---------- Close / settings buttons ---------- */

.aj-quran-reader-close {
	border-radius: 8px !important;
	transition: background .15s, color .15s;
}

.aj-quran-reader-close:hover {
	background: rgba(220, 38, 38, .08) !important;
	color: #dc2626 !important;
}

.aj-quran-settings-btn {
	border-radius: 8px !important;
	transition: background .15s, transform .1s;
}

.aj-quran-settings-btn:hover {
	background: rgba(47, 128, 237, .08) !important;
	color: #2f80ed !important;
}

.aj-quran-settings-btn:active {
	transform: scale(.94);
}

/* =========================================================================
   v3.9.0 — Language filter: floating pill + popup
   ========================================================================= */

.aj-qlang-btn {
	position: fixed;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2147483420;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, #0ea5e9, #0284c7);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 24px rgba(2, 132, 199, .4);
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
	font-weight: 700;
	padding: 0;
	transition: transform .18s, background .18s;
}
.aj-qlang-btn:active { transform: translateY(-50%) scale(.92); }
.aj-qlang-btn.is-open {
	background: linear-gradient(135deg, #0284c7, #075985);
}

.aj-qlang-popup {
	position: fixed;
	right: 70px;
	top: 50%;
	transform: translateY(-50%) translateX(8px);
	z-index: 2147483420;
	background: #fff;
	color: #1f2933;
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .24);
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 170px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .18s, transform .18s;
	font-family: 'Noto Sans Bengali', 'Kalpurush', sans-serif;
}
.aj-qlang-popup.is-open {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(-50%) translateX(0);
}

.aj-qlang-opt {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 10px;
	border: none;
	background: transparent;
	color: #1f2933;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	width: 100%;
	transition: background .12s;
}
.aj-qlang-opt:hover { background: #f1f5f9; }
.aj-qlang-opt.is-active {
	background: #e0f2fe;
	color: #075985;
	font-weight: 700;
}
.aj-qlang-opt-icon {
	width: 22px;
	text-align: center;
	font-size: 16px;
	flex-shrink: 0;
}

/* ---------- Show / hide rules ----------
   The reader gets one of: .aj-qlang-all | .aj-qlang-ar | .aj-qlang-bn | .aj-qlang-en
   set on the .aj-quran-reader element by quran-language.js
   ------------------------------------------------------------- */

/* Arabic only — hide every translation */
.aj-quran-reader.aj-qlang-ar .amal-quran-translation { display: none !important; }

/* Bengali only — hide Arabic + English translation */
.aj-quran-reader.aj-qlang-bn .amal-quran-arabic { display: none !important; }
.aj-quran-reader.aj-qlang-bn .amal-quran-translation[data-aj-lang="en"] { display: none !important; }
.aj-quran-reader.aj-qlang-bn .amal-quran-translation-en { display: none !important; }

/* English only — hide Arabic + Bengali translation */
.aj-quran-reader.aj-qlang-en .amal-quran-arabic { display: none !important; }
.aj-quran-reader.aj-qlang-en .amal-quran-translation[data-aj-lang="bn"] { display: none !important; }
.aj-quran-reader.aj-qlang-en .amal-quran-translation-bn { display: none !important; }

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

@media (max-width: 700px) {
	.aj-qlang-btn {
		right: 10px;
		width: 44px;
		height: 44px;
		font-size: 16px;
	}
	.aj-qlang-popup {
		right: 62px;
		min-width: 155px;
	}
	.aj-qlang-opt { padding: 9px 12px; font-size: 13.5px; }
}

/* =========================================================================
   Dark mode
   ========================================================================= */

@media (prefers-color-scheme: dark) {

	.aj-quran-reader-head {
		background: linear-gradient(180deg, #14181f 0%, #1a1f27 100%) !important;
		border-bottom-color: rgba(255, 255, 255, .07) !important;
	}

	.aj-quran-reader-head h3,
	.aj-quran-reader-head #aj-reader-title {
		color: #eef2f6 !important;
	}

	.aj-hdr-surah-toggle,
	.aj-hdr-modes-toggle {
		border-color: #60a5fa !important;
		background: linear-gradient(180deg, #1e293b, #1a2436) !important;
		color: #93c5fd !important;
	}
	.aj-hdr-surah-toggle:hover,
	.aj-hdr-modes-toggle:hover {
		background: linear-gradient(180deg, #1e3a8a, #1e40af) !important;
	}

	.aj-quran-reader-modes {
		background: #1e1e1e !important;
		border-color: rgba(255, 255, 255, .08) !important;
	}

	.aj-mode-btn {
		color: #94a3b8 !important;
	}

	.aj-mode-btn.is-active {
		background: rgba(96, 165, 250, .18) !important;
		color: #93c5fd !important;
		box-shadow: 0 1px 2px rgba(0, 0, 0, .3) !important;
	}

	[data-aj-reader-sidebar] {
		background: #0f1318 !important;
		border-right-color: rgba(255, 255, 255, .06) !important;
	}

	[data-aj-reader-sidebar] button {
		border-bottom-color: rgba(255, 255, 255, .05) !important;
		color: #e6e8eb !important;
	}

	[data-aj-reader-sidebar] button:hover {
		background: rgba(96, 165, 250, .12) !important;
		color: #93c5fd !important;
	}

	.aj-quran-reader [data-aj-reader-content]::before {
		background: linear-gradient(180deg, rgba(20, 24, 31, .95), rgba(20, 24, 31, 0));
	}

	.aj-quran-reader [data-aj-reader-content]::after {
		background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
	}

	.aj-quran-reader-close:hover {
		background: rgba(220, 38, 38, .15) !important;
		color: #fca5a5 !important;
	}

	.aj-quran-settings-btn:hover {
		background: rgba(96, 165, 250, .12) !important;
		color: #93c5fd !important;
	}

	/* Language filter — dark */
	.aj-qlang-popup { background: #1e1e1e; color: #e6e8eb; }
	.aj-qlang-opt { color: #e6e8eb; }
	.aj-qlang-opt:hover { background: rgba(255, 255, 255, .06); }
	.aj-qlang-opt.is-active {
		background: rgba(14, 165, 233, .2);
		color: #7dd3fc;
	}
}

@media (prefers-color-scheme: dark) and (max-width: 700px) {
	.aj-quran-reader.aj-modes-menu-open .aj-quran-reader-modes .aj-mode-btn.is-active {
		background: linear-gradient(90deg, rgba(96, 165, 250, .15), rgba(30, 30, 30, 0)) !important;
		color: #93c5fd !important;
	}
}

/* =========================================================================
   Night mode (reader element — the .aj-night-force toggle)
   ========================================================================= */

.aj-quran-reader.aj-night-force .aj-quran-reader-head {
	background: linear-gradient(180deg, #14181f 0%, #1a1f27 100%) !important;
}

.aj-quran-reader.aj-night-force .aj-hdr-surah-toggle,
.aj-quran-reader.aj-night-force .aj-hdr-modes-toggle {
	border-color: #60a5fa !important;
	background: linear-gradient(180deg, #1e293b, #1a2436) !important;
	color: #93c5fd !important;
}

.aj-quran-reader.aj-night-force .aj-quran-reader-modes {
	background: #1e1e1e !important;
}

.aj-quran-reader.aj-night-force .aj-mode-btn.is-active {
	background: rgba(96, 165, 250, .18) !important;
	color: #93c5fd !important;
}

.aj-quran-reader.aj-night-force [data-aj-reader-sidebar] {
	background: #0f1318 !important;
}

.aj-quran-reader.aj-night-force .aj-qlang-popup { background: #1e1e1e; color: #e6e8eb; }
.aj-quran-reader.aj-night-force .aj-qlang-opt { color: #e6e8eb; }

/* =========================================================================
   Reduced motion
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
	.aj-hdr-surah-toggle,
	.aj-hdr-modes-toggle,
	.aj-quran-reader [data-aj-reader-content],
	.aj-quran-reader-head .aj-full-surah-btn,
	.aj-quran-reader-head [class*="word-audio"],
	.aj-quran-settings-btn,
	.aj-quran-reader-close,
	.aj-qlang-btn,
	.aj-qlang-popup {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}