:root {
	--aa-chatbot-primary:          #2563EB;
	--aa-chatbot-bg:               #FFFFFF;
	--aa-chatbot-text:             #1F2937;
	--aa-chatbot-bot-bubble:       #f3f4f6;
	--aa-chatbot-user-icon-color:  #2563EB;
}

/* ===== Chat Icon ===== */
.aa-chatbot-icon {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 56px;
	height: 56px;
	min-width: 44px;
	min-height: 44px;
	border-radius: 50%;
	background-color: var(--aa-chatbot-primary);
	color: #fff;
	border: none;
	cursor: pointer;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s ease;
}
.aa-chatbot-icon:hover {
	transform: scale(1.05);
}

/* ===== Chat Window ===== */
.aa-chatbot-window {
	position: fixed;
	bottom: 88px;
	right: 20px;
	width: 360px;
	height: 520px;
	background-color: var(--aa-chatbot-bg);
	color: var(--aa-chatbot-text);
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
	display: none;
	flex-direction: column;
	z-index: 9998;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
}
.aa-chatbot-window.aa-open {
	display: flex;
}

/* ===== Header ===== */
.aa-chatbot-header {
	background-color: var(--aa-chatbot-primary);
	color: #fff;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}
.aa-chatbot-title {
	font-weight: 600;
	font-size: 15px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.aa-chatbot-online-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background-color: #22c55e;
	box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
	flex-shrink: 0;
}
.aa-chatbot-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	min-width: 44px;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
}

/* ===== Messages ===== */
.aa-chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.aa-chatbot-message-wrap {
	display: flex;
	align-items: flex-end;
	gap: 6px;
}
.aa-chatbot-message-wrap.aa-wrap-user {
	justify-content: flex-end;
}
.aa-chatbot-bubble {
	max-width: 78%;
	padding: 10px 14px;
	border-radius: 16px;
	line-height: 1.5;
	word-break: break-word;
}
.aa-chatbot-bubble.aa-user {
	background-color: var(--aa-chatbot-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.aa-chatbot-bubble.aa-assistant {
	background-color: var(--aa-chatbot-bot-bubble);
	color: var(--aa-chatbot-text);
	border-bottom-left-radius: 4px;
}

/* ===== User icon ===== */
.aa-user-icon {
	font-size: 20px;
	color: var(--aa-chatbot-user-icon-color);
	flex-shrink: 0;
	user-select: none;
}

/* ===== Typing Indicator ===== */
.aa-chatbot-typing {
	align-self: flex-start;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 10px 14px;
	background-color: var(--aa-chatbot-bot-bubble);
	border-radius: 16px;
	border-bottom-left-radius: 4px;
}
.aa-chatbot-typing span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: #9ca3af;
	animation: aa-bounce 1.2s ease-in-out infinite;
}
.aa-chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.aa-chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aa-bounce {
	0%, 80%, 100% { transform: translateY(0);    }
	40%           { transform: translateY(-6px); }
}

/* ===== Registration Form ===== */
.aa-chatbot-registration-form {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.aa-chatbot-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.aa-chatbot-field label {
	font-weight: 500;
	font-size: 13px;
}
.aa-chatbot-field input {
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 14px;
	min-height: 44px;
	width: 100%;
	box-sizing: border-box;
}
.aa-chatbot-field-error {
	color: #dc2626;
	font-size: 12px;
	min-height: 16px;
}
.aa-chatbot-reg-submit {
	background-color: var(--aa-chatbot-primary);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	min-height: 44px;
}
.aa-chatbot-reg-submit:hover {
	opacity: 0.9;
}

/* ===== Input Area ===== */
.aa-chatbot-input-area {
	padding: 10px 12px;
	border-top: 1px solid #e5e7eb;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex-shrink: 0;
}
.aa-chatbot-input-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}
.aa-chatbot-textarea {
	flex: 1;
	box-sizing: border-box;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 14px;
	resize: none;
	font-family: inherit;
}
.aa-chatbot-char-counter {
	font-size: 11px;
	color: #9ca3af;
	text-align: right;
}
.aa-chatbot-char-counter.aa-near-limit {
	color: #dc2626;
}
.aa-chatbot-send {
	background-color: var(--aa-chatbot-primary);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	min-height: 44px;
	flex-shrink: 0;
	white-space: nowrap;
}
.aa-chatbot-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ===== Notice ===== */
.aa-chatbot-notice {
	padding: 8px 12px;
	background-color: #fef3c7;
	color: #92400e;
	border-radius: 6px;
	font-size: 13px;
	text-align: center;
}
.aa-chatbot-notice.aa-error {
	background-color: #fef2f2;
	color: #991b1b;
}

/* ===== Footer ===== */
.aa-chatbot-footer {
	text-align: center;
	padding: 6px;
	font-size: 11px;
	border-top: 1px solid #e5e7eb;
	flex-shrink: 0;
}
.aa-chatbot-footer a {
	color: #6b7280;
	text-decoration: none;
}

/* ===== Unavailable state ===== */
.aa-chatbot-unavailable .aa-chatbot-input-area {
	opacity: 0.5;
	pointer-events: none;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
	.aa-chatbot-icon {
		bottom: 16px;
		right: 16px;
		width: 56px;
		height: 56px;
	}
	.aa-chatbot-window {
		bottom: 0;
		right: 0;
		left: 0;
		width: 100%;
		height: 100%;
		border-radius: 0;
	}
}
