/**
 * EduNexa — ادونکسا
 * Widget: Courses Showcase with Curved Header Banner (ویترین بنری دوره‌های جدید)
 *
 * @package           EduNexa
 * @subpackage        Elementor\Widgets
 * @author            امیر حسین بناوند (Amir Hossein Banavand)
 * @link              https://npocto.ir
 * @since             1.1.0
 */

/* ==========================================================================
   1. MAIN SHOWCASE CONTAINER
   ========================================================================== */
.edunexa-courses-showcase {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	direction: rtl;
	margin-bottom: 40px;
}

/* ==========================================================================
   2. CURVED BANNER CONTAINER (کادر بنر منحنی بالایی)
   ========================================================================== */
.edunexa-showcase-banner {
	position: relative;
	background: linear-gradient(135deg, #2b49c4 0%, #1e369b 100%);
	border-radius: 28px;
	padding: 32px 36px 140px 36px;
	overflow: hidden;
	box-shadow: 0 16px 40px rgba(33, 57, 160, 0.22);
}

/* Translucent Decorative Curves/Rays in Banner */
.edunexa-showcase-banner::before {
	content: '';
	position: absolute;
	top: -60px;
	left: -60px;
	width: 240px;
	height: 240px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
	pointer-events: none;
	z-index: 1;
}

.edunexa-showcase-banner::after {
	content: '';
	position: absolute;
	top: -80px;
	right: 15%;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(250, 178, 55, 0.15) 0%, rgba(250, 178, 55, 0) 70%);
	pointer-events: none;
	z-index: 1;
}

/* Subtle abstract wave overlay */
.edunexa-showcase-banner-wave {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 85% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
	pointer-events: none;
	z-index: 1;
}

/* ==========================================================================
   3. BANNER HEADER ROW (ردیف هدر: عنوان، خط میانی، دکمه‌ها)
   ========================================================================== */
