/* ============================================================
   ES Grades — بطاقات التصنيفات
   تصميم البطاقات مع التصفية والأرشفة (نسخة معزولة بأسماء es-)
   ============================================================ */

.es-component {
	--es-primary: #004DE7;
	--es-primary-dark: #0039B3;
	--es-primary-light: #4D8BFF;
	--es-primary-rgb: 0, 77, 231;
	--es-card-bg: #FFFFFF;
	--es-shadow: 0 16px 48px rgba(var(--es-primary-rgb), 0.14);
	--es-shadow-hover: 0 24px 64px rgba(var(--es-primary-rgb), 0.24);
	--es-radius: 20px;
	--es-side-padding: 24px;
	--es-cards-gap: 24px;
	--es-page-side-inset: 3px;

	direction: rtl;
	font-family: 'Segoe UI', Tahoma, sans-serif;
	color: #111;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding: 30px var(--es-page-side-inset) 40px;
}

.es-component, .es-component * { box-sizing: border-box; }

/* ===== رأس الصفحة (الشعار + الفلاتر) ===== */
.es-component .es-page-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.2rem;
	width: 100%;
	max-width: 1200px;
	padding: 0 20px;
	margin: 0 auto;
	background: transparent;
}

@media (min-width: 900px) {
	.es-component .es-page-header {
		flex-direction: row;
		justify-content: center;
		align-items: center;
		gap: 2.5rem;
		flex-wrap: nowrap;
	}
}

/* ===== العنوان (الشعار) ===== */
.es-component .es-main-title {
	display: inline-block;
	padding: 8px 24px;
	border-radius: 12px;
	position: relative;
	cursor: pointer;
	transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	margin: 0;
	flex-shrink: 0;
	background: transparent;
	font-size: 0;
	line-height: 0;
}

.es-component .es-main-title::before {
	content: '';
	position: absolute;
	inset: 0;
	background: transparent;
	z-index: -1;
	opacity: 0;
	border-radius: 12px;
	transition: opacity 0.4s ease;
}

.es-component .es-main-title:active { transform: scale(0.96); }

.es-component .es-title-logo {
	display: block;
	max-width: 320px;
	width: 100%;
	height: auto;
	border-radius: 8px;
	transition: filter 0.4s ease;
	will-change: filter;
	background: transparent;
}

.es-component .es-main-title.active .es-title-logo {
	filter: hue-rotate(30deg) saturate(1.3);
}

/* ===== شريط التصفية ===== */
.es-component .es-filter-tabs {
	display: inline-flex;
	gap: 6px;
	background: transparent;
	border: none;
	box-shadow: none;
	padding: 6px;
	border-radius: 16px;
	position: relative;
	z-index: 5;
	animation: es-card-appear 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
	will-change: transform, opacity;
	flex-shrink: 0;
}

.es-component .es-filter-tab {
	border: none;
	background: transparent;
	border-radius: 12px;
	padding: 12px 26px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	color: #667085;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 8px;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	position: relative;
	will-change: transform, background, color, box-shadow;
}

.es-component .es-filter-tab .es-tab-icon {
	font-size: 16px;
	line-height: 1;
	transition: transform 0.3s ease;
}

.es-component .es-filter-tab:hover:not(.active) {
	background: rgba(var(--es-primary-rgb), 0.08);
	color: var(--es-primary);
}

.es-component .es-filter-tab:hover:not(.active) .es-tab-icon {
	transform: scale(1.2) rotate(-8deg);
}

.es-component .es-filter-tab.active {
	background: linear-gradient(135deg, var(--es-primary), var(--es-primary-dark));
	color: #fff;
	box-shadow: 0 6px 20px rgba(var(--es-primary-rgb), 0.4);
}

.es-component .es-filter-tab:active { transform: scale(0.96); }

@media (max-width: 420px) {
	.es-component .es-filter-tab {
		padding: 10px 16px;
		font-size: 13.5px;
	}
	.es-component .es-filter-tab .es-tab-icon { font-size: 14px; }
}

/* ===== الخط الفاصل ===== */
.es-component .es-line {
	border-bottom: 2px solid var(--es-primary);
	width: 300px;
	max-width: 80vw;
	margin: 1.6rem auto 1.8rem;
	transition: border-color 0.4s ease;
}

