/* =========================================================
   AI Dilekce Asistani - Widget
   Marka: --renk-ana #002D62 (lacivert) / --renk-ikincil #DAA520 (altin)
   z-index 99990: hukuki uyari modali 100000 kullaniyor, onun ALTINDA kalmali.
   ========================================================= */

#hdChatbot {
	--hd-ana: #002D62;
	--hd-altin: #DAA520;
	--hd-zemin: #f6f8fb;
	--hd-cizgi: #e3e8ef;
	--hd-metin: #1f2937;
	--hd-soluk: #6b7280;

	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99990;
	font-family: inherit;
	line-height: 1.5;
}

#hdChatbot *,
#hdChatbot *::before,
#hdChatbot *::after { box-sizing: border-box; }

/* ---------- Sitenin "yukari cik" butonuyla cakisma ----------
   .footer-yukari-cik da sag altta (right:24 bottom:24, 44px).
   Asistan balonu 68px olup ustune biniyor ve butonu tiklanamaz
   hale getiriyordu. Butonu balonun USTUNE aliyoruz.

   Bu kural bilerek chatbot.css icinde: asistan kapatilirsa
   (chatbot_aktif = FALSE) bu dosya hic yuklenmez ve buton
   kendiliginden eski yerine doner. */
/* Masaustu: yukari cik ustte, asistan altta (kose asistanin) */
.footer-yukari-cik {
	bottom: 104px !important;   /* balon 68px + 24px alt bosluk + 12px aralik */
}

/* Mobilde sira TERS (asistan ustte) - konumlandirma dosyanin
   sonundaki mobil blogunda, tek yerde tutuluyor. */
@media (max-width: 480px) {
	.footer-yukari-cik {
		bottom: 16px !important;   /* kendi orijinal yeri, en altta */
	}
}

/* ---------- Acilis balonu (mascot) ---------- */

.hd-balon {
	position: relative;
	width: 68px;
	height: 68px;
	border: 0;
	border-radius: 50%;
	padding: 0;
	cursor: pointer;
	background: var(--hd-ana);
	box-shadow: 0 8px 26px rgba(0, 45, 98, .38);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: visible;
	transition: transform .22s ease, box-shadow .22s ease;
}
.hd-balon:hover { transform: scale(1.06); box-shadow: 0 12px 32px rgba(0, 45, 98, .48); }
.hd-balon:active { transform: scale(.97); }
.hd-balon:focus-visible { outline: 3px solid var(--hd-altin); outline-offset: 3px; }

