/* Premium XBrandAds Chat Widget CSS */
#xba-chat-widget {
	position: fixed;
	bottom: var(--xba-chat-bottom, 20px);
	right: var(--xba-chat-right, 20px);
	z-index: 9999;
	font-family: 'Inter', sans-serif;
}

.xba-chat-toggle-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.xba-chat-badge {
	position: absolute;
	right: calc(100% + 15px);
	white-space: nowrap;
	padding: 8px 16px;
	border-radius: 30px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	opacity: 0;
	transform: translateX(20px);
	animation: xbaBadgeSlideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1s forwards;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.xba-chat-badge.hidden {
	opacity: 0 !important;
	transform: translateX(20px) !important;
}

@keyframes xbaBadgeSlideIn {
	to {
		opacity: 1;
		transform: translateX(0);
		pointer-events: auto;
	}
}

@media (max-width: 480px) {
	.xba-chat-badge {
		display: none !important;
	}
}

#xba-chat-toggle {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background-color: var(--xba-chat-primary, #DF1117);
	color: #fff;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(223, 17, 23, 0.35), 0 4px 8px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
	overflow: hidden;
	position: relative;
	z-index: 2;
}

#xba-chat-toggle:hover {
	transform: scale(1.08) translateY(-2px);
	box-shadow: 0 12px 30px rgba(223, 17, 23, 0.45), 0 6px 12px rgba(0, 0, 0, 0.15);
}

#xba-chat-window {
	position: absolute;
	bottom: 65px;
	right: 0;
	width: 370px;
	height: 520px;
	max-width: calc(100vw - var(--xba-chat-right, 20px) - 20px);
	max-height: calc(100vh - var(--xba-chat-bottom, 20px) - 90px);
	background: #ffffff;
	border-radius: 20px 20px 4px 20px;
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: opacity 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
	transform-origin: bottom right;
}

/* Glassmorphism setting */
#xba-chat-window.xba-glass-window {
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.4);
}

#xba-chat-window.xba-hidden {
	opacity: 0;
	pointer-events: none;
	transform: scale(0.95) translateY(10px);
}

.xba-chat-header {
	background-color: var(--xba-chat-secondary, #032330);
	color: var(--xba-chat-text, #ffffff);
	padding: 8px 8px 8px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Gradient Header setting */
.xba-gradient-header {
	background: linear-gradient(135deg, var(--xba-chat-secondary, #032330) 0%, #0a3b50 100%);
}

.xba-chat-header h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--xba-chat-text, #ffffff);
	letter-spacing: -0.3px;
}

.xba-chat-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

#xba-chat-close,
#xba-chat-new {
	background: transparent;
	border: none;
	color: inherit;
	cursor: pointer;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

#xba-chat-close {
	font-size: 26px;
	padding: 6px 14px;
	font-weight: 300;
	opacity: 0.8;
	transition: opacity 0.2s, transform 0.2s;
}

#xba-chat-close:hover {
	opacity: 1;
	transform: rotate(90deg);
}

#xba-chat-new {
	opacity: 0.9;
	border: 1px solid rgba(255, 255, 255, 0.4);
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	transition: background 0.2s, opacity 0.2s, border-color 0.2s;
}

#xba-chat-new:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.7);
}

.xba-chat-body {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	background: transparent;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.xba-chat-message {
	max-width: 82%;
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.5;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	animation: xbaMsgSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes xbaMsgSlideUp {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.xba-chat-message p {
	margin: 0 0 10px 0;
}
.xba-chat-message p:last-child {
	margin-bottom: 0;
}

.xba-chat-message a {
	color: var(--xba-chat-primary, #DF1117);
	font-weight: 700;
	text-decoration: underline;
	transition: color 0.2s;
}
.xba-chat-message a:hover {
	color: #A50D12;
}

.xba-chat-message ul,
.xba-chat-message ol {
	margin: 10px 0;
	padding-inline-start: 24px;
}

.xba-chat-message h3,
.xba-chat-message h4,
.xba-chat-message h5 {
	margin: 14px 0 8px 0;
	font-size: 1.1em;
	font-weight: bold;
}

.xba-chat-message.bot {
	align-self: flex-start;
	background: #f1f3f5;
	color: #2D2D2D;
	border-radius: 18px 18px 18px 4px;
}

.xba-chat-message.user {
	align-self: flex-end;
	background: var(--xba-chat-primary, #DF1117);
	color: #fff;
	border-radius: 18px 18px 4px 18px;
}

.xba-chat-footer {
	padding: 16px 20px;
	background: transparent;
	border-top: 1px solid #f0f0f0;
	display: flex;
	gap: 10px;
}

#xba-chat-input {
	flex: 1;
	padding: 12px 16px;
	border: 1px solid #e0e0e0;
	border-radius: 24px;
	outline: none;
	background: #fcfcfc;
	font-size: 14px;
	transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

#xba-chat-input:focus {
	border-color: var(--xba-chat-primary, #DF1117);
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(223, 17, 23, 0.1);
}

#xba-chat-send {
	background: var(--xba-chat-secondary, #032330);
	color: var(--xba-chat-text, #ffffff);
	border: none;
	padding: 12px 18px;
	border-radius: 24px;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

#xba-chat-send:hover {
	background: #0a3b50;
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#xba-chat-send:active {
	transform: translateY(0);
}

.xba-chat-typing {
	font-style: italic;
	color: #888;
	font-size: 12px;
	margin-left: 14px;
	animation: fadeIn 0.3s;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* Hide Google reCAPTCHA v3 floating badge */
.grecaptcha-badge {
	visibility: hidden !important;
}