/* ── Widget container — iletişim butonlarının ÜSTÜNDE ── */
.ek-ai-widget.ek-ai-consent-pending {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.ek-ai-widget {
	position: fixed;
	z-index: 99990;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	bottom: calc(88px + env(safe-area-inset-bottom, 0px));
	right: 16px;
	pointer-events: none;
}

.ek-ai-widget * {
	pointer-events: auto;
}

/* ── Trigger row: balon + robot ── */
.ek-ai-trigger-wrap {
	display: flex;
	align-items: center;
	flex-direction: row-reverse;
	gap: 12px;
}

.ek-ai-widget.is-open .ek-ai-trigger-wrap {
	opacity: 0;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity .25s, transform .25s;
}

/* ── Konuşma balonu ── */
.ek-ai-teaser {
	position: relative;
	max-width: 220px;
	background: #fff;
	color: #1e293b;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.45;
	padding: 10px 14px;
	border-radius: 14px 14px 4px 14px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06);
	animation: ekTeaserFloat 3s ease-in-out infinite;
}

.ek-ai-teaser-text {
	display: block;
	opacity: 1;
	transition: opacity .4s ease;
}

.ek-ai-teaser-text.is-fading {
	opacity: 0;
}

.ek-ai-teaser-arrow {
	position: absolute;
	right: -6px;
	bottom: 14px;
	width: 12px;
	height: 12px;
	background: #fff;
	transform: rotate(45deg);
	box-shadow: 2px 2px 4px rgba(0, 0, 0, .08);
}

/* ── Robot butonu ── */
.ek-ai-toggle {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(145deg, #3b82f6 0%, #7c3aed 100%);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 28px rgba(59, 130, 246, .45), 0 0 0 3px rgba(255, 255, 255, .15);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s;
	flex-shrink: 0;
}

.ek-ai-toggle:hover {
	transform: scale(1.1);
	box-shadow: 0 8px 32px rgba(59, 130, 246, .55), 0 0 0 4px rgba(255, 255, 255, .2);
}

.ek-ai-toggle:active {
	transform: scale(.96);
}

.ek-ai-pulse {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid rgba(59, 130, 246, .5);
	animation: ekPulse 2.5s ease-out infinite;
	pointer-events: none;
}

/* ── Robot SVG animasyonları ── */
.ek-robot-svg {
	width: 38px;
	height: 38px;
	animation: ekRobotBob 2.8s ease-in-out infinite;
}

.ek-robot-antenna-ball {
	animation: ekAntennaBlink 1.8s ease-in-out infinite;
}

.ek-robot-eye-l,
.ek-robot-eye-r {
	animation: ekEyeBlink 4s ease-in-out infinite;
}

.ek-robot-arm-l {
	animation: ekArmWave 2.8s ease-in-out infinite;
	transform-origin: right center;
}

.ek-robot-arm-r {
	animation: ekArmWave 2.8s ease-in-out infinite .4s;
	transform-origin: left center;
}

/* ── Chat paneli ── */
.ek-ai-panel {
	position: absolute;
	bottom: calc(100% + 12px);
	right: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: min(480px, calc(100dvh - 160px));
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, .2), 0 0 0 1px rgba(0, 0, 0, .06);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: ekPanelIn .3s cubic-bezier(.34, 1.2, .64, 1);
}

.ek-ai-panel[hidden] {
	display: none !important;
}

.ek-ai-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 16px;
	background: linear-gradient(135deg, #2563eb, #7c3aed);
	color: #fff;
	gap: 8px;
}

.ek-ai-header strong {
	flex: 1;
	font-size: 15px;
}

.ek-ai-header button {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
	padding: 0 4px;
	opacity: .85;
}

.ek-ai-header button:hover {
	opacity: 1;
}

.ek-ai-header .ek-ai-badge {
	font-size: 10px;
	background: rgba(255, 255, 255, .25);
	padding: 2px 8px;
	border-radius: 10px;
	font-weight: 600;
	white-space: nowrap;
}

.ek-ai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}

.ek-ai-msg {
	max-width: 88%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.55;
	word-wrap: break-word;
}

.ek-ai-msg.bot {
	background: #f1f5f9;
	color: #1e293b;
	align-self: flex-start;
	border-bottom-left-radius: 4px;
}

.ek-ai-msg.user {
	background: linear-gradient(135deg, #2563eb, #4f46e5);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

.ek-ai-form {
	display: flex;
	padding: 12px;
	gap: 8px;
	border-top: 1px solid #e2e8f0;
	background: #fafafa;
}

.ek-ai-form input {
	flex: 1;
	padding: 11px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	font-size: 14px;
	outline: none;
	background: #fff;
}

.ek-ai-form input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.ek-ai-form button {
	padding: 11px 18px;
	background: linear-gradient(135deg, #2563eb, #4f46e5);
	color: #fff;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	white-space: nowrap;
}

.ek-ai-form button:hover {
	filter: brightness(1.08);
}

.ek-ai-form button:disabled {
	opacity: .6;
	cursor: not-allowed;
}

/* ── Typing indicator ── */
.ek-ai-typing {
	display: flex;
	gap: 5px;
	padding: 14px !important;
	align-self: flex-start;
}

.ek-ai-typing span {
	width: 8px;
	height: 8px;
	background: #94a3b8;
	border-radius: 50%;
	animation: ekBounce 1.2s infinite;
}

.ek-ai-typing span:nth-child(2) { animation-delay: .2s; }
.ek-ai-typing span:nth-child(3) { animation-delay: .4s; }

/* ── Desktop: iletişim butonunun soluna ── */
@media (min-width: 768px) {
	.ek-ai-widget {
		bottom: 28px;
		right: 200px;
	}

	.ek-ai-teaser {
		max-width: 260px;
		font-size: 13.5px;
	}

	.ek-ai-panel {
		bottom: calc(100% + 16px);
		height: 500px;
	}
}

@media (min-width: 1200px) {
	.ek-ai-widget {
		right: 230px;
	}
}

/* ── Küçük mobil ── */
@media (max-width: 380px) {
	.ek-ai-widget {
		right: 12px;
		bottom: calc(82px + env(safe-area-inset-bottom, 0px));
	}

	.ek-ai-teaser {
		max-width: 175px;
		font-size: 12px;
		padding: 8px 12px;
	}

	.ek-ai-toggle {
		width: 54px;
		height: 54px;
	}

	.ek-robot-svg {
		width: 34px;
		height: 34px;
	}
}

/* ── Animasyonlar ── */
@keyframes ekRobotBob {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-3px); }
}

@keyframes ekAntennaBlink {
	0%, 100% { opacity: 1; }
	50% { opacity: .4; }
}

@keyframes ekEyeBlink {
	0%, 92%, 100% { transform: scaleY(1); }
	95% { transform: scaleY(.1); }
}

@keyframes ekArmWave {
	0%, 100% { transform: rotate(0deg); }
	25% { transform: rotate(-12deg); }
	75% { transform: rotate(12deg); }
}

@keyframes ekPulse {
	0% { transform: scale(1); opacity: .7; }
	70% { transform: scale(1.25); opacity: 0; }
	100% { transform: scale(1.25); opacity: 0; }
}

@keyframes ekTeaserFloat {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}

@keyframes ekPanelIn {
	from { opacity: 0; transform: translateY(12px) scale(.96); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ekBounce {
	0%, 80%, 100% { transform: translateY(0); }
	40% { transform: translateY(-6px); }
}
