/**
 * EduNexa — ادونکسا
 * Dedicated Mobile Header Widget Styles (ویجت هدر اختصاصی موبایل)
 *
 * 1. Right: Hamburger Menu Trigger ("منو" + Asymmetric 3-Line or Solar Icon)
 * 2. Center: Brand Logo with Light Halo, Shimmer Sweep, Sparkle Twinkle Animations
 * 3. Left: Contact Call Button with Ringing Waves & Custom Actions
 *
 * @package EduNexa
 * @since   1.2.0
 */

.edunexa-mobile-header-wrap {
	--edunexa-mh-bg: #ffffff;
	--edunexa-mh-border: rgba(226, 232, 240, 0.85);
	--edunexa-mh-radius: 20px;
	--edunexa-mh-shadow: 0 8px 24px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.03);
	--edunexa-mh-min-height: 60px;
	--edunexa-mh-pad-y: 10px;
	--edunexa-mh-pad-x: 16px;

	--edunexa-mh-menu-color: #0f172a;
	--edunexa-mh-menu-hover-color: #FAB237;
	--edunexa-mh-menu-bg: transparent;
	--edunexa-mh-menu-hover-bg: #f8fafc;
	--edunexa-mh-menu-icon-size: 24px;
	--edunexa-mh-menu-font-size: 13.5px;

	--edunexa-mh-logo-w: auto;
	--edunexa-mh-logo-width: 135px;
	--edunexa-mh-logo-max-height: 44px;
	--edunexa-mh-logo-fit: contain;
	--edunexa-mh-center-max-w: 50%;
	--edunexa-mh-logo-glow: rgba(250, 178, 55, 0.45);
	--edunexa-mh-logo-beam: rgba(255, 255, 255, 0.92);
	--edunexa-mh-logo-anim-duration: 3.6s;
	--edunexa-mh-sticky-top: 0px;

	--edunexa-mh-call-color: #0f172a;
	--edunexa-mh-call-hover-color: #FAB237;
	--edunexa-mh-call-bg: transparent;
	--edunexa-mh-call-hover-bg: #f8fafc;
	--edunexa-mh-call-icon-size: 24px;
	--edunexa-mh-call-box-size: 40px;
	--edunexa-mh-call-radius: 12px;

	width: 100%;
	direction: rtl;
	font-family: inherit;
	box-sizing: border-box;
	position: relative;
	z-index: 998;
}

/* Mobile & Tablet Only Visibility Option */
@media (min-width: 1025px) {
	.edunexa-mobile-header-wrap.edunexa-mh-mobile-only {
		display: none !important;
	}
}

/* Sticky Mode with Smart Admin Bar & Topbar Offset Support */
.edunexa-mobile-header-wrap.edunexa-mh-is-sticky {
	position: sticky;
	top: var(--edunexa-mh-sticky-top, 0px);
	z-index: 999;
}

body.admin-bar .edunexa-mobile-header-wrap.edunexa-mh-is-sticky {
	top: calc(var(--edunexa-mh-sticky-top, 0px) + 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .edunexa-mobile-header-wrap.edunexa-mh-is-sticky {
		top: calc(var(--edunexa-mh-sticky-top, 0px) + 46px);
	}
}

/* Seamless Topbar Integration Mode */
.edunexa-mobile-header-wrap.edunexa-mh-seamless-topbar {
	margin-top: 0 !important;
}

.edunexa-mobile-header-wrap.edunexa-mh-seamless-topbar .edunexa-mh-bar {
	border-top-left-radius: 0 !important;
	border-top-right-radius: 0 !important;
	border-top: none !important;
}

/* Glassmorphism Mode */
.edunexa-mobile-header-wrap.edunexa-mh-is-glass .edunexa-mh-bar {
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

/* Main Rounded Header Bar */
.edunexa-mh-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: var(--edunexa-mh-min-height, 60px);
	padding: var(--edunexa-mh-pad-y, 10px) var(--edunexa-mh-pad-x, 16px);
	background: var(--edunexa-mh-bg, #ffffff);
	border: 1px solid var(--edunexa-mh-border, rgba(226, 232, 240, 0.85));
	border-radius: var(--edunexa-mh-radius, 20px);
	box-shadow: var(--edunexa-mh-shadow, 0 8px 24px rgba(15, 23, 42, 0.06));
	position: relative;
	box-sizing: border-box;
	overflow: hidden;
	gap: 8px;
}
}

/* Optional Subtle Ambient Top Border Shimmer on Header Bar */
.edunexa-mobile-header-wrap.edunexa-mh-bar-shimmer .edunexa-mh-bar::before {
	content: '';
	position: absolute;
	top: 0;
	left: -50%;
	width: 45%;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--edunexa-mh-logo-glow, #FAB237), transparent);
	animation: edunexaMhBarEdgeSweep 4.5s ease-in-out infinite;
	z-index: 10;
	pointer-events: none;
}

@keyframes edunexaMhBarEdgeSweep {
	0% { left: -65%; }
	60%, 100% { left: 125%; }
}

/* =========================================================================
   1. RIGHT: HAMBURGER MENU BUTTON
   ========================================================================= */
.edunexa-mh-right {
	display: flex;
	align-items: center;
	flex: 1 1 25%;
	justify-content: flex-start;
	min-width: 0;
}

.edunexa-mobile-header-wrap .edunexa-mh-menu-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--edunexa-mh-menu-bg, transparent);
	color: var(--edunexa-mh-menu-color, #0f172a);
	border: none;
	outline: none;
	padding: 8px 12px;
	border-radius: 12px;
	font-family: inherit;
	font-size: var(--edunexa-mh-menu-font-size, 13.5px);
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	-webkit-tap-highlight-color: transparent;
	line-height: 1;
}

