/* ==========================================================================
   Zaitoona Audio Hub — Modern Quranic Audio Player (`audio-hub.css`)
   Zero Build Step | Pure CSS3 | RTL Native | Cairo + Olive #2D3D1E + Gold #c5a059
   ========================================================================== */

.zah-player {
	--zah-olive-900: #1e2a13;
	--zah-olive-800: #2D3D1E;
	--zah-olive-700: #3a4f27;
	--zah-gold-500: #c5a059;
	--zah-gold-400: #d5b471;
	--zah-gold-100: #f6eedb;
	--zah-cream: #F7F5EE;
	--zah-surface: #ffffff;
	--zah-border: #dfdace;
	--zah-text: #1f2918;
	--zah-muted: #5c6853;
	--zah-seek-pct: 0%;
	--zah-vol-pct: 100%;

	width: 100%;
	max-width: 1120px;
	margin: 1.25rem auto;
	background: var(--zah-surface);
	border: 1px solid var(--zah-border);
	border-radius: 16px;
	box-shadow: 0 12px 34px rgba(29, 41, 18, 0.09);
	overflow: hidden;
	font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
	color: var(--zah-text);
	direction: rtl;
	text-align: right;
	box-sizing: border-box;
}

.zah-player *,
.zah-player *::before,
.zah-player *::after {
	box-sizing: border-box;
}

/* 1. Reciter / Khatma Header Card */
.zah-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	background:
		radial-gradient(circle at 12% 20%, rgba(197, 160, 89, 0.18), transparent 48%),
		linear-gradient(135deg, var(--zah-olive-800) 0%, var(--zah-olive-900) 100%);
	border-bottom: 3px solid var(--zah-gold-500);
	color: #ffffff;
}

.zah-header__identity {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}

.zah-header__avatar {
	flex: 0 0 68px;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	border: 2px solid var(--zah-gold-500);
	background: rgba(255, 255, 255, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	color: var(--zah-gold-400);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
}

.zah-header__avatar-img {
	width: 68px !important;
	height: 68px !important;
	object-fit: cover !important;
	display: block !important;
	margin: 0 !important;
	border-radius: 50% !important;
}

.zah-header__meta {
	min-width: 0;
}

.zah-header__badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.zah-riwaya-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 11px;
	border-radius: 999px;
	background: rgba(197, 160, 89, 0.22);
	border: 1px solid rgba(197, 160, 89, 0.55);
	color: #f6e7c5;
	font-size: 12.5px;
	font-weight: 700;
}

.zah-count-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	color: #e6eadf;
	font-size: 12px;
	font-weight: 700;
}

.zah-header__title {
	margin: 0 !important;
	padding: 0 !important;
	color: #ffffff !important;
	font-size: clamp(1.15rem, 1rem + 0.65vw, 1.5rem) !important;
	font-weight: 800 !important;
	line-height: 1.35 !important;
}

.zah-zip-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: 10px;
	background: var(--zah-gold-500);
	color: var(--zah-olive-900) !important;
	font-size: 13.5px;
	font-weight: 800;
	text-decoration: none !important;
	transition: transform 0.16s ease, background-color 0.16s ease;
}

.zah-zip-btn:hover {
	background: var(--zah-gold-400);
	transform: translateY(-1px);
}

/* 2. Main Control Deck */
.zah-deck {
	padding: 18px 24px 16px;
	background: var(--zah-cream);
	border-bottom: 1px solid var(--zah-border);
}

.zah-deck__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}

/* Transport Buttons */
.zah-transport {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.zah-ctrl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	cursor: pointer;
	transition: all 0.18s ease;
	padding: 0;
}

.zah-ctrl-btn--nav {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #ffffff;
	border: 1px solid #d5cebc;
	color: var(--zah-olive-800);
}

.zah-ctrl-btn--nav:hover {
	border-color: var(--zah-gold-500);
	background: var(--zah-gold-100);
	color: var(--zah-olive-900);
}

