/**
 * EduNexa — ادونکسا
 * Floating Contact Us Widget Styles (ویجت شناور تماس با ما)
 *
 * - Desktop: Floating circular button + pill badge; clicks open sleek floating modal card
 * - Mobile: Slides up as a native Bottom Sheet drawer with swipe header & close button
 * - Multi-channel contacts: Phone, WhatsApp, Telegram, Bale, Eitaa, Instagram, Email, Chat
 *
 * @package EduNexa
 * @since   1.2.0
 */

.edunexa-floating-contact-root {
	--edunexa-fc-primary: #FAB237;
	--edunexa-fc-btn-icon: #0f172a;
	--edunexa-fc-btn-border: #ffffff;
	--edunexa-fc-circle-size: 60px;
	--edunexa-fc-badge-bg: #ffffff;
	--edunexa-fc-badge-color: #0f172a;
	--edunexa-fc-card-bg: #ffffff;
	--edunexa-fc-title-color: #0f172a;
	--edunexa-fc-subtitle-color: #64748b;
	--edunexa-fc-item-bg: #f8fafc;
	--edunexa-fc-item-border: #e2e8f0;
	--edunexa-fc-item-color: #0f172a;
	--edunexa-fc-bottom-desk: 28px;
	--edunexa-fc-side-desk: 28px;
	--edunexa-fc-bottom-mob: 82px;
	--edunexa-fc-side-mob: 18px;
	--edunexa-fc-title-size: 16px;
	--edunexa-fc-subtitle-size: 12px;
	--edunexa-fc-item-size: 14px;
	--edunexa-fc-badge-size: 12px;

	position: fixed;
	z-index: 9999;
	direction: rtl;
	font-family: inherit;
	box-sizing: border-box;
}

/* Desktop Position: Left or Right */
.edunexa-floating-contact-root.edunexa-fc-desk-pos-left {
	left: var(--edunexa-fc-side-desk, 28px);
	bottom: var(--edunexa-fc-bottom-desk, 28px);
	right: auto;
}

.edunexa-floating-contact-root.edunexa-fc-desk-pos-right {
	right: var(--edunexa-fc-side-desk, 28px);
	bottom: var(--edunexa-fc-bottom-desk, 28px);
	left: auto;
}

/* Mobile Position Override */
@media (max-width: 768px) {
	.edunexa-floating-contact-root.edunexa-fc-mob-pos-left {
		left: var(--edunexa-fc-side-mob, 18px) !important;
		right: auto !important;
		bottom: var(--edunexa-fc-bottom-mob, 82px) !important;
	}
	.edunexa-floating-contact-root.edunexa-fc-mob-pos-right {
		right: var(--edunexa-fc-side-mob, 18px) !important;
		left: auto !important;
		bottom: var(--edunexa-fc-bottom-mob, 82px) !important;
	}
}

/* Device Visibility Modifiers */
@media (max-width: 768px) {
	.edunexa-floating-contact-root.edunexa-fc-hide-mob {
		display: none !important;
	}
}
@media (min-width: 769px) {
	.edunexa-floating-contact-root.edunexa-fc-hide-desk {
		display: none !important;
	}
}

/* =========================================================================
   1. TRIGGER BUTTON & BADGE
   ========================================================================= */
.edunexa-fc-trigger-wrap {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	cursor: pointer;
	outline: none;
	background: transparent;
	border: none;
	padding: 0;
	position: relative;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
	-webkit-tap-highlight-color: transparent;
}

.edunexa-fc-trigger-wrap:hover {
	transform: scale(1.05);
}