@media (min-width: 900px) {
	.es-component .es-line {
		width: 520px;
		max-width: 70vw;
		margin: 2rem auto 2rem;
	}
}

/* ===== حاوية البطاقات ===== */
.es-component .es-courses-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 30px;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
}

@media (min-width: 768px) {
	.es-component .es-courses-container {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		padding: 0 var(--es-side-padding);
		gap: var(--es-cards-gap);
		max-width: 100%;
	}
	.es-component .es-courses-container .es-card {
		/* 3 بطاقات متساوية تملأ عرض الصف كاملاً كحد أقصى — الزيادة تنتقل لصف جديد.
		   بلا سقف عرض: على الشاشات الكبيرة تكبر البطاقات كما كانت قبل تقيد 3 في الصف */
		flex: 0 0 calc((100% - var(--es-cards-gap) * 2) / 3);
		min-width: 0;
		max-width: none;
	}
}

/* ===== إخفاء البطاقات المصفاة ===== */
.es-component .es-card.es-filter-hidden { display: none !important; }

/* ===== حاوية بطاقات المواد (أسفل فلاتر المواد، معزولة عن بطاقات الصفوف) ===== */
.es-component .es-subject-courses-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 30px;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
}

@media (min-width: 768px) {
	.es-component .es-subject-courses-container {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		gap: var(--es-cards-gap);
		padding: 0 var(--es-side-padding);
		max-width: 100%;
	}
	.es-component .es-subject-courses-container .es-card {
		/* بنفس قواعد بطاقات الصفوف حرفياً في كل العروض — 3 تملأ الصف كحد أقصى والزيادة تلتف */
		flex: 0 0 calc((100% - var(--es-cards-gap) * 2) / 3);
		min-width: 0;
		max-width: none;
	}
}

/* ===== البطاقة ===== */
.es-component .es-card {
	max-width: 380px;
	width: 100%;
	border-radius: var(--es-radius);
	overflow: hidden;
	box-shadow: var(--es-shadow);
	background: var(--es-card-bg);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	position: relative;
	animation: es-card-appear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
	will-change: transform, box-shadow;
	border: 1px solid rgba(var(--es-primary-rgb), 0.08);
}

.es-component .es-card:hover {
	transform: translateY(-6px) scale(1.02);
	box-shadow: var(--es-shadow-hover), 0 0 40px rgba(var(--es-primary-rgb), 0.18);
}

.es-component .es-card-image-wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #eef3ff;
	cursor: pointer;
}

.es-component .es-card-image-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	position: relative;
	z-index: 1;
	transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.7s ease;
	will-change: transform, filter;
	background-color: #eef3ff;
}

.es-component .es-card-image-wrapper img[loading="lazy"] {
	opacity: 0;
	animation: es-fade-in 0.6s ease forwards;
}

.es-component .es-card-image-wrapper.es-image-error img { display: none; }

@keyframes es-fade-in { to { opacity: 1; } }

.es-component .es-card-image-wrapper::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.5) 100%);
	z-index: 2;
	pointer-events: none;
	transition: opacity 0.5s ease;
	opacity: 0.6;
	will-change: opacity;
}

.es-component .es-card:hover .es-card-image-wrapper::before { opacity: 0.9; }

.es-component .es-card:hover .es-card-image-wrapper img,
.es-component .es-card:active .es-card-image-wrapper img {
	transform: scale(1.12);
	filter: brightness(0.85) saturate(1.2);
}

.es-component .es-card-image-wrapper::after {
	content: '';
	position: absolute;
	top: -100%;
	left: -100%;
	width: 80%;
	height: 250%;
	background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 40%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0.25) 60%, rgba(255,255,255,0) 100%);
	transform: rotate(8deg);
	z-index: 3;
	pointer-events: none;
	transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	opacity: 0;
	will-change: transform, opacity, left, top;
}

.es-component .es-card:hover .es-card-image-wrapper::after {
	left: 100%;
	top: 100%;
	opacity: 1;
}

/* ===== زر التشغيل ===== */
.es-component .es-play-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 4;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.4s ease;
	will-change: opacity;
}

.es-component .es-card:hover .es-play-overlay,
.es-component .es-card:active .es-play-overlay { opacity: 1; }