.edunexa-mobile-header-wrap .edunexa-mh-menu-btn:hover,
.edunexa-mobile-header-wrap .edunexa-mh-menu-btn:focus-visible {
	background: var(--edunexa-mh-menu-hover-bg, #f8fafc);
	color: var(--edunexa-mh-menu-hover-color, #FAB237);
	transform: translateY(-1px);
}

.edunexa-mh-menu-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--edunexa-mh-menu-icon-size, 24px);
	height: var(--edunexa-mh-menu-icon-size, 24px);
	flex-shrink: 0;
	color: inherit;
}

.edunexa-mh-menu-icon svg,
.edunexa-mh-menu-icon i {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

.edunexa-mh-menu-label {
	font-weight: 700;
	white-space: nowrap;
	letter-spacing: -0.2px;
}

/* =========================================================================
   2. CENTER: LOGO WITH LIGHT & GLOW SHIMMER ANIMATION
   ========================================================================= */
.edunexa-mh-center {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 1 auto;
	max-width: var(--edunexa-mh-center-max-w, 50%);
	text-align: center;
	min-width: 0;
}

.edunexa-mh-logo-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	text-decoration: none;
	overflow: visible;
	max-width: 100%;
	line-height: 1;
}

.edunexa-mh-logo-link img,
.edunexa-mh-logo-link .custom-logo,
.edunexa-mh-logo-link svg {
	display: block;
	width: var(--edunexa-mh-logo-w, auto);
	max-width: var(--edunexa-mh-logo-width, 135px);
	max-height: var(--edunexa-mh-logo-max-height, 44px);
	height: auto;
	object-fit: var(--edunexa-mh-logo-fit, contain);
	position: relative;
	z-index: 2;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.edunexa-mh-logo-link:hover img {
	transform: scale(1.03);
}

.edunexa-mh-logo-text {
	font-size: 1.1rem;
	font-weight: 800;
	color: #0f172a;
	white-space: nowrap;
	position: relative;
	z-index: 2;
}

/* Ambient Light Halo Behind Logo */
.edunexa-mh-logo-halo {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 120%;
	height: 140%;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle, var(--edunexa-mh-logo-glow, rgba(250, 178, 55, 0.45)) 0%, transparent 68%);
	filter: blur(10px);
	opacity: 0.35;
	z-index: 1;
	pointer-events: none;
}

/* Diagonal Light Beam Sweeping Over Logo */
.edunexa-mh-logo-beam {
	position: absolute;
	top: -50%;
	left: -130%;
	width: 45%;
	height: 200%;
	background: linear-gradient(
		105deg,
		transparent 10%,
		var(--edunexa-mh-logo-beam, rgba(255, 255, 255, 0.92)) 48%,
		transparent 80%
	);
	transform: rotate(22deg);
	opacity: 0;
	z-index: 4;
	pointer-events: none;
	mix-blend-mode: overlay;
}

/* Sparkle Star Glints */
.edunexa-mh-logo-sparkle {
	position: absolute;
	width: 10px;
	height: 10px;
	pointer-events: none;
	z-index: 5;
	opacity: 0;
}