.edunexa-fc-circle-btn {
	width: var(--edunexa-fc-circle-size, 60px);
	height: var(--edunexa-fc-circle-size, 60px);
	border-radius: 50%;
	background: var(--edunexa-fc-primary, #FAB237);
	color: var(--edunexa-fc-btn-icon, #0f172a);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	box-shadow: 0 10px 25px -4px rgba(250, 178, 55, 0.45), 0 4px 10px -2px rgba(15, 23, 42, 0.1);
	border: 3px solid var(--edunexa-fc-btn-border, #ffffff);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

.edunexa-fc-icon-open,
.edunexa-fc-icon-close {
	position: absolute;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.edunexa-fc-icon-open svg,
.edunexa-fc-icon-open i,
.edunexa-fc-icon-open img {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

.edunexa-fc-icon-close {
	opacity: 0;
	transform: rotate(-90deg) scale(0.5);
}

.edunexa-fc-icon-close svg {
	width: 22px;
	height: 22px;
	stroke: currentColor;
	stroke-width: 2.5;
	fill: none;
}

/* White Pill Badge underneath the circle */
.edunexa-fc-pill-badge {
	margin-top: 6px;
	background: var(--edunexa-fc-badge-bg, #ffffff);
	color: var(--edunexa-fc-badge-color, #0f172a);
	font-size: var(--edunexa-fc-badge-size, 12px);
	font-weight: 700;
	padding: 3px 12px;
	border-radius: 999px;
	white-space: nowrap;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
	border: 1px solid rgba(226, 232, 240, 0.9);
	line-height: 1.4;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Morph Floating Button when Open */
.edunexa-floating-contact-root.is-open .edunexa-fc-icon-open {
	opacity: 0;
	transform: rotate(90deg) scale(0.5);
}

.edunexa-floating-contact-root.is-open .edunexa-fc-icon-close {
	opacity: 1;
	transform: rotate(0) scale(1);
}

.edunexa-floating-contact-root.is-open .edunexa-fc-pill-badge {
	opacity: 0;
	transform: translateY(-4px);
	pointer-events: none;
}

/* =========================================================================
   2. PULSE WAVE & ANIMATIONS
   ========================================================================= */
.edunexa-fc-pulse-ring {
	position: absolute;
	top: -5px;
	left: -5px;
	right: -5px;
	bottom: -5px;
	border-radius: 50%;
	border: 2px solid var(--edunexa-fc-primary, #FAB237);
	opacity: 0;
	pointer-events: none;
}

.edunexa-fc-anim-levitate_pulse:not(.is-open) .edunexa-fc-trigger-wrap {
	animation: edunexaFcLevitate 3.2s ease-in-out infinite;
}
.edunexa-fc-anim-levitate_pulse:not(.is-open) .edunexa-fc-pulse-ring {
	animation: edunexaFcPulseWave 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.edunexa-fc-anim-pulse_wave:not(.is-open) .edunexa-fc-pulse-ring {
	animation: edunexaFcPulseWave 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.edunexa-fc-anim-bounce:not(.is-open) .edunexa-fc-trigger-wrap {
	animation: edunexaFcBounce 2.5s ease-in-out infinite;
}

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

@keyframes edunexaFcPulseWave {
	0% {
		transform: scale(0.9);
		opacity: 0.8;
	}
	70% {
		transform: scale(1.45);
		opacity: 0;
	}
	100% {
		transform: scale(1.55);
		opacity: 0;
	}
}

@keyframes edunexaFcBounce {
	0%, 100% { transform: translateY(0); }
	40% { transform: translateY(-10px); }
	60% { transform: translateY(-4px); }
}

/* =========================================================================
   3. DESKTOP MODAL CARD / POPUP
   ========================================================================= */
.edunexa-fc-backdrop {
	display: none;
}

.edunexa-fc-dialog {
	display: none;
	position: absolute;
	bottom: calc(100% + 14px);
	width: 330px;
	max-width: calc(100vw - 36px);
	background: var(--edunexa-fc-card-bg, #ffffff);
	border-radius: 20px;
	box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.2), 0 4px 16px -2px rgba(15, 23, 42, 0.08);
	border: 1px solid rgba(226, 232, 240, 0.85);
	overflow: hidden;
	box-sizing: border-box;
	transform-origin: bottom center;
	animation: edunexaFcCardPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.edunexa-fc-desk-pos-left .edunexa-fc-dialog {
	left: 0;
	right: auto;
	transform-origin: bottom left;
}

.edunexa-fc-desk-pos-right .edunexa-fc-dialog {
	right: 0;
	left: auto;
	transform-origin: bottom right;
}

.edunexa-floating-contact-root.is-open .edunexa-fc-dialog {
	display: block;
}

@keyframes edunexaFcCardPop {
	0% {
		opacity: 0;
		transform: scale(0.85) translateY(12px);
	}
	100% {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

/* Dialog Header */
.edunexa-fc-header {
	padding: 16px 18px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #f1f5f9;
	background: #ffffff;
}

.edunexa-fc-header-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

.edunexa-fc-header-avatar {
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: rgba(250, 178, 55, 0.15);
	color: #0f172a;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.edunexa-fc-header-avatar svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.edunexa-fc-header-texts {
	display: flex;
	flex-direction: column;
}

.edunexa-fc-header-title {
	font-size: var(--edunexa-fc-title-size, 16px);
	font-weight: 800;
	color: var(--edunexa-fc-title-color, #0f172a);
	margin: 0;
	line-height: 1.3;
}

.edunexa-fc-header-subtitle {
	font-size: var(--edunexa-fc-subtitle-size, 12px);
	color: var(--edunexa-fc-subtitle-color, #64748b);
	margin: 2px 0 0;
	line-height: 1.4;
}

.edunexa-fc-mobile-close-btn {
	background: #f1f5f9;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #64748b;
	transition: all 0.2s ease;
	outline: none;
}

.edunexa-fc-mobile-close-btn:hover {
	background: #fee2e2;
	color: #ef4444;
}

.edunexa-fc-mobile-close-btn svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	stroke-width: 2.5;
	fill: none;
}

/* Items List */
.edunexa-fc-items-list {
	padding: 12px 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 9px;
	max-height: 360px;
	overflow-y: auto;
}

.edunexa-fc-item-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: var(--edunexa-fc-item-bg, #f8fafc);
	border: 1px solid var(--edunexa-fc-item-border, #e2e8f0);
	border-radius: 14px;
	text-decoration: none;
	color: var(--edunexa-fc-item-color, #0f172a);
	transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
	-webkit-tap-highlight-color: transparent;
}

.edunexa-fc-item-card:hover {
	background: #ffffff;
	border-color: #cbd5e1;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.edunexa-fc-item-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

.edunexa-fc-item-icon-box {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #ffffff;
}

.edunexa-fc-item-icon-box svg,
.edunexa-fc-item-icon-box i {
	width: 20px;
	height: 20px;
	display: block;
	fill: currentColor;
}

.edunexa-fc-item-texts {
	display: flex;
	flex-direction: column;
}

.edunexa-fc-item-title {
	font-size: var(--edunexa-fc-item-size, 14px);
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.edunexa-fc-item-subtitle {
	font-size: 11px;
	color: #94a3b8;
	margin-top: 2px;
}

.edunexa-fc-item-arrow {
	color: #94a3b8;
	display: flex;
	align-items: center;
	transition: transform 0.2s ease, color 0.2s ease;
}

.edunexa-fc-item-arrow svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	stroke-width: 2.2;
	fill: none;
}

.edunexa-fc-item-card:hover .edunexa-fc-item-arrow {
	color: var(--edunexa-fc-primary, #FAB237);
	transform: translateX(-3px);
}

/* =========================================================================
   4. MOBILE BOTTOM SHEET (< 768px)
   ========================================================================= */
@media (max-width: 768px) {
	.edunexa-floating-contact-root.is-open .edunexa-fc-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(15, 23, 42, 0.6);
		backdrop-filter: blur(4px);
		-webkit-backdrop-filter: blur(4px);
		z-index: 10000;
	}

	.edunexa-floating-contact-root.is-open .edunexa-fc-dialog {
		position: fixed;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		top: auto !important;
		width: 100% !important;
		max-width: 100% !important;
		border-radius: 26px 26px 0 0 !important;
		z-index: 10001;
		animation: edunexaFcSheetSlideUp 0.32s cubic-bezier(0.32, 0.72, 0, 1) forwards !important;
		padding-bottom: env(safe-area-inset-bottom, 18px);
	}

	.edunexa-fc-sheet-handle {
		width: 44px;
		height: 4px;
		border-radius: 999px;
		background: #cbd5e1;
		margin: 8px auto 4px;
		display: block;
	}
}

@keyframes edunexaFcSheetSlideUp {
	0% {
		transform: translateY(100%);
	}
	100% {
		transform: translateY(0);
	}
}