.edunexa-showcase-header {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

/* --- Right Side: Title Wrap --- */
.edunexa-showcase-title-wrap {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
}

/* Vertical Accent Bar with Gold Marker */
.edunexa-showcase-accent-bar {
	position: relative;
	width: 3px;
	height: 44px;
	background: rgba(255, 255, 255, 0.85);
	border-radius: 2px;
	flex-shrink: 0;
}

.edunexa-showcase-accent-marker {
	position: absolute;
	bottom: -4px;
	right: -3px;
	width: 9px;
	height: 9px;
	background: #fab237;
	border-radius: 2px;
	box-shadow: 0 0 10px rgba(250, 178, 55, 0.7);
}

.edunexa-showcase-title-content {
	display: flex;
	flex-direction: column;
}

/* Decorative rays over main title */
.edunexa-showcase-title-rays {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	margin-bottom: 2px;
	line-height: 1;
}

.edunexa-showcase-title-rays svg {
	width: 24px;
	height: 14px;
	color: #fab237;
	fill: currentColor;
}

.edunexa-showcase-main-title {
	margin: 0;
	padding: 0;
	font-size: 1.55rem;
	font-weight: 800;
	line-height: 1.35;
	color: #ffffff;
	letter-spacing: -0.02em;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.edunexa-title-prefix {
	color: #ffffff;
}

.edunexa-title-highlight {
	color: #fab237;
	position: relative;
	text-shadow: 0 2px 10px rgba(250, 178, 55, 0.3);
}

.edunexa-showcase-subtitle {
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	color: #93c5fd;
	text-transform: uppercase;
	margin-top: 3px;
	opacity: 0.9;
}

/* --- Center: Decorative Line with Diamond --- */
.edunexa-showcase-center-divider {
	flex-grow: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 16px;
	min-width: 60px;
}

.edunexa-divider-line {
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 20%, rgba(255, 255, 255, 0.25) 80%, transparent 100%);
	width: 100%;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.edunexa-divider-diamond {
	width: 8px;
	height: 8px;
	background: rgba(255, 255, 255, 0.65);
	transform: rotate(45deg);
	border: 1px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* --- Left Side: Actions (View All + Nav Arrows) --- */
.edunexa-showcase-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

/* "مشاهده همه" View All Button */
.edunexa-showcase-view-all-btn {
	background: #ffffff;
	color: #d97706;
	font-size: 0.85rem;
	font-weight: 700;
	padding: 8px 20px;
	border-radius: 999px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	border: 1px solid rgba(255, 255, 255, 0.8);
}

.edunexa-showcase-view-all-btn:hover {
	background: #fab237;
	color: #0f172a;
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(250, 178, 55, 0.4);
	border-color: #fab237;
}

/* Separator between View All and Nav Buttons */
.edunexa-showcase-actions-sep {
	width: 1px;
	height: 24px;
	background: rgba(255, 255, 255, 0.25);
}

/* Nav Circular Arrow Buttons */
.edunexa-showcase-nav-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.08);
	border: 1.5px solid rgba(255, 255, 255, 0.35);
	color: #ffffff;
	cursor: pointer;
	transition: all 0.25s ease;
	padding: 0;
	user-select: none;
}

.edunexa-showcase-nav-btn svg {
	width: 18px;
	height: 18px;
	transition: transform 0.2s ease;
}

.edunexa-showcase-nav-btn:hover {
	background: #ffffff;
	border-color: #ffffff;
	color: #203aa1;
	transform: scale(1.06);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.edunexa-showcase-nav-btn:active {
	transform: scale(0.95);
}

.edunexa-showcase-nav-btn:disabled,
.edunexa-showcase-nav-btn.disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

/* ==========================================================================
   4. CARDS CONTAINER (ناحیه هم‌پوشانی کارت‌ها روی بنر)
   ========================================================================== */
.edunexa-showcase-cards-wrapper {
	position: relative;
	z-index: 5;
	margin-top: -105px;
	padding: 0 24px;
	box-sizing: border-box;
}

.edunexa-showcase-cards-track {
	display: flex;
	gap: 22px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding: 10px 4px 30px 4px;
	margin: 0;
	list-style: none;
	box-sizing: border-box;
	user-select: none;
}

.edunexa-showcase-cards-track::-webkit-scrollbar {
	display: none;
}

/* Grid Mode Fallback */
.edunexa-courses-showcase.is-grid .edunexa-showcase-cards-track {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	overflow: visible;
}

/* Slide Width in Carousel */
.edunexa-showcase-slide {
	flex: 0 0 calc(33.333% - 15px);
	min-width: calc(33.333% - 15px);
	max-width: calc(33.333% - 15px);
	scroll-snap-align: start;
	box-sizing: border-box;
	display: flex;
}

/* ==========================================================================
   5. COURSE CARD (کارت دوره دقیقاً شبیه تصویر)
   ========================================================================== */
.edunexa-sc-card {
	width: 100%;
	background: #ffffff;
	border-radius: 22px;
	border: 1px solid #eef2f6;
	padding: 14px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
	position: relative;
	overflow: hidden;
}

.edunexa-sc-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 20px 45px rgba(25, 45, 140, 0.14);
}

/* Highlighted / Middle Card (کارت هایلایت شده - کادر آبی دقیقاً مثل تصویر!) */
.edunexa-sc-card.is-highlighted {
	border: 2px solid #2b49c4;
	box-shadow: 0 14px 36px rgba(43, 73, 196, 0.16);
}

.edunexa-sc-card.is-highlighted .edunexa-sc-card-title a {
	color: #2542b8;
}

/* --- Card Thumbnail --- */
.edunexa-sc-thumb-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9.5;
	border-radius: 16px;
	overflow: hidden;
	background: #0f172a;
	margin-bottom: 14px;
	flex-shrink: 0;
}

.edunexa-sc-thumb-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.edunexa-sc-card:hover .edunexa-sc-thumb-wrap img {
	transform: scale(1.06);
}

.edunexa-sc-placeholder-thumb {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Badges on Thumbnail */
/* Right Badge: Status ("فعال") */
.edunexa-sc-badge-status {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	background: #22c55e;
	color: #ffffff;
	font-size: 0.72rem;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Left Badge: Category ("دیجیتال مارکتینگ", "برنامه نویسی") */
.edunexa-sc-badge-category {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	background: rgba(255, 255, 255, 0.95);
	color: #334155;
	font-size: 0.72rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	backdrop-filter: blur(6px);
	border: 1px solid rgba(226, 232, 240, 0.9);
	display: inline-flex;
	align-items: center;
	gap: 5px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	text-decoration: none;
	transition: all 0.2s ease;
}

.edunexa-sc-badge-category:hover {
	background: #ffffff;
	color: #2542b8;
}

.edunexa-sc-badge-category svg {
	width: 13px;
	height: 13px;
	color: #64748b;
}

/* --- Card Body --- */
.edunexa-sc-card-body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

/* Meta Row 1: Duration, Students & Rating (بالای عنوان) */
.edunexa-sc-meta-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
	font-size: 0.78rem;
}

.edunexa-sc-meta-info-group {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: #64748b;
}

.edunexa-sc-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.edunexa-sc-meta-item svg {
	width: 15px;
	height: 15px;
	color: #94a3b8;
}

/* Rating Badge: Yellow Pill "★ ۳.۰" */
.edunexa-sc-rating-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: rgba(250, 178, 55, 0.16);
	color: #d97706;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 0.76rem;
	font-weight: 800;
}

