/* Karavan Ustası sohbet asistanı (gemini-ai-asistan 2.x). Renkler sitenin Elementor paletinden. */
#gaa-root {
	--gaa-accent: #da5f33;
	--gaa-accent-dark: #b94a22;
	--gaa-green: #2d3d2f;
	--gaa-olive: #627a40;
	--gaa-cream: #f4eed6;
	--gaa-paper: #faf7ee;
	--gaa-card: #ffffff;
	--gaa-ink: #22302a;
	--gaa-muted: #6b746c;
	--gaa-line: #e6dfcb;
	--gaa-shadow: 0 18px 50px rgba(34, 48, 42, .22), 0 4px 14px rgba(34, 48, 42, .12);
	--gaa-font: Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font: 15px/1.5 var(--gaa-font);
	color: var(--gaa-ink);
}
#gaa-root *, #gaa-root *::before, #gaa-root *::after { box-sizing: border-box; }
#gaa-root [hidden] { display: none !important; }
#gaa-root button {
	margin: 0; padding: 0; border: 0; background: none; box-shadow: none; color: inherit;
	font: inherit; line-height: 1.2; text-transform: none; letter-spacing: normal; min-height: 0; min-width: 0;
	cursor: pointer; border-radius: 0; text-decoration: none;
}
#gaa-root button:focus-visible, #gaa-root a:focus-visible, #gaa-root textarea:focus-visible {
	outline: 2px solid var(--gaa-accent); outline-offset: 2px;
}
#gaa-root svg { display: block; width: 100%; height: 100%; }
#gaa-root .gaa-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Balon */
#gaa-root #gaa-chat-bubble {
	position: fixed; right: 20px; bottom: 80px; z-index: 9998;
	width: 60px; height: 60px; border-radius: 50%;
	background: var(--gaa-accent); color: #fff;
	display: grid; place-items: center;
	box-shadow: 0 10px 26px rgba(218, 95, 51, .38), 0 2px 6px rgba(34, 48, 42, .18);
	transition: transform .18s ease, background-color .18s ease, opacity .2s ease, visibility .2s ease;
}
#gaa-root #gaa-chat-bubble:hover { transform: translateY(-2px) scale(1.04); background: var(--gaa-accent-dark); }
#gaa-root #gaa-chat-bubble svg { width: 30px; height: 30px; }
#gaa-root #gaa-chat-bubble .gaa-ico-close { display: none; width: 24px; height: 24px; }
#gaa-root.gaa-open #gaa-chat-bubble .gaa-ico-chat { display: none; }
#gaa-root.gaa-open #gaa-chat-bubble .gaa-ico-close { display: block; }
#gaa-root .gaa-ico-chat circle { fill: var(--gaa-accent); }
#gaa-root #gaa-chat-bubble:hover .gaa-ico-chat circle { fill: var(--gaa-accent-dark); }

/* İpucu */
#gaa-root #gaa-chat-tooltip {
	position: fixed; right: 92px; bottom: 90px; z-index: 9997;
	display: flex; align-items: center; gap: 4px;
	background: var(--gaa-card); color: var(--gaa-ink);
	border: 1px solid var(--gaa-line); border-radius: 14px 14px 4px 14px;
	box-shadow: 0 8px 24px rgba(34, 48, 42, .14);
	padding: 4px 4px 4px 14px; max-width: min(280px, calc(100vw - 120px));
	animation: gaa-pop .25s ease-out;
	transition: opacity .2s ease, visibility .2s ease;
}
#gaa-root .gaa-tip-text { font-size: 14px; text-align: left; padding: 6px 0; }
#gaa-root .gaa-tip-close { width: 28px; height: 28px; border-radius: 50%; color: var(--gaa-muted); font-size: 18px; flex: none; }
#gaa-root .gaa-tip-close:hover { background: var(--gaa-paper); }

/* Panel */
#gaa-root #gaa-chat-container {
	position: fixed; right: 20px; bottom: 152px; z-index: 9999;
	width: 384px; height: min(620px, calc(100vh - 172px)); height: min(620px, calc(100dvh - 172px));
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--gaa-paper); border-radius: 18px; box-shadow: var(--gaa-shadow);
	border: 1px solid rgba(45, 61, 47, .08);
	transform-origin: bottom right; animation: gaa-in .2s ease-out;
}
#gaa-root .gaa-head {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 10px 14px 16px; background: var(--gaa-green); color: var(--gaa-cream);
}
#gaa-root .gaa-avatar {
	width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden;
	background: var(--gaa-cream); color: var(--gaa-green); display: grid; place-items: center;
	font-weight: 700; font-size: 14px; border: 2px solid rgba(244, 238, 214, .35);
}
#gaa-root .gaa-avatar img { width: 100%; height: 100%; object-fit: cover; }
#gaa-root .gaa-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#gaa-root .gaa-head-text strong { font: 600 16px/1.25 "Playfair Display", Georgia, serif; color: #fff; }
#gaa-root .gaa-head-text small { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gaa-root .gaa-dot-online { flex: none; }
#gaa-root .gaa-dot-online { width: 8px; height: 8px; border-radius: 50%; background: #8fd16a; box-shadow: 0 0 0 2px rgba(143, 209, 106, .25); }
#gaa-root .gaa-icon-btn { width: 36px; height: 36px; border-radius: 10px; padding: 8px; color: var(--gaa-cream); flex: none; }
#gaa-root .gaa-icon-btn:hover { background: rgba(244, 238, 214, .12); }

