/**
 * EduNexa — ادونکسا
 * Goftino High-Performance Custom Floating Launcher Stylesheet
 *
 * @package EduNexa
 * @author  امیر حسین بناوند (Amir Hossein Banavand)
 * @link    https://npocto.ir
 * @since   1.1.0
 */

/* ==========================================================================
   1. FLOATING WRAPPER & POSITIONING
   ========================================================================== */
.edunexa-goftino-wrapper {
	position: fixed;
	bottom: 30px;
	z-index: 99998;
	display: flex;
	align-items: center;
	gap: 12px;
	pointer-events: none;
	user-select: none;
	font-family: inherit;
	direction: rtl;
}

.edunexa-goftino-wrapper * {
	box-sizing: border-box;
}

.edunexa-goftino-pos-left {
	left: 28px;
	flex-direction: row;
}

.edunexa-goftino-pos-right {
	right: 28px;
	flex-direction: row-reverse;
}

/* ==========================================================================
   2. TEXT BADGE (PILL TOOLTIP)
   ========================================================================== */
.edunexa-goftino-badge {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #ffffff;
	color: #0f172a;
	padding: 8px 16px;
	border-radius: 999px;
	font-size: 0.84rem;
	font-weight: 700;
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
	border: 1px solid rgba(226, 232, 240, 0.9);
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
}

.edunexa-goftino-badge:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 22px rgba(15, 23, 42, 0.16);
	border-color: #FAB237;
	color: #b45309;
}

.edunexa-goftino-badge-status-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #10b981;
	box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
	animation: edunexa-goftino-dot-pulse 2s infinite;
}

@keyframes edunexa-goftino-dot-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
	}
	70% {
		box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
	}
}

/* ==========================================================================
   3. FLOATING ACTION BUTTON (FAB)
   ========================================================================== */
.edunexa-goftino-btn {
	pointer-events: auto;
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, #FAB237 0%, #e09618 100%);
	color: #1e293b;
	border: none;
	outline: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 24px rgba(250, 178, 55, 0.45);
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	padding: 0;
	margin: 0;
}

.edunexa-goftino-btn:hover {
	transform: scale(1.08) translateY(-2px);
	box-shadow: 0 12px 30px rgba(250, 178, 55, 0.55);
}

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

/* Pulse Rings */
.edunexa-goftino-pulse-ring,
.edunexa-goftino-pulse-ring-second {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	border-radius: 50%;
	border: 2px solid #FAB237;
	pointer-events: none;
	animation: edunexa-goftino-wave 2.6s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.edunexa-goftino-pulse-ring-second {
	animation-delay: 1.3s;
}

@keyframes edunexa-goftino-wave {
	0% {
		transform: scale(1);
		opacity: 0.8;
	}
	100% {
		transform: scale(1.65);
		opacity: 0;
	}
}

.edunexa-goftino-btn.is-open .edunexa-goftino-pulse-ring,
.edunexa-goftino-btn.is-open .edunexa-goftino-pulse-ring-second {
	display: none;
}

/* ==========================================================================
   4. ICONS & STATE TRANSITIONS
   ========================================================================== */
.edunexa-goftino-icon {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.edunexa-goftino-icon-chat {
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

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

.edunexa-goftino-btn.is-open {
	background: #1e293b;
	color: #ffffff;
	box-shadow: 0 8px 24px rgba(30, 41, 59, 0.4);
}

.edunexa-goftino-btn.is-open .edunexa-goftino-icon-chat {
	opacity: 0;
	transform: scale(0.5) rotate(90deg);
}

.edunexa-goftino-btn.is-open .edunexa-goftino-icon-close {
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

/* ==========================================================================
   5. LOADING SPINNER
   ========================================================================== */
.edunexa-goftino-spinner {
	position: absolute;
	width: 24px;
	height: 24px;
	border: 2.5px solid rgba(30, 41, 59, 0.25);
	border-top-color: #1e293b;
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	animation: edunexa-goftino-spin 0.7s linear infinite;
}

.edunexa-goftino-btn.is-loading .edunexa-goftino-spinner {
	opacity: 1;
}

.edunexa-goftino-btn.is-loading .edunexa-goftino-icon {
	opacity: 0 !important;
}

@keyframes edunexa-goftino-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ==========================================================================
   6. UNREAD COUNTER BADGE
   ========================================================================== */
.edunexa-goftino-unread-counter {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: #ef4444;
	color: #ffffff;
	font-size: 0.75rem;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
	border: 2px solid #ffffff;
	line-height: 1;
	z-index: 2;
}

.edunexa-goftino-unread-counter.animate-bounce {
	animation: edunexa-goftino-bounce 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}

@keyframes edunexa-goftino-bounce {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-6px);
	}
}

/* ==========================================================================
   7. MOBILE RESPONSIVE OPTIMIZATION
   ========================================================================== */
@media (max-width: 768px) {
	.edunexa-goftino-wrapper {
		bottom: 85px; /* Sits cleanly above the fixed mobile bottom navigation bar */
	}

	.edunexa-goftino-pos-left {
		left: 18px;
	}

	.edunexa-goftino-pos-right {
		right: 18px;
	}

	.edunexa-goftino-badge {
		display: none; /* Hide text badge on mobile for clean screen estate */
	}

	.edunexa-goftino-btn {
		width: 54px;
		height: 54px;
	}
}

/* ==========================================================================
   8. DARK MODE SUPPORT
   ========================================================================== */
[data-theme="dark"] .edunexa-goftino-badge,
.dark-theme .edunexa-goftino-badge,
body.dark-mode .edunexa-goftino-badge {
	background: #1e293b;
	color: #f8fafc;
	border-color: #334155;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .edunexa-goftino-badge:hover,
.dark-theme .edunexa-goftino-badge:hover,
body.dark-mode .edunexa-goftino-badge:hover {
	color: #FAB237;
	border-color: #FAB237;
}

[data-theme="dark"] .edunexa-goftino-unread-counter,
.dark-theme .edunexa-goftino-unread-counter,
body.dark-mode .edunexa-goftino-unread-counter {
	border-color: #0f172a;
}