.edunexa-mh-logo-sparkle::before,
.edunexa-mh-logo-sparkle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	background: #ffffff;
	transform: translate(-50%, -50%);
	border-radius: 999px;
}

.edunexa-mh-logo-sparkle::before {
	width: 100%;
	height: 2px;
}

.edunexa-mh-logo-sparkle::after {
	width: 2px;
	height: 100%;
}

.edunexa-mh-logo-sparkle.sp-1 {
	top: -3px;
	right: 12%;
}

.edunexa-mh-logo-sparkle.sp-2 {
	bottom: 0px;
	left: 14%;
}

/* Mode 1: Shimmer Sweep + Soft Halo (Default) */
.edunexa-mh-logo-anim-shimmer_sweep .edunexa-mh-logo-beam {
	animation: edunexaMhLogoSweep var(--edunexa-mh-logo-anim-duration, 3.6s) cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.edunexa-mh-logo-anim-shimmer_sweep .edunexa-mh-logo-halo {
	animation: edunexaMhLogoHaloPulse var(--edunexa-mh-logo-anim-duration, 3.6s) ease-in-out infinite;
}
.edunexa-mh-logo-anim-shimmer_sweep .edunexa-mh-logo-link img {
	animation: edunexaMhLogoFilterGlow var(--edunexa-mh-logo-anim-duration, 3.6s) ease-in-out infinite;
}

/* Mode 2: Radiant Golden / Neon Pulse Halo */
.edunexa-mh-logo-anim-golden_aura .edunexa-mh-logo-halo {
	opacity: 0.65;
	filter: blur(14px);
	animation: edunexaMhLogoHaloPulse 2.8s ease-in-out infinite;
}
.edunexa-mh-logo-anim-golden_aura .edunexa-mh-logo-link img {
	animation: edunexaMhLogoFilterStrong 2.8s ease-in-out infinite;
}

/* Mode 3: Diamond Sparkle Glint + Sweep */
.edunexa-mh-logo-anim-sparkle_glint .edunexa-mh-logo-beam {
	animation: edunexaMhLogoSweep 3.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.edunexa-mh-logo-anim-sparkle_glint .edunexa-mh-logo-sparkle.sp-1 {
	animation: edunexaMhSparkleTwinkle 3.8s ease-in-out infinite;
	animation-delay: 0.3s;
}
.edunexa-mh-logo-anim-sparkle_glint .edunexa-mh-logo-sparkle.sp-2 {
	animation: edunexaMhSparkleTwinkle 3.8s ease-in-out infinite;
	animation-delay: 0.9s;
}

/* Mode 4: Floating Levitation + Light Glow */
.edunexa-mh-logo-anim-float_glow .edunexa-mh-logo-halo {
	animation: edunexaMhLogoHaloPulse 3.4s ease-in-out infinite;
}
.edunexa-mh-logo-anim-float_glow .edunexa-mh-logo-link {
	animation: edunexaMhLogoFloat 3.4s ease-in-out infinite;
}

@keyframes edunexaMhLogoSweep {
	0% {
		left: -130%;
		opacity: 0;
	}
	15% {
		opacity: 1;
	}
	45% {
		left: 140%;
		opacity: 0.95;
	}
	55%, 100% {
		left: 140%;
		opacity: 0;
	}
}

@keyframes edunexaMhLogoHaloPulse {
	0%, 100% {
		transform: translate(-50%, -50%) scale(0.85);
		opacity: 0.25;
	}
	45% {
		transform: translate(-50%, -50%) scale(1.18);
		opacity: 0.75;
	}
}

@keyframes edunexaMhLogoFilterGlow {
	0%, 100% {
		filter: drop-shadow(0 0 0px transparent);
	}
	45% {
		filter: drop-shadow(0 2px 10px var(--edunexa-mh-logo-glow, rgba(250, 178, 55, 0.45)));
	}
}

@keyframes edunexaMhLogoFilterStrong {
	0%, 100% {
		filter: drop-shadow(0 0 2px var(--edunexa-mh-logo-glow, rgba(250, 178, 55, 0.25))) brightness(1);
	}
	50% {
		filter: drop-shadow(0 0 14px var(--edunexa-mh-logo-glow, rgba(250, 178, 55, 0.65))) brightness(1.07);
	}
}

@keyframes edunexaMhSparkleTwinkle {
	0%, 100% {
		transform: scale(0) rotate(0deg);
		opacity: 0;
	}
	35% {
		transform: scale(1.25) rotate(45deg);
		opacity: 1;
	}
	60% {
		transform: scale(0) rotate(90deg);
		opacity: 0;
	}
}

@keyframes edunexaMhLogoFloat {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-3.5px);
	}
}