.es-component .es-play-icon {
	width: 64px;
	height: 64px;
	background: rgba(var(--es-primary-rgb), 0.92);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 30px rgba(var(--es-primary-rgb), 0.6), 0 4px 20px rgba(0, 0, 0, 0.5);
	transform: scale(0.7);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
	animation: es-pulse-icon 2s infinite ease-in-out;
	will-change: transform, box-shadow;
}

.es-component .es-card:hover .es-play-icon {
	transform: scale(1);
	box-shadow: 0 0 50px rgba(var(--es-primary-rgb), 0.8), 0 8px 30px rgba(0, 0, 0, 0.6);
}

.es-component .es-play-icon svg {
	width: 28px;
	height: 28px;
	color: #fff;
	margin-left: 3px;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes es-pulse-icon {
	0%, 100% { box-shadow: 0 0 30px rgba(var(--es-primary-rgb), 0.6), 0 4px 20px rgba(0, 0, 0, 0.5); }
	50% { box-shadow: 0 0 55px rgba(var(--es-primary-rgb), 0.9), 0 8px 30px rgba(0, 0, 0, 0.6); }
}

/* ===== الحدود المتوهجة ===== */
.es-component .es-glow-border {
	position: absolute;
	inset: 0;
	border-radius: 0;
	pointer-events: none;
	z-index: 5;
	opacity: 0;
	transition: opacity 0.5s ease;
	box-shadow: inset 0 0 40px rgba(var(--es-primary-rgb), 0.3), inset 0 0 80px rgba(var(--es-primary-rgb), 0.1);
	will-change: opacity;
}

.es-component .es-card:hover .es-glow-border,
.es-component .es-card:active .es-glow-border { opacity: 1; }

/* ===== زر الأرشفة ===== */
.es-component .es-bookmark-btn {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 42px;
	height: 42px;
	background: rgba(var(--es-primary-rgb), 0.9);
	border: none;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition: all 0.25s ease;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	will-change: transform, background, box-shadow;
	padding: 0;
}

.es-component .es-bookmark-btn:hover {
	transform: scale(1.15) rotate(5deg);
	background: var(--es-primary-dark);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--es-primary-rgb), 0.5);
}

.es-component .es-bookmark-btn.bookmarked {
	background: rgba(255, 152, 0, 0.95) !important;
	box-shadow: 0 4px 16px rgba(255, 152, 0, 0.5);
	animation: es-bookmark-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes es-bookmark-pop {
	0% { transform: scale(0.8); }
	50% { transform: scale(1.25); }
	100% { transform: scale(1); }
}

.es-component .es-bookmark-btn svg {
	width: 22px;
	height: 22px;
	color: #fff;
	transition: transform 0.3s ease;
}

.es-component .es-bookmark-btn.bookmarked svg { animation: es-bounce-icon 0.5s ease; }

@keyframes es-bounce-icon {
	0% { transform: scale(1); }
	30% { transform: scale(1.4) rotate(-10deg); }
	60% { transform: scale(0.9) rotate(5deg); }
	100% { transform: scale(1); }
}

/* ===== زر تطبيق App Store (بطاقات المواد — بديل زر الأرشفة) =====
   بنفس تصميم زر الأرشفة تماماً: مربع 42×42 باللون الأساسي وأيقونة بيضاء. */
.es-component .es-playstore-btn {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 42px;
	height: 42px;
	padding: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(var(--es-primary-rgb), 0.9);
	border: none;
	border-radius: 12px;
	text-decoration: none;
	cursor: pointer;
	z-index: 10;
	transition: all 0.25s ease;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	will-change: transform, background, box-shadow;
}

.es-component .es-playstore-btn:hover {
	transform: scale(1.15) rotate(5deg);
	background: var(--es-primary-dark);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--es-primary-rgb), 0.5);
}

.es-component .es-playstore-btn:active { transform: scale(0.96); }

.es-component .es-playstore-btn svg {
	width: 22px;
	height: 22px;
	display: block;
	flex-shrink: 0;
	color: #fff;
	transition: transform 0.3s ease;
}

.es-component .es-playstore-btn:hover svg { transform: scale(1.08); }

/* ===== تذييل البطاقة ===== */
.es-component .es-card-footer {
	background: var(--es-card-bg);
	padding: 18px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	border-top: 1px solid rgba(var(--es-primary-rgb), 0.08);
	position: relative;
	z-index: 6;
}

