/* GIT Chatbot AI - semua selector memakai awalan #gitcb-root agar tidak tertimpa gaya tema (Neve/Elementor). */

#gitcb-root {
	--gitcb-main: #1e9bd0;
	--gitcb-dark: #0b5f8a;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: #1f2937;
}

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

/* Tombol pembuka */
#gitcb-root .gitcb-launcher {
	width: 56px;
	height: 56px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--gitcb-main);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, background 0.15s ease;
}

#gitcb-root .gitcb-launcher:hover,
#gitcb-root .gitcb-launcher:focus-visible {
	background: var(--gitcb-dark);
	color: #fff;
	transform: scale(1.06);
}

/* Jendela chat */
#gitcb-root .gitcb-panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: 380px;
	max-width: calc(100vw - 24px);
	height: 560px;
	max-height: calc(100vh - 110px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
	display: none;
	flex-direction: column;
	overflow: hidden;
}

#gitcb-root.gitcb-open .gitcb-panel {
	display: flex;
}

/* Header */
#gitcb-root .gitcb-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: linear-gradient(135deg, var(--gitcb-main), var(--gitcb-dark));
	color: #fff;
	flex: 0 0 auto;
}

#gitcb-root .gitcb-title {
	font-size: 16px;
	font-weight: 600;
	color: #fff;
}

#gitcb-root .gitcb-status {
	font-size: 12px;
	opacity: 0.9;
	color: #fff;
}

#gitcb-root .gitcb-status::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: #4ade80;
}

#gitcb-root .gitcb-close {
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

#gitcb-root .gitcb-close:hover,
#gitcb-root .gitcb-close:focus-visible {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

/* Area pesan */
#gitcb-root .gitcb-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 14px;
	background: #f8fafc;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#gitcb-root .gitcb-msg {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 14px;
	text-align: left;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* Pesan pengguna: balon di kanan, teks tetap rata kiri dan turun ke baris berikutnya */
#gitcb-root .gitcb-user {
	align-self: flex-end;
	background: var(--gitcb-main);
	color: #fff;
	border-bottom-right-radius: 4px;
	white-space: pre-wrap;
}

#gitcb-root .gitcb-bot {
	align-self: flex-start;
	background: #eaf0f6;
	color: #1f2937;
	border-bottom-left-radius: 4px;
	white-space: normal;
}

#gitcb-root .gitcb-bot a {
	color: var(--gitcb-dark);
	text-decoration: underline;
	word-break: break-all;
}

#gitcb-root .gitcb-bot ul,
#gitcb-root .gitcb-bot ol {
	margin: 6px 0;
	padding-left: 20px;
}

#gitcb-root .gitcb-bot li {
	margin: 2px 0;
}

#gitcb-root .gitcb-bot strong {
	font-weight: 600;
}

/* Indikator mengetik */
#gitcb-root .gitcb-typing {
	display: flex;
	gap: 4px;
	padding: 12px 14px;
}

#gitcb-root .gitcb-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #94a3b8;
	animation: gitcb-bounce 1.2s infinite ease-in-out;
}

#gitcb-root .gitcb-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

#gitcb-root .gitcb-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes gitcb-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
	40% { transform: translateY(-5px); opacity: 1; }
}

/* Form input: kotak teks bertingkat yang tumbuh ke bawah, bukan menyamping */
#gitcb-root .gitcb-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	margin: 0;
	background: #fff;
	border-top: 1px solid #e5e7eb;
	flex: 0 0 auto;
}

#gitcb-root .gitcb-input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 40px;
	max-height: 120px;
	margin: 0;
	padding: 9px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	background: #fff;
	color: #1f2937;
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	resize: none;
	overflow-y: auto;
	box-shadow: none;
	outline: none;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

#gitcb-root .gitcb-input:focus {
	border-color: var(--gitcb-main);
	box-shadow: 0 0 0 2px rgba(30, 155, 208, 0.2);
}

#gitcb-root .gitcb-send {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 10px;
	background: var(--gitcb-main);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

#gitcb-root .gitcb-send:hover,
#gitcb-root .gitcb-send:focus-visible {
	background: var(--gitcb-dark);
	color: #fff;
}

#gitcb-root .gitcb-send:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

#gitcb-root .gitcb-foot {
	padding: 6px 12px 9px;
	background: #fff;
	color: #94a3b8;
	font-size: 11px;
	text-align: center;
	flex: 0 0 auto;
}

/* Layar kecil (HP) */
@media (max-width: 480px) {
	#gitcb-root {
		right: 12px;
		bottom: 12px;
	}

	#gitcb-root .gitcb-panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 96px);
		max-height: calc(100vh - 96px);
		bottom: 68px;
	}
}