/* =========================================================================
   3. LEFT: CONTACT CALL ICON BUTTON
   ========================================================================= */
.edunexa-mh-left {
	display: flex;
	align-items: center;
	flex: 1 1 25%;
	justify-content: flex-end;
	min-width: 0;
}

.edunexa-mobile-header-wrap .edunexa-mh-call-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: var(--edunexa-mh-call-box-size, 40px);
	height: var(--edunexa-mh-call-box-size, 40px);
	min-width: var(--edunexa-mh-call-box-size, 40px);
	background: var(--edunexa-mh-call-bg, transparent);
	color: var(--edunexa-mh-call-color, #0f172a);
	border: none;
	border-radius: var(--edunexa-mh-call-radius, 12px);
	text-decoration: none;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	-webkit-tap-highlight-color: transparent;
	position: relative;
	cursor: pointer;
}

.edunexa-mobile-header-wrap .edunexa-mh-call-btn:hover,
.edunexa-mobile-header-wrap .edunexa-mh-call-btn:focus-visible {
	background: var(--edunexa-mh-call-hover-bg, #f8fafc);
	color: var(--edunexa-mh-call-hover-color, #FAB237);
	transform: translateY(-1px);
}

.edunexa-mh-call-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--edunexa-mh-call-icon-size, 24px);
	height: var(--edunexa-mh-call-icon-size, 24px);
	color: inherit;
	transition: transform 0.25s ease;
}

.edunexa-mh-call-icon svg,
.edunexa-mh-call-icon i {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

.edunexa-mh-call-label {
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

/* Optional Subtle Ringing Wave Animation on Call Icon */
.edunexa-mh-call-anim-ring .edunexa-mh-call-icon {
	animation: edunexaMhCallRing 3.5s ease-in-out infinite;
	transform-origin: center center;
}

.edunexa-mh-call-anim-pulse .edunexa-mh-call-icon {
	animation: edunexaMhCallPulse 2.2s ease-in-out infinite;
}

@keyframes edunexaMhCallRing {
	0%, 76%, 100% {
		transform: rotate(0deg) scale(1);
	}
	80% {
		transform: rotate(-12deg) scale(1.06);
	}
	84% {
		transform: rotate(12deg) scale(1.06);
	}
	88% {
		transform: rotate(-9deg) scale(1.06);
	}
	92% {
		transform: rotate(9deg) scale(1.06);
	}
	96% {
		transform: rotate(-4deg) scale(1);
	}
}

@keyframes edunexaMhCallPulse {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.1);
	}
}

/* =========================================================================
   4. RESPONSIVE MOBILE OPTIMIZATION & TOPBAR HARMONIZATION
   ========================================================================= */

/* Option: Hide labels to prioritize big logo width */
.edunexa-mobile-header-wrap.edunexa-mh-hide-labels .edunexa-mh-menu-label,
.edunexa-mobile-header-wrap.edunexa-mh-hide-labels .edunexa-mh-call-label {
	display: none !important;
}

@media (max-width: 576px) {
	.edunexa-mh-bar {
		padding: 8px 12px;
		gap: 6px;
	}
	.edunexa-mh-menu-btn {
		padding: 6px 10px;
		gap: 5px;
	}
	.edunexa-mh-call-btn {
		width: 38px;
		height: 38px;
		min-width: 38px;
	}
}

@media (max-width: 440px) {
	.edunexa-mh-bar {
		padding: 6px 10px;
		border-radius: 16px;
	}
	/* Auto-hide call label on narrow mobile to keep logo centered & spacious */
	.edunexa-mh-call-label {
		display: none !important;
	}
	.edunexa-mh-menu-label {
		font-size: 12px;
	}
	.edunexa-mh-menu-btn {
		padding: 6px 8px;
	}
	.edunexa-mh-call-btn {
		width: 36px;
		height: 36px;
		min-width: 36px;
	}
}

@media (max-width: 360px) {
	.edunexa-mh-bar {
		padding: 5px 8px;
		border-radius: 14px;
	}
	/* In ultra-narrow screens (<= 360px), hide menu label so large logos fit cleanly without horizontal scroll */
	.edunexa-mh-menu-label {
		display: none !important;
	}
	.edunexa-mh-center {
		max-width: 65%;
	}
}