.zah-ctrl-btn--play {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--zah-gold-500) 0%, #b58d42 100%);
	color: var(--zah-olive-900);
	box-shadow: 0 6px 18px rgba(197, 160, 89, 0.38);
}

.zah-ctrl-btn--play:hover {
	transform: scale(1.05);
	background: linear-gradient(135deg, var(--zah-gold-400) 0%, var(--zah-gold-500) 100%);
}

.zah-ctrl-btn:focus-visible,
.zah-util-btn:focus-visible,
.zah-speed-btn:focus-visible,
.zah-download-btn:focus-visible,
.zah-track__select:focus-visible {
	outline: 2px solid var(--zah-gold-500);
	outline-offset: 2px;
}

/* Now Playing Info */
.zah-now-playing {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 240px;
	min-width: 0;
}

.zah-now-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	height: 44px;
	padding: 0 8px;
	border-radius: 11px;
	background: var(--zah-olive-800);
	border: 1px solid rgba(197, 160, 89, 0.55);
	color: var(--zah-gold-400);
	font-size: 14px;
	font-weight: 800;
	letter-spacing: 0.04em;
	flex-shrink: 0;
}

.zah-now-text {
	min-width: 0;
}

.zah-now-title-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.zah-now-title {
	font-size: 17px;
	font-weight: 800;
	color: var(--zah-olive-900);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.zah-now-artist {
	display: block;
	font-size: 12.5px;
	color: var(--zah-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Animated Equalizer */
.zah-eq,
.zah-track__eq {
	display: none;
	align-items: flex-end;
	gap: 2px;
	height: 14px;
}

.zah-player.is-playing .zah-eq,
.zah-player.is-playing .zah-track.is-active .zah-track__eq {
	display: inline-flex;
}

.zah-player.is-playing .zah-track.is-active .zah-track__play-ico {
	display: none;
}

.zah-eq span,
.zah-track__eq span {
	width: 3px;
	background: var(--zah-gold-500);
	border-radius: 2px;
	animation: zahEqBounce 0.85s ease-in-out infinite alternate;
}

.zah-eq span:nth-child(1),
.zah-track__eq span:nth-child(1) {
	height: 6px;
	animation-delay: 0s;
}

.zah-eq span:nth-child(2),
.zah-track__eq span:nth-child(2) {
	height: 13px;
	animation-delay: 0.22s;
}

.zah-eq span:nth-child(3),
.zah-track__eq span:nth-child(3) {
	height: 9px;
	animation-delay: 0.44s;
}

@keyframes zahEqBounce {
	0% {
		height: 4px;
	}
	100% {
		height: 14px;
	}
}

/* Utilities: Speed + Repeat + Volume + Direct Download */
.zah-utilities {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.zah-speed-group {
	display: inline-flex;
	align-items: center;
	background: #ffffff;
	border: 1px solid #d5cebc;
	border-radius: 9px;
	padding: 2px;
	direction: ltr;
}

.zah-speed-btn {
	border: 0;
	background: transparent;
	color: var(--zah-muted);
	font-family: inherit;
	font-size: 12px;
	font-weight: 800;
	padding: 4px 8px;
	border-radius: 7px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.zah-speed-btn:hover {
	color: var(--zah-olive-900);
}

.zah-speed-btn.is-active {
	background: var(--zah-olive-800);
	color: #ffffff;
}

.zah-util-btn {
	width: 36px;
	height: 36px;
	border-radius: 9px;
	border: 1px solid #d5cebc;
	background: #ffffff;
	color: var(--zah-olive-800);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: all 0.15s ease;
}

.zah-util-btn:hover {
	border-color: var(--zah-gold-500);
	background: var(--zah-gold-100);
}

.zah-util-btn.is-active {
	background: var(--zah-olive-800);
	border-color: var(--zah-olive-800);
	color: var(--zah-gold-400);
}

.zah-volume-wrap {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #ffffff;
	border: 1px solid #d5cebc;
	border-radius: 9px;
	padding: 0 8px 0 3px;
	height: 36px;
}

.zah-volume-wrap .zah-util-btn {
	border: 0;
	width: 30px;
	height: 30px;
	background: transparent;
}

.zah-volume-slider {
	width: 74px;
	height: 5px;
	appearance: none;
	-webkit-appearance: none;
	border-radius: 999px;
	background: linear-gradient(to right, var(--zah-olive-800) 0%, var(--zah-olive-800) var(--zah-vol-pct), #dfdace var(--zah-vol-pct), #dfdace 100%);
	cursor: pointer;
	margin: 0;
}

.zah-volume-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: var(--zah-gold-500);
	border: 2px solid var(--zah-olive-800);
	cursor: pointer;
}

.zah-volume-slider::-moz-range-thumb {
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: var(--zah-gold-500);
	border: 2px solid var(--zah-olive-800);
	cursor: pointer;
}

.zah-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 13px;
	border-radius: 9px;
	background: var(--zah-olive-800);
	color: #ffffff !important;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none !important;
	transition: background-color 0.16s ease;
}

.zah-download-btn:hover {
	background: var(--zah-olive-700);
	color: var(--zah-gold-400) !important;
}

/* Timeline Seek Bar (`dir="ltr"`) */
.zah-timeline {
	display: flex;
	align-items: center;
	gap: 12px;
	direction: ltr;
}

.zah-time {
	font-size: 12.5px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--zah-olive-800);
	min-width: 46px;
	text-align: center;
}

.zah-seek-wrap {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
}

.zah-seek-slider {
	width: 100%;
	height: 7px;
	appearance: none;
	-webkit-appearance: none;
	border-radius: 999px;
	background: linear-gradient(to right, var(--zah-gold-500) 0%, var(--zah-olive-800) var(--zah-seek-pct), #dcd6c6 var(--zah-seek-pct), #dcd6c6 100%);
	cursor: pointer;
	margin: 0;
}

.zah-seek-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--zah-gold-500);
	border: 2.5px solid var(--zah-olive-800);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
	cursor: pointer;
	transition: transform 0.12s ease;
}

.zah-seek-slider::-webkit-slider-thumb:hover {
	transform: scale(1.18);
}

.zah-seek-slider::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--zah-gold-500);
	border: 2.5px solid var(--zah-olive-800);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
	cursor: pointer;
}