.edunexa-sc-rating-pill svg {
	width: 13px;
	height: 13px;
	color: #fab237;
	fill: currentColor;
}

/* Course Title */
.edunexa-sc-card-title {
	margin: 0 0 14px 0;
	padding: 0;
	font-size: 1.02rem;
	font-weight: 800;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 3em;
}

.edunexa-sc-card-title a {
	color: #1e293b;
	text-decoration: none;
	transition: color 0.2s ease;
}

.edunexa-sc-card-title a:hover {
	color: #2542b8;
}

/* Dashed Separator Line */
.edunexa-sc-dashed-divider {
	border: none;
	border-top: 1px dashed #e2e8f0;
	margin: 0 0 14px 0;
}

/* --- Instructor & Price Row --- */
.edunexa-sc-instructor-price-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 14px;
	margin-top: auto;
}

/* Instructor Section */
.edunexa-sc-instructor-box {
	display: flex;
	align-items: center;
	gap: 9px;
}

.edunexa-sc-instructor-avatars {
	display: flex;
	align-items: center;
	position: relative;
}

.edunexa-sc-instructor-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #ffffff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
	background: #f1f5f9;
}

/* Overlapping Second Avatar */
.edunexa-sc-instructor-avatar + .edunexa-sc-instructor-avatar {
	margin-right: -14px;
}

.edunexa-sc-instructor-details {
	display: flex;
	flex-direction: column;
}

.edunexa-sc-instructor-name {
	font-size: 0.8rem;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.3;
}

.edunexa-sc-instructor-extra {
	font-size: 0.68rem;
	color: #94a3b8;
	font-weight: 500;
	margin-top: 2px;
}

/* Price Section */
.edunexa-sc-price-box {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
}

.edunexa-sc-price-sale-row {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 2px;
}