.es-component .es-start-btn {
	background: linear-gradient(135deg, var(--es-primary), var(--es-primary-dark));
	color: #fff;
	border: none;
	border-radius: 14px;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	box-shadow: 0 4px 16px rgba(var(--es-primary-rgb), 0.4);
	white-space: nowrap;
	font-family: inherit;
	position: relative;
	overflow: hidden;
	z-index: 20;
	pointer-events: auto;
	will-change: transform, box-shadow;
}

.es-component .es-start-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 100%);
	border-radius: 14px;
	transition: opacity 0.3s ease;
	opacity: 0;
	will-change: opacity;
}

.es-component .es-start-btn:hover::before { opacity: 1; }

.es-component .es-start-btn:hover {
	transform: translateY(-3px) scale(1.04);
	box-shadow: 0 8px 28px rgba(var(--es-primary-rgb), 0.55), 0 0 30px rgba(var(--es-primary-rgb), 0.3);
}

.es-component .es-start-btn:active {
	transform: translateY(0) scale(0.96);
	box-shadow: 0 2px 10px rgba(var(--es-primary-rgb), 0.35);
	transition-duration: 0.1s;
}

.es-component .es-start-btn svg {
	width: 16px;
	height: 16px;
	transition: transform 0.3s ease;
	will-change: transform;
}

.es-component .es-start-btn:hover svg { transform: translateX(-4px); }

.es-component .es-card-title {
	font-size: 18px;
	font-weight: 800;
	color: #1a1a1a;
	margin: 0;
	white-space: nowrap;
	letter-spacing: -0.3px;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

/* ===== شارة الكورس ===== */
.es-component .es-course-badge {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 10;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 6px 12px;
	border-radius: 20px;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	gap: 5px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	pointer-events: none;
}

.es-component .es-course-badge .es-dot {
	width: 6px;
	height: 6px;
	background: #4caf50;
	border-radius: 50%;
	animation: es-blink-dot 1.5s infinite;
}

@keyframes es-blink-dot {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.4; transform: scale(0.7); }
}

/* ===== اللمس على الجوال ===== */
@media (hover: none) and (pointer: coarse) {
	.es-component .es-card:active .es-card-image-wrapper img {
		transform: scale(1.08);
		filter: brightness(0.8);
	}
	.es-component .es-card:active .es-play-overlay { opacity: 1; }
	.es-component .es-card:active .es-play-icon { transform: scale(1); }
	.es-component .es-card:active .es-card-image-wrapper::after {
		left: 100%;
		top: 100%;
		opacity: 1;
		transition: all 0.7s ease;
	}
}

@keyframes es-card-appear {
	0% { opacity: 0; transform: translateY(40px) scale(0.9); }
	60% { opacity: 1; transform: translateY(-5px) scale(1.01); }
	100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes es-pulse {
	0% { box-shadow: 0 0 0 0 rgba(var(--es-primary-rgb), 0.4); }
	70% { box-shadow: 0 0 0 12px rgba(var(--es-primary-rgb), 0); }
	100% { box-shadow: 0 0 0 0 rgba(var(--es-primary-rgb), 0); }
}

.es-component .es-main-title.es-pulse { animation: es-pulse 0.6s ease; }

/* ===== التنبيهات (Toast) ===== */
.es-component .es-toast-notification {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%) translateY(80px);
	background: rgba(15, 23, 42, 0.95);
	color: #fff;
	padding: 14px 24px;
	border-radius: 14px;
	font-family: 'Segoe UI', Tahoma, sans-serif;
	font-size: 14px;
	font-weight: 600;
	z-index: 9999;
	box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(var(--es-primary-rgb), 0.25);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255,255,255,0.1);
	letter-spacing: 0.3px;
	opacity: 0;
	transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
	pointer-events: none;
	white-space: nowrap;
	max-width: 90vw;
	overflow: hidden;
	text-overflow: ellipsis;
	will-change: transform, opacity;
}

/* ===== مودال التأكيد ===== */
.es-component .es-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
	will-change: opacity, visibility;
}

.es-component .es-modal-overlay.active { opacity: 1; visibility: visible; }