#gaa-root .gaa-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; scroll-behavior: smooth; }
#gaa-root .gaa-log { display: flex; flex-direction: column; gap: 10px; }
#gaa-root .gaa-msg {
	max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5;
	overflow-wrap: anywhere; animation: gaa-pop .18s ease-out;
}
#gaa-root .gaa-msg.bot { align-self: flex-start; background: var(--gaa-card); border: 1px solid var(--gaa-line); border-bottom-left-radius: 5px; }
#gaa-root .gaa-msg.user { align-self: flex-end; background: var(--gaa-green); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
#gaa-root .gaa-msg.note { align-self: center; background: transparent; color: var(--gaa-muted); font-size: 12.5px; text-align: center; padding: 2px 8px; }
#gaa-root .gaa-msg p { margin: 0 0 .5em; }
#gaa-root .gaa-msg p:last-child, #gaa-root .gaa-msg ul:last-child, #gaa-root .gaa-msg ol:last-child { margin-bottom: 0; }
#gaa-root .gaa-msg ul, #gaa-root .gaa-msg ol { margin: 0 0 .5em; padding-left: 1.2em; }
#gaa-root .gaa-msg li { margin: .15em 0; }
#gaa-root .gaa-msg strong { font-weight: 650; }
#gaa-root .gaa-msg a { color: var(--gaa-accent-dark); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
#gaa-root .gaa-msg.user a { color: #fff; }
#gaa-root .gaa-msg .gaa-cta {
	display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 12px; border-radius: 999px;
	background: #1f8a4c; color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 600;
}
#gaa-root .gaa-msg .gaa-cta svg { width: 16px; height: 16px; }
#gaa-root .gaa-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
#gaa-root .gaa-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--gaa-muted); opacity: .4; animation: gaa-blink 1.2s infinite; }
#gaa-root .gaa-typing span:nth-child(2) { animation-delay: .2s; }
#gaa-root .gaa-typing span:nth-child(3) { animation-delay: .4s; }

#gaa-root .gaa-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; justify-content: flex-end; }
#gaa-root .gaa-quick button {
	padding: 8px 12px; border-radius: 999px; font-size: 13.5px; line-height: 1.25; text-align: left;
	background: var(--gaa-card); color: var(--gaa-green); border: 1px solid var(--gaa-accent);
	transition: background-color .15s ease, color .15s ease;
}
#gaa-root .gaa-quick button:hover { background: var(--gaa-accent); color: #fff; }

#gaa-root .gaa-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; background: var(--gaa-card); border-top: 1px solid var(--gaa-line); margin: 0; }
#gaa-root .gaa-compose textarea {
	flex: 1; resize: none; min-height: 42px; max-height: 128px; margin: 0;
	padding: 10px 14px; border-radius: 21px; border: 1px solid var(--gaa-line); background: var(--gaa-paper);
	font: 15px/1.4 var(--gaa-font); color: var(--gaa-ink); box-shadow: none; outline: none;
}
#gaa-root .gaa-compose textarea:focus { border-color: var(--gaa-olive); background: #fff; }
#gaa-root .gaa-send {
	width: 42px; height: 42px; border-radius: 50%; flex: none; padding: 10px;
	background: var(--gaa-accent); color: #fff; transition: background-color .15s ease, opacity .15s ease;
}
#gaa-root .gaa-send:hover:not(:disabled) { background: var(--gaa-accent-dark); }
#gaa-root .gaa-send:disabled { opacity: .4; cursor: default; }

#gaa-root .gaa-foot {
	display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
	padding: 8px 14px 10px; background: var(--gaa-card); font-size: 11.5px; color: var(--gaa-muted);
}
#gaa-root .gaa-wa { display: inline-flex; align-items: center; gap: 5px; color: #1f8a4c; font-weight: 600; font-size: 12.5px; text-decoration: none; }
#gaa-root .gaa-wa svg { width: 16px; height: 16px; }
#gaa-root .gaa-wa:hover { text-decoration: underline; }

@keyframes gaa-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes gaa-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes gaa-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: .9; } }

@media (max-width: 600px) {
	#gaa-root #gaa-chat-bubble { right: 16px; bottom: 80px; width: 56px; height: 56px; }
	#gaa-root #gaa-chat-tooltip { right: 16px; bottom: 146px; border-radius: 14px 14px 4px 14px; max-width: calc(100vw - 32px); }
	#gaa-root #gaa-chat-container {
		inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh;
		border-radius: 0; border: 0; animation-name: gaa-pop;
		padding-bottom: env(safe-area-inset-bottom);
	}
	#gaa-root .gaa-head { padding-top: calc(14px + env(safe-area-inset-top)); }
	#gaa-root.gaa-open #gaa-chat-bubble, #gaa-root.gaa-open #gaa-chat-tooltip { display: none; }
	#gaa-root .gaa-compose textarea { font-size: 16px; } /* iOS yakınlaştırmasın */
}
@media (prefers-reduced-motion: reduce) {
	#gaa-root *, #gaa-root *::before, #gaa-root *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
html.gaa-lock, html.gaa-lock body { overflow: hidden; }