.zah-status-msg {
	margin: 10px 0 0 !important;
	padding: 7px 12px;
	border-radius: 8px;
	background: #fef3c7;
	border: 1px solid #f59e0b;
	color: #78350f;
	font-size: 12.5px;
	font-weight: 700;
}

/* 3. Instant Surah Search Bar */
.zah-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 13px 24px;
	background: #ffffff;
	border-bottom: 1px solid #ece8dd;
}

.zah-search-box {
	position: relative;
	flex: 1 1 280px;
	display: flex;
	align-items: center;
}

.zah-search-icon {
	position: absolute;
	right: 12px;
	color: var(--zah-muted);
	pointer-events: none;
}

.zah-search-input {
	width: 100%;
	height: 40px;
	padding: 6px 38px 6px 34px !important;
	border-radius: 10px !important;
	border: 1px solid #d7d1c1 !important;
	background: var(--zah-cream) !important;
	color: var(--zah-text) !important;
	font-family: inherit !important;
	font-size: 13.5px !important;
	transition: border-color 0.16s ease, background-color 0.16s ease;
}

.zah-search-input:focus {
	outline: none !important;
	background: #ffffff !important;
	border-color: var(--zah-gold-500) !important;
	box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.16) !important;
}

.zah-search-clear {
	position: absolute;
	left: 8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 0;
	background: #e5dfd0;
	color: var(--zah-olive-900);
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.zah-filter-count {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--zah-muted);
	background: var(--zah-cream);
	padding: 5px 12px;
	border-radius: 999px;
	border: 1px solid #e6e0d0;
}

