/* Qubtiva Maskot — davranışa göre tetiklenen animasyonlu karşılama.
   chatbot.css'ten sonra yüklenir ve aynı CSS değişkenlerini kullanır. */

#qubtiva-chatbot .qbt-mascot {
	position: absolute !important;
	right: 0 !important;
	bottom: 74px !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-end !important;
	width: max-content !important;
	max-width: min(320px, calc(100vw - 36px)) !important;
	pointer-events: none; /* yalnızca iç öğeler tıklanabilir */
}

#qubtiva-chatbot .qbt-mascot[hidden] {
	display: none !important;
}

/* ----- Konuşma baloncuğu ----- */
#qubtiva-chatbot .qbt-mascot-bubble {
	position: relative !important;
	pointer-events: auto;
	width: 100% !important;
	padding: 16px 18px 14px !important;
	background: var(--qbt-bg) !important;
	border: 1px solid #e8ebe4 !important;
	border-radius: 16px !important;
	box-shadow: 0 12px 34px rgba(24, 40, 12, 0.16) !important;
	opacity: 0;
	transform: translateY(14px) scale(0.94);
	transform-origin: bottom right;
}

/* Baloncuğun sağ alt köşesindeki kuyruk (maskota bakar) */
#qubtiva-chatbot .qbt-mascot-bubble::after {
	content: "";
	position: absolute;
	right: 64px;
	bottom: -9px;
	width: 16px;
	height: 16px;
	background: var(--qbt-bg);
	border-right: 1px solid #e8ebe4;
	border-bottom: 1px solid #e8ebe4;
	transform: rotate(45deg);
	border-bottom-right-radius: 3px;
}

#qubtiva-chatbot .qbt-mascot.qbt-mascot-in .qbt-mascot-bubble {
	animation: qbt-bubble-pop 0.42s cubic-bezier(0.22, 1.2, 0.36, 1) 0.32s forwards;
}

#qubtiva-chatbot .qbt-mascot.qbt-mascot-out .qbt-mascot-bubble {
	animation: qbt-bubble-out 0.24s ease forwards;
}

#qubtiva-chatbot .qbt-mascot-title {
	margin: 0 0 4px !important;
	padding: 0 !important;
	font-size: 14.5px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	color: var(--qbt-title) !important;
}

#qubtiva-chatbot .qbt-mascot-text {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 13px !important;
	line-height: 1.5 !important;
	color: var(--qbt-text) !important;
}

#qubtiva-chatbot .qbt-mascot-title:empty,
#qubtiva-chatbot .qbt-mascot-text:empty {
	display: none !important;
}

/* ----- Yazıyor noktaları (metinden hemen önce) ----- */
#qubtiva-chatbot .qbt-mascot-dots {
	display: none;
	align-items: center;
	gap: 5px;
	height: 20px;
	padding: 2px 0;
}

#qubtiva-chatbot .qbt-mascot.qbt-mascot-thinking .qbt-mascot-dots {
	display: flex;
}

#qubtiva-chatbot .qbt-mascot.qbt-mascot-thinking .qbt-mascot-body {
	display: none !important;
}

#qubtiva-chatbot .qbt-mascot-dots span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--qbt-primary);
	opacity: 0.45;
	animation: qbt-dot 1s infinite ease-in-out;
}

#qubtiva-chatbot .qbt-mascot-dots span:nth-child(2) {
	animation-delay: 0.15s;
}

#qubtiva-chatbot .qbt-mascot-dots span:nth-child(3) {
	animation-delay: 0.3s;
}

/* ----- Butonlar ----- */
#qubtiva-chatbot .qbt-mascot-actions {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	gap: 8px;
	margin-top: 12px !important;
}

#qubtiva-chatbot .qbt-mascot-cta {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 9px 18px !important;
	border-radius: 35px !important;
	background: linear-gradient(135deg, var(--qbt-primary) 0%, var(--qbt-primary-dark) 100%) !important;
	color: #fff !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	box-shadow: 0 4px 14px rgba(8, 122, 58, 0.28) !important;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#qubtiva-chatbot .qbt-mascot-cta:hover {
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 7px 18px rgba(8, 122, 58, 0.38) !important;
}

#qubtiva-chatbot .qbt-mascot-cta:empty {
	display: none !important;
}

#qubtiva-chatbot .qbt-mascot-ask {
	padding: 9px 14px !important;
	border-radius: 35px !important;
	background: #f4f7ee !important;
	color: var(--qbt-primary-dark) !important;
	font-size: 12.5px !important;
	font-weight: 500 !important;
	transition: background 0.15s ease;
}

#qubtiva-chatbot .qbt-mascot-ask:hover {
	background: #e9f0dd !important;
	color: var(--qbt-primary-dark) !important;
}

#qubtiva-chatbot .qbt-mascot-ask.qbt-hidden {
	display: none !important;
}

/* ----- Kapat ----- */
#qubtiva-chatbot .qbt-mascot-close {
	position: absolute !important;
	top: 8px !important;
	right: 8px !important;
	width: 26px !important;
	height: 26px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0 !important;
	border-radius: 50% !important;
	color: #b3b3b3 !important;
	transition: background 0.15s ease, color 0.15s ease;
}

#qubtiva-chatbot .qbt-mascot-close:hover {
	background: #f2f2f2 !important;
	color: #6f6f6f !important;
}

#qubtiva-chatbot .qbt-mascot-close svg {
	width: 13px !important;
	height: 13px !important;
}