.hd-balon img,
.hd-balon svg {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

/* Nefes alan halka */
.hd-balon::after {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid var(--hd-altin);
	opacity: 0;
	animation: hdNefes 2.6s ease-out infinite;
	pointer-events: none;
}
@keyframes hdNefes {
	0%   { transform: scale(.92); opacity: .8; }
	70%  { transform: scale(1.22); opacity: 0; }
	100% { transform: scale(1.22); opacity: 0; }
}

.hd-rozet {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: #e11d48;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
}
.hd-rozet[hidden] { display: none; }

/* ---------- Proaktif ipucu ---------- */

.hd-ipucu {
	position: absolute;
	right: 82px;
	bottom: 12px;
	width: max-content;
	max-width: 240px;
	background: #fff;
	color: var(--hd-metin);
	font-size: 13.5px;
	padding: 11px 34px 11px 14px;
	border-radius: 14px 14px 2px 14px;
	box-shadow: 0 6px 22px rgba(0, 0, 0, .16);
	animation: hdIpucuGel .35s ease;
}
.hd-ipucu[hidden] { display: none; }
@keyframes hdIpucuGel {
	from { opacity: 0; transform: translateX(12px); }
	to   { opacity: 1; transform: translateX(0); }
}
.hd-ipucu-kapat {
	position: absolute;
	top: 4px;
	right: 6px;
	border: 0;
	background: none;
	color: var(--hd-soluk);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	padding: 3px 5px;
}

/* ---------- Panel ---------- */

.hd-panel {
	position: absolute;
	right: 0;
	bottom: 84px;
	width: 384px;
	height: 566px;
	max-height: calc(100vh - 130px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(0, 20, 50, .28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: bottom right;
	animation: hdPanelGel .24s cubic-bezier(.2, .9, .3, 1.2);
}
.hd-panel[hidden] { display: none; }
@keyframes hdPanelGel {
	from { opacity: 0; transform: translateY(14px) scale(.94); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Baslik ---------- */

.hd-baslik {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 13px 14px;
	background: var(--hd-ana);
	color: #fff;
}
.hd-baslik-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	flex-shrink: 0;
	overflow: hidden;
}
.hd-baslik-avatar img,
.hd-baslik-avatar svg { width: 100%; height: 100%; display: block; object-fit: cover; }

.hd-baslik-yazi { flex: 1; min-width: 0; }
.hd-baslik-ad {
	font-size: 15px;
	font-weight: 700;
	margin: 0;
	line-height: 1.25;
}
.hd-baslik-durum {
	font-size: 11.5px;
	opacity: .82;
	display: flex;
	align-items: center;
	gap: 5px;
}
.hd-baslik-durum::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #34d399;
}

.hd-ikon-btn {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	cursor: pointer;
	font-size: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background .15s;
}
.hd-ikon-btn:hover { background: rgba(255, 255, 255, .26); }
.hd-ikon-btn.acik { background: var(--hd-altin); color: var(--hd-ana); }
.hd-ikon-btn:disabled { opacity: .38; cursor: default; }
.hd-ikon-btn:disabled:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Mesaj alani ---------- */

.hd-akis {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 14px;
	background: var(--hd-zemin);
	scrollbar-width: thin;
}
.hd-akis::-webkit-scrollbar { width: 7px; }
.hd-akis::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.hd-mesaj {
	max-width: 88%;
	margin-bottom: 11px;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	animation: hdMesajGel .22s ease;
}
@keyframes hdMesajGel {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}
.hd-mesaj strong { font-weight: 700; }

.hd-bot {
	background: #fff;
	color: var(--hd-metin);
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}
.hd-kullanici {
	background: var(--hd-ana);
	color: #fff;
	margin-left: auto;
	border-bottom-right-radius: 4px;
}
.hd-sistem {
	background: #fef3c7;
	color: #78350f;
	font-size: 13px;
	max-width: 100%;
	text-align: center;
}

/* yaziyor... */
.hd-yaziyor {
	display: inline-flex;
	gap: 4px;
	padding: 13px;
}
.hd-yaziyor span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9ca3af;
	animation: hdZipla 1.3s infinite;
}
.hd-yaziyor span:nth-child(2) { animation-delay: .18s; }
.hd-yaziyor span:nth-child(3) { animation-delay: .36s; }
@keyframes hdZipla {
	0%, 60%, 100% { transform: translateY(0); opacity: .45; }
	30%           { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Sonuc kartlari ---------- */

.hd-kartlar { margin: 0 0 12px; }

.hd-kart {
	display: block;
	background: #fff;
	border: 1px solid var(--hd-cizgi);
	border-left: 3px solid var(--hd-altin);
	border-radius: 10px;
	padding: 11px 13px;
	margin-bottom: 7px;
	text-decoration: none;
	color: inherit;
	transition: border-color .15s, transform .15s, box-shadow .15s;
}
.hd-kart:hover {
	border-color: var(--hd-ana);
	border-left-color: var(--hd-altin);
	transform: translateX(2px);
	box-shadow: 0 3px 10px rgba(0, 45, 98, .1);
	text-decoration: none;
	color: inherit;
}
.hd-kart-ust {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 3px;
}
.hd-kart-etiket {
	font-size: 10.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .3px;
	color: var(--hd-ana);
	background: rgba(0, 45, 98, .08);
	padding: 2px 7px;
	border-radius: 4px;
}
.hd-kart-baslik {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--hd-ana);
	line-height: 1.35;
}
.hd-kart-ozet {
	font-size: 12px;
	color: var(--hd-soluk);
	margin-top: 3px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.hd-kart-ac {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--hd-altin);
	margin-top: 6px;
	display: inline-block;
}

/* ---------- Cipler ---------- */

.hd-cipler {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}
.hd-cip {
	border: 1px solid var(--hd-ana);
	background: #fff;
	color: var(--hd-ana);
	border-radius: 16px;
	padding: 6px 12px;
	font-size: 12.5px;
	cursor: pointer;
	transition: background .15s, color .15s;
	font-family: inherit;
}
.hd-cip:hover { background: var(--hd-ana); color: #fff; }

/* ---------- Mesaj alti geri bildirim ---------- */

.hd-oy {
	display: flex;
	gap: 5px;
	margin: -6px 0 12px 2px;
}
.hd-oy button {
	border: 1px solid var(--hd-cizgi);
	background: #fff;
	border-radius: 6px;
	width: 27px;
	height: 25px;
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
	color: var(--hd-soluk);
	transition: all .15s;
}
.hd-oy button:hover { border-color: var(--hd-ana); color: var(--hd-ana); }
.hd-oy button.secili { background: var(--hd-ana); border-color: var(--hd-ana); color: #fff; }
.hd-oy.bitti button:not(.secili) { opacity: .35; pointer-events: none; }

/* ---------- 1-5 puanlama ---------- */

.hd-puan {
	background: #fff;
	border: 1px solid var(--hd-cizgi);
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 12px;
	text-align: center;
	animation: hdMesajGel .25s ease;
}
.hd-puan-baslik {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--hd-metin);
	margin-bottom: 10px;
}
.hd-yildizlar {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin-bottom: 10px;
}
.hd-yildiz {
	border: 0;
	background: none;
	cursor: pointer;
	font-size: 27px;
	line-height: 1;
	padding: 0 2px;
	color: #d1d5db;
	transition: transform .12s, color .12s;
}
.hd-yildiz:hover { transform: scale(1.16); }
.hd-yildiz.dolu { color: var(--hd-altin); }

.hd-puan textarea {
	width: 100%;
	border: 1px solid var(--hd-cizgi);
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	font-family: inherit;
	resize: none;
	margin-bottom: 8px;
}
.hd-puan textarea:focus { outline: none; border-color: var(--hd-ana); }
.hd-puan-gonder {
	background: var(--hd-ana);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 8px 20px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
}
.hd-puan-gonder:hover { background: #003d82; }
.hd-puan-atla {
	display: block;
	margin: 8px auto 0;
	border: 0;
	background: none;
	color: var(--hd-soluk);
	font-size: 12px;
	cursor: pointer;
	text-decoration: underline;
	font-family: inherit;
}

/* ---------- Giris alani ---------- */

.hd-alt {
	flex-shrink: 0;
	border-top: 1px solid var(--hd-cizgi);
	background: #fff;
	padding: 9px 10px;
}
.hd-giris {
	display: flex;
	align-items: flex-end;
	gap: 6px;
}
.hd-giris textarea {
	flex: 1;
	border: 1px solid var(--hd-cizgi);
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	font-family: inherit;
	resize: none;
	max-height: 96px;
	min-height: 40px;
	line-height: 1.4;
}
.hd-giris textarea:focus {
	outline: none;
	border-color: var(--hd-ana);
	box-shadow: 0 0 0 3px rgba(0, 45, 98, .09);
}

.hd-yuvarlak-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 0;
	cursor: pointer;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	transition: background .15s, transform .12s;
}
.hd-mikrofon { background: #eef2f7; color: var(--hd-ana); }
.hd-mikrofon:hover { background: #dde5ef; }
.hd-mikrofon.dinliyor {
	background: #e11d48;
	color: #fff;
	animation: hdNabiz 1.1s infinite;
}
@keyframes hdNabiz {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.12); }
}
.hd-oynat {
	background: #eef2f7;
	color: var(--hd-ana);
	font-size: 14px;
}
.hd-oynat:hover:not(:disabled) { background: #dde5ef; }
.hd-oynat:disabled { opacity: .4; cursor: default; }
.hd-oynat.okuyor {
	background: var(--hd-altin);
	color: var(--hd-ana);
	animation: hdOkuma 1.6s ease-in-out infinite;
}
@keyframes hdOkuma {
	0%, 100% { box-shadow: 0 0 0 0 rgba(218, 165, 32, .6); }
	50%      { box-shadow: 0 0 0 6px rgba(218, 165, 32, 0); }
}

.hd-gonder { background: var(--hd-ana); color: #fff; }
.hd-gonder:hover { background: #003d82; }
.hd-gonder:disabled { opacity: .45; cursor: not-allowed; }

.hd-honeypot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.hd-uyari {
	font-size: 10.5px;
	color: var(--hd-soluk);
	text-align: center;
	margin-top: 6px;
	line-height: 1.4;
}

/* ---------- Mobil ---------- */

@media (max-width: 480px) {
	/* Mobilde asistan USTTE, "yukari cik" butonu altta.
	   Telefonun alt cubugu / tarayici arayuzu asistani kapatmasin
	   ve basparmakla daha kolay ulasilsin diye.
	   68px = yukari-cik 40px + 16px alt bosluk + 12px aralik */
	#hdChatbot { right: 16px; bottom: 68px; }

	/* Alt barda artik 3 yuvarlak dugme var; metin kutusuna yer acalim */
	.hd-giris { gap: 5px; }
	.hd-yuvarlak-btn { width: 38px; height: 38px; font-size: 15px; }
	.hd-giris textarea { padding: 9px 12px; }

	.hd-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
	.hd-ipucu { max-width: 190px; font-size: 12.5px; }
	.hd-balon { width: 60px; height: 60px; }
}

/* Hareket azaltma tercihi */
@media (prefers-reduced-motion: reduce) {
	#hdChatbot *,
	#hdChatbot *::after {
		animation: none !important;
		transition: none !important;
	}
}