/* 4. Scrollable Surah Playlist */
.zah-playlist-scroll {
	max-height: 460px;
	overflow-y: auto;
	background: #ffffff;
	scrollbar-width: thin;
	scrollbar-color: var(--zah-gold-500) var(--zah-cream);
}

.zah-playlist-scroll::-webkit-scrollbar {
	width: 8px;
}

.zah-playlist-scroll::-webkit-scrollbar-track {
	background: var(--zah-cream);
}

.zah-playlist-scroll::-webkit-scrollbar-thumb {
	background-color: var(--zah-gold-500);
	border-radius: 999px;
}

.zah-playlist {
	list-style: none !important;
	margin: 0 !important;
	padding: 6px 12px 12px !important;
}

.zah-track {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 4px 0 !important;
	padding: 4px 6px 4px 10px;
	border-radius: 11px;
	border: 1px solid transparent;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.zah-track:hover {
	background: var(--zah-cream);
	border-color: #e6dfd0;
}

.zah-track.is-active {
	background: linear-gradient(90deg, #faf5e8 0%, var(--zah-cream) 100%);
	border-color: rgba(197, 160, 89, 0.68);
	border-right: 4px solid var(--zah-gold-500);
}

.zah-track[hidden] {
	display: none !important;
}

.zah-track__select {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 6px;
	border: 0;
	background: transparent;
	color: inherit;
	font-family: inherit;
	text-align: right;
	cursor: pointer;
}

.zah-track__num {
	flex: 0 0 40px;
	height: 32px;
	border-radius: 8px;
	background: var(--zah-cream);
	border: 1px solid #ded7c5;
	color: var(--zah-olive-800);
	font-size: 12.5px;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.zah-track.is-active .zah-track__num {
	background: var(--zah-olive-800);
	border-color: var(--zah-olive-800);
	color: var(--zah-gold-400);
}

.zah-track__info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.zah-track__title {
	font-size: 15px;
	font-weight: 700;
	color: var(--zah-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.zah-track.is-active .zah-track__title {
	font-weight: 800;
	color: var(--zah-olive-900);
}

.zah-track__sub {
	font-size: 12px;
	color: var(--zah-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.zah-track__state {
	flex: 0 0 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--zah-olive-800);
	opacity: 0.45;
}

.zah-track:hover .zah-track__state,
.zah-track.is-active .zah-track__state {
	opacity: 1;
}

.zah-track__dur {
	font-size: 12.5px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--zah-muted);
	min-width: 44px;
	text-align: left;
}

.zah-track__dl {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	border: 1px solid #e3ddd0;
	background: #ffffff;
	color: var(--zah-olive-800) !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none !important;
	transition: all 0.15s ease;
}

.zah-track__dl:hover {
	background: var(--zah-olive-800);
	border-color: var(--zah-olive-800);
	color: var(--zah-gold-400) !important;
}

.zah-no-match,
.zah-player-empty {
	padding: 28px 20px;
	text-align: center;
	color: var(--zah-muted);
	font-size: 14px;
	font-weight: 600;
}

.zah-player [hidden] {
	display: none !important;
}

/* Mobile & Tablet Responsive Polish */
@media (max-width: 768px) {
	.zah-header {
		padding: 16px;
	}

	.zah-header__avatar {
		flex: 0 0 54px;
		width: 54px;
		height: 54px;
	}

	.zah-header__avatar-img {
		width: 54px !important;
		height: 54px !important;
	}

	.zah-deck {
		padding: 14px 16px;
	}

	.zah-deck__top {
		gap: 12px;
	}

	.zah-now-playing {
		order: -1;
		flex: 1 1 100%;
	}

	.zah-utilities {
		width: 100%;
		justify-content: space-between;
	}

	.zah-volume-wrap {
		display: none;
	}

	.zah-filter-bar {
		padding: 12px 16px;
	}

	.zah-playlist-scroll {
		max-height: 390px;
	}
}