.es-component .es-modal-box {
	background: linear-gradient(145deg, #ffffff, #f0f6ff);
	border-radius: 24px;
	padding: 32px 28px 24px;
	width: 90%;
	max-width: 420px;
	box-shadow: 0 24px 64px rgba(0,0,0,0.35), 0 0 0 1px rgba(var(--es-primary-rgb), 0.15);
	text-align: center;
	transform: scale(0.85) translateY(20px);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	position: relative;
	overflow: hidden;
	will-change: transform;
}

.es-component .es-modal-overlay.active .es-modal-box { transform: scale(1) translateY(0); }

.es-component .es-modal-box::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--es-primary), var(--es-primary-light), var(--es-primary));
	border-radius: 24px 24px 0 0;
}

.es-component .es-modal-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
	font-size: 28px;
	animation: es-modal-icon-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
	will-change: transform, opacity;
}

.es-component .es-modal-icon.save { background: rgba(var(--es-primary-rgb), 0.12); }
.es-component .es-modal-icon.delete { background: rgba(211, 47, 47, 0.1); }

@keyframes es-modal-icon-pop {
	0% { transform: scale(0); opacity: 0; }
	100% { transform: scale(1); opacity: 1; }
}

.es-component .es-modal-title {
	font-size: 20px;
	font-weight: 800;
	color: #1a1a1a;
	margin-bottom: 8px;
	letter-spacing: -0.3px;
}

.es-component .es-modal-body {
	font-size: 15px;
	color: #555;
	line-height: 1.7;
	margin-bottom: 24px;
}

.es-component .es-modal-body strong { color: var(--es-primary); }

.es-component .es-modal-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

.es-component .es-modal-btn {
	border: none;
	border-radius: 14px;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
	font-family: inherit;
	min-width: 110px;
	will-change: transform;
}

.es-component .es-modal-btn:hover { transform: translateY(-2px); }
.es-component .es-modal-btn:active { transform: translateY(0) scale(0.96); }

.es-component .es-modal-btn-primary {
	background: linear-gradient(135deg, var(--es-primary), var(--es-primary-dark));
	color: #fff;
	box-shadow: 0 4px 16px rgba(var(--es-primary-rgb), 0.35);
}

.es-component .es-modal-btn-primary:hover { box-shadow: 0 6px 20px rgba(var(--es-primary-rgb), 0.5); }