/* Başlıkta kapat butonunun altına girmesin */
#qubtiva-chatbot .qbt-mascot-title {
	padding-right: 22px !important;
}

/* ----- Karakter ----- */
#qubtiva-chatbot .qbt-mascot-figure {
	pointer-events: auto;
	display: block !important;
	margin: -4px 14px 0 0 !important;
	padding: 0 !important;
	background: transparent !important;
	line-height: 0 !important;
	opacity: 0;
	transform: translateY(26px) scale(0.7);
	transform-origin: bottom center;
	filter: drop-shadow(0 10px 18px rgba(24, 40, 12, 0.22));
}

/* Poz görselleri 440x520 tuvalde üretilir; genişlik verilir, yükseklik orandan gelir. */
#qubtiva-chatbot .qbt-mascot-img {
	display: block !important;
	width: 116px !important;
	height: auto !important;
	max-width: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	user-select: none;
	-webkit-user-drag: none;
}

/* Giriş: yerden zıplayarak gelir, sonra selam verir ve süzülür. */
#qubtiva-chatbot .qbt-mascot.qbt-mascot-in .qbt-mascot-figure {
	animation:
		qbt-mascot-enter 0.6s cubic-bezier(0.18, 1.3, 0.4, 1) forwards,
		qbt-mascot-wave 1.1s ease-in-out 0.6s 1,
		qbt-mascot-float 3.4s ease-in-out 1.7s infinite;
}

#qubtiva-chatbot .qbt-mascot.qbt-mascot-out .qbt-mascot-figure {
	animation: qbt-mascot-exit 0.28s ease forwards;
}

#qubtiva-chatbot .qbt-mascot-figure:hover .qbt-mascot-img {
	animation: qbt-mascot-nudge 0.5s ease;
}

/* Maskot çıktığında açma butonu dikkat çeksin */
#qubtiva-chatbot.qbt-mascot-active .qbt-launcher {
	animation: qbt-launcher-pulse 2.2s ease-in-out infinite;
}

/* ----- Animasyonlar ----- */
@keyframes qbt-mascot-enter {
	0% {
		opacity: 0;
		transform: translateY(30px) scale(0.65) rotate(-6deg);
	}
	60% {
		opacity: 1;
		transform: translateY(-8px) scale(1.06) rotate(2deg);
	}
	100% {
		opacity: 1;
		transform: translateY(0) scale(1) rotate(0deg);
	}
}

@keyframes qbt-mascot-wave {
	0%, 100% { transform: rotate(0deg); }
	20% { transform: rotate(-7deg); }
	45% { transform: rotate(6deg); }
	70% { transform: rotate(-4deg); }
}

@keyframes qbt-mascot-float {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50% { transform: translateY(-7px) rotate(1.5deg); }
}

@keyframes qbt-mascot-nudge {
	0%, 100% { transform: scale(1); }
	40% { transform: scale(1.07) rotate(-3deg); }
	70% { transform: scale(1.02) rotate(2deg); }
}

@keyframes qbt-mascot-exit {
	to {
		opacity: 0;
		transform: translateY(22px) scale(0.7);
	}
}

@keyframes qbt-bubble-pop {
	0% { opacity: 0; transform: translateY(14px) scale(0.94); }
	100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes qbt-bubble-out {
	to { opacity: 0; transform: translateY(10px) scale(0.96); }
}

@keyframes qbt-dot {
	0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
	30% { opacity: 1; transform: translateY(-4px); }
}

@keyframes qbt-launcher-pulse {
	0%, 100% { box-shadow: 0 6px 24px rgba(8, 122, 58, 0.35); }
	50% { box-shadow: 0 6px 24px rgba(8, 122, 58, 0.35), 0 0 0 12px rgba(115, 170, 0, 0.12); }
}

/* Sohbet penceresi açıkken maskot gizlenir */
#qubtiva-chatbot.qbt-open .qbt-mascot {
	display: none !important;
}

/* ----- Mobil ----- */
@media (max-width: 480px) {
	#qubtiva-chatbot .qbt-mascot {
		bottom: 68px !important;
		max-width: calc(100vw - 28px) !important;
		width: calc(100vw - 28px) !important;
	}

	#qubtiva-chatbot .qbt-mascot-bubble {
		padding: 14px 16px 12px !important;
	}

	#qubtiva-chatbot .qbt-mascot-bubble::after {
		right: 46px;
	}

	#qubtiva-chatbot .qbt-mascot-img {
		width: 80px !important;
	}

	#qubtiva-chatbot .qbt-mascot-title {
		font-size: 14px !important;
	}
}

/* ----- Hareket azaltma tercihi ----- */
@media (prefers-reduced-motion: reduce) {
	#qubtiva-chatbot .qbt-mascot.qbt-mascot-in .qbt-mascot-figure,
	#qubtiva-chatbot .qbt-mascot.qbt-mascot-in .qbt-mascot-bubble,
	#qubtiva-chatbot .qbt-mascot-figure:hover .qbt-mascot-img,
	#qubtiva-chatbot.qbt-mascot-active .qbt-launcher {
		animation: none !important;
	}

	#qubtiva-chatbot .qbt-mascot.qbt-mascot-in .qbt-mascot-figure,
	#qubtiva-chatbot .qbt-mascot.qbt-mascot-in .qbt-mascot-bubble {
		opacity: 1;
		transform: none;
		transition: opacity 0.25s ease;
	}
}