.edunexa-sc-discount-percent {
	background: #ef4444;
	color: #ffffff;
	font-size: 0.68rem;
	font-weight: 800;
	padding: 1px 6px;
	border-radius: 4px;
	line-height: 1.3;
	box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.edunexa-sc-regular-price {
	font-size: 0.74rem;
	color: #94a3b8;
	text-decoration: line-through;
}

.edunexa-sc-current-price-wrap {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
}

.edunexa-sc-current-price {
	font-size: 1.05rem;
	font-weight: 800;
	color: #2542b8;
	letter-spacing: -0.02em;
}

.edunexa-sc-price-unit {
	font-size: 0.72rem;
	color: #64748b;
	font-weight: 600;
}

/* Free Course Styling */
.edunexa-sc-price-free {
	font-size: 1.08rem;
	font-weight: 800;
	color: #2542b8;
}

/* ==========================================================================
   6. ENROLL BUTTON (دکمه گرد ثبت‌نام در دوره)
   ========================================================================== */
.edunexa-sc-enroll-btn {
	width: 100%;
	height: 46px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 5px 6px 5px 16px;
	box-sizing: border-box;
	text-decoration: none;
	transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
	border: none;
	cursor: pointer;
	user-select: none;
}

/* Amber/Gold Button (default for Card 1 & 3) */
.edunexa-sc-btn-amber {
	background: linear-gradient(135deg, #fab237 0%, #f59e0b 100%);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.edunexa-sc-btn-amber:hover {
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(245, 158, 11, 0.45);
}

.edunexa-sc-btn-amber .edunexa-sc-btn-icon-circle {
	background: #ffffff;
	color: #f59e0b;
}

/* Royal Blue Button (default for Card 2 / Highlighted) */
.edunexa-sc-btn-blue {
	background: linear-gradient(135deg, #2b49c4 0%, #1e369b 100%);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(43, 73, 196, 0.35);
}

.edunexa-sc-btn-blue:hover {
	background: linear-gradient(135deg, #1e369b 0%, #172b80 100%);
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(43, 73, 196, 0.45);
}

.edunexa-sc-btn-blue .edunexa-sc-btn-icon-circle {
	background: #ffffff;
	color: #2b49c4;
}

/* Button Internals */
.edunexa-sc-btn-icon-circle {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	transition: transform 0.25s ease;
}

.edunexa-sc-btn-icon-circle svg {
	width: 17px;
	height: 17px;
}

.edunexa-sc-enroll-btn:hover .edunexa-sc-btn-icon-circle {
	transform: scale(1.08);
}

.edunexa-sc-btn-label {
	font-size: 0.88rem;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: -0.01em;
}

.edunexa-sc-btn-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.9);
	transition: transform 0.25s ease;
}

.edunexa-sc-btn-arrow svg {
	width: 16px;
	height: 16px;
}

.edunexa-sc-enroll-btn:hover .edunexa-sc-btn-arrow {
	transform: translateX(-4px);
}

/* ==========================================================================
   7. RESPONSIVE BREAKPOINTS (موبایل و تبلت)
   ========================================================================== */
@media (max-width: 1024px) {
	.edunexa-showcase-slide {
		flex: 0 0 calc(50% - 11px);
		min-width: calc(50% - 11px);
		max-width: calc(50% - 11px);
	}
	.edunexa-courses-showcase.is-grid .edunexa-showcase-cards-track {
		grid-template-columns: repeat(2, 1fr);
	}
	.edunexa-showcase-center-divider {
		display: none;
	}
	.edunexa-showcase-banner {
		padding: 28px 24px 130px 24px;
	}
	.edunexa-showcase-cards-wrapper {
		padding: 0 16px;
	}
}

@media (max-width: 768px) {
	.edunexa-showcase-header {
		flex-wrap: wrap;
		gap: 16px;
	}
	.edunexa-showcase-title-wrap {
		width: 100%;
		justify-content: space-between;
	}
	.edunexa-showcase-actions {
		width: 100%;
		justify-content: space-between;
	}
	.edunexa-showcase-main-title {
		font-size: 1.25rem;
	}
	.edunexa-showcase-slide {
		flex: 0 0 84%;
		min-width: 84%;
		max-width: 84%;
	}
	.edunexa-courses-showcase.is-grid .edunexa-showcase-cards-track {
		grid-template-columns: 1fr;
	}
	.edunexa-showcase-banner {
		padding: 22px 18px 115px 18px;
		border-radius: 22px;
	}
	.edunexa-showcase-cards-wrapper {
		margin-top: -95px;
		padding: 0 10px;
	}
	.edunexa-showcase-cards-track {
		gap: 16px;
		padding-right: 4px;
		padding-left: 20px;
	}
	.edunexa-sc-card {
		padding: 12px;
		border-radius: 18px;
	}
}

@media (max-width: 420px) {
	.edunexa-showcase-slide {
		flex: 0 0 92%;
		min-width: 92%;
		max-width: 92%;
	}
	.edunexa-showcase-main-title {
		font-size: 1.15rem;
	}
	.edunexa-showcase-view-all-btn {
		font-size: 0.78rem;
		padding: 7px 14px;
	}
}

/* ==========================================================================
   8. DARK THEME SUPPORT (تم تیره)
   ========================================================================== */
[data-theme="dark"] .edunexa-sc-card,
.dark-theme .edunexa-sc-card,
body.dark-mode .edunexa-sc-card {
	background: #19212E;
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .edunexa-sc-card.is-highlighted,
.dark-theme .edunexa-sc-card.is-highlighted,
body.dark-mode .edunexa-sc-card.is-highlighted {
	border-color: #3b82f6;
	box-shadow: 0 14px 40px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .edunexa-sc-card-title a,
.dark-theme .edunexa-sc-card-title a,
body.dark-mode .edunexa-sc-card-title a {
	color: #f1f5f9;
}

[data-theme="dark"] .edunexa-sc-card.is-highlighted .edunexa-sc-card-title a,
.dark-theme .edunexa-sc-card.is-highlighted .edunexa-sc-card-title a,
body.dark-mode .edunexa-sc-card.is-highlighted .edunexa-sc-card-title a {
	color: #60a5fa;
}

[data-theme="dark"] .edunexa-sc-instructor-name,
.dark-theme .edunexa-sc-instructor-name,
body.dark-mode .edunexa-sc-instructor-name {
	color: #f1f5f9;
}

[data-theme="dark"] .edunexa-sc-dashed-divider,
.dark-theme .edunexa-sc-dashed-divider,
body.dark-mode .edunexa-sc-dashed-divider {
	border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .edunexa-sc-badge-category,
.dark-theme .edunexa-sc-badge-category,
body.dark-mode .edunexa-sc-badge-category {
	background: rgba(30, 41, 59, 0.85);
	color: #cbd5e1;
	border-color: rgba(255, 255, 255, 0.1);
}