.es-component .es-modal-btn-secondary { background: rgba(0,0,0,0.05); color: #444; }
.es-component .es-modal-btn-secondary:hover { background: rgba(0,0,0,0.1); }

.es-component .es-modal-btn-danger {
	background: linear-gradient(135deg, #d32f2f, #b71c1c);
	color: #fff;
	box-shadow: 0 4px 16px rgba(211, 47, 47, 0.3);
}

.es-component .es-modal-btn-danger:hover { box-shadow: 0 6px 20px rgba(211, 47, 47, 0.45); }

/* ===== عنصر بديل للصورة ===== */
.es-component .es-image-placeholder {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #eef3ff, #dbe6ff);
	z-index: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.es-component .es-image-placeholder::after {
	content: '📚';
	font-size: 40px;
	opacity: 0.35;
	animation: es-pulse-icon-placeholder 1.5s infinite ease-in-out;
}

@keyframes es-pulse-icon-placeholder {
	0%, 100% { opacity: 0.35; }
	50% { opacity: 0.55; }
}

.es-component .es-card-image-wrapper img.loaded + .es-image-placeholder {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.5s ease;
}

/* ===== قسم المواد الدراسية (كتلة مستقلة فوق البطاقات الرئيسية) ===== */
.es-component .es-subject-section {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	/* المسافة بين بطاقات الصفوف وقسم المواد — تُضبط من إعدادات المكون (افتراضي 70px) */
	margin-top: var(--es-subject-gap, 70px);
	margin-bottom: 1.4rem;
}

.es-component .es-subject-section.es-subjects-empty { display: none; }

/* رأس قسم المواد (الصورة + الفلاتر معاً) */
.es-component .es-subject-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.2rem;
	width: 100%;
	max-width: 1200px;
	padding: 0 20px;
	margin: 0 auto;
	background: transparent;
}

@media (min-width: 900px) {
	.es-component .es-subject-header {
		flex-direction: row;
		justify-content: center;
		align-items: center;
		gap: 2.5rem;
		flex-wrap: nowrap;
	}
}

.es-component .es-subject-title {
	display: inline-block;
	margin: 0;
	background: transparent;
	font-size: 0;
	line-height: 0;
}

.es-component .es-subject-logo {
	display: block;
	max-width: 260px;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

/* فلاتر المواد: تشارك فئة es-filter-tabs فترث نفس تصميم فلاتر المراحل تماماً */
.es-component .es-subject-filters {
	flex-wrap: wrap;
	justify-content: center;
	max-width: 100%;
}

/* ===== سلايدر فلاتر المواد (يُفعّل تلقائياً عند تجاوز عدد المواد 3) =====
   يحافظ على صف واحد ثابت مهما زاد عدد المواد، فلا يؤثر على حجم صورة القسم */
.es-component .es-subject-slider { display: contents; }

.es-component .es-subject-slider.es-slider-on {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	/* حتى 3 مواد متجاورة على الشاشات الكبيرة (640px تتسع لـ 3 أزرار
	بأسماء حقيقية حتى ~180px لكل زر، وتتكيف مع الأسماء الأطول) */
	max-width: 640px;
	min-width: 0;
}

.es-component .es-slider-on .es-subject-filters {
	flex: 1 1 auto;
	min-width: 0;
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	justify-content: flex-start;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	/* بلا حشو جانبي: نقطة التثبيت الأولى = الصفر تماماً فلا تعلق الأسهم عند البداية */
	padding: 6px 0;
}
.es-component .es-slider-on .es-subject-filters::-webkit-scrollbar { display: none; }

.es-component .es-slider-on .es-subject-filters .es-filter-tab {
	/* عرض طبيعي حسب اسم المادة — لا يُقصّ أي اسم إطلاقاً */
	flex: 0 0 auto;
	/* start: نقطة التثبيت عند حافة الزر لتتطابق مع تنقّل الصفحات بالضبط */
	scroll-snap-align: start;
	white-space: nowrap;
	/* حماية نادرة من اسم طويل جداً جداً: أقصى عرض ثم قصّ بنقاط */
	max-width: calc(100% - 16px);
	overflow: hidden;
	text-overflow: ellipsis;
}

.es-component .es-slider-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	padding: 0;
	margin: 0;
	border-radius: 50%;
	border: 1px solid rgba(var(--es-primary-rgb), 0.25);
	background: #fff;
	color: var(--es-primary);
	cursor: pointer;
	z-index: 6;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
	transition: all 0.25s ease;
}
.es-component .es-slider-btn svg { width: 18px; height: 18px; display: block; }
.es-component .es-slider-btn:hover {
	background: var(--es-primary);
	color: #fff;
	border-color: var(--es-primary);
	box-shadow: 0 6px 20px rgba(var(--es-primary-rgb), 0.4);
	transform: scale(1.08);
}
.es-component .es-slider-btn:active { transform: scale(0.95); }
.es-component .es-slider-btn:disabled {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
	box-shadow: none;
	transform: none;
}

@media (max-width: 600px) {
	.es-component .es-subject-slider.es-slider-on { gap: 6px; }
	.es-component .es-slider-btn { width: 30px; height: 30px; }
	.es-component .es-slider-btn svg { width: 15px; height: 15px; }
}

/* صورة المادة في مقدمة زر الفلتر */
.es-component .es-filter-tab .es-subject-img {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(var(--es-primary-rgb), 0.18);
	flex-shrink: 0;
	background: #eef3ff;
	transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.es-component .es-filter-tab:hover .es-subject-img { transform: scale(1.1); }

.es-component .es-filter-tab.active .es-subject-img {
	border-color: rgba(255, 255, 255, 0.8);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.es-component .es-subject-tab.es-subject-hidden { display: none !important; }

@media (max-width: 600px) {
	.es-component .es-subject-filters {
		flex-wrap: nowrap; overflow-x: auto;
		justify-content: flex-start; max-width: 100%;
		padding: 6px 10px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
	}
}

/* ===== رسالة المحررين ===== */
.es-component .es-admin-notice {
	width: 100%;
	max-width: 760px;
	margin-top: 20px;
	padding: 16px 20px;
	border: 2px dashed rgba(var(--es-primary-rgb), 0.4);
	border-radius: 14px;
	background: rgba(var(--es-primary-rgb), 0.05);
	color: #444;
	font-size: 14px;
	text-align: center;
}

/* ===== إلغاء توهير اللمس ===== */
.es-component .es-card,
.es-component .es-card-footer,
.es-component .es-start-btn,
.es-component .es-bookmark-btn,
.es-component .es-playstore-btn,
.es-component .es-filter-tab {
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}
