/* ===== 🦞 LOBSTER CHAT ASSISTANT ===== */

/* Floating Action Button */
#chatFab {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: linear-gradient(135deg, #1a6b3c 0%, #145a30 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	cursor: pointer;
	box-shadow: 0 4px 20px rgba(26, 107, 60, 0.5);
	z-index: 9998;
	transition: all 0.3s ease;
	animation: fabPulse 3s ease-in-out infinite;
}

#chatFab:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 28px rgba(26, 107, 60, 0.6);
}

#chatFab.hidden {
	transform: scale(0);
	opacity: 0;
	pointer-events: none;
}

@keyframes fabPulse {
	0%, 100% { box-shadow: 0 4px 20px rgba(26, 107, 60, 0.5); }
	50% { box-shadow: 0 4px 30px rgba(26, 107, 60, 0.8); }
}

/* Chat Window */
#chatWindow {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 380px;
	height: 520px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: scale(0) translateY(20px);
	transform-origin: bottom right;
	opacity: 0;
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	pointer-events: none;
}

#chatWindow.open {
	transform: scale(1) translateY(0);
	opacity: 1;
	pointer-events: auto;
}

/* Chat Header */
.chat-header {
	background: linear-gradient(135deg, #003580 0%, #0071c2 100%);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.chat-header-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

.chat-avatar {
	font-size: 28px;
}

.chat-title {
	font-size: 0.95rem;
	font-weight: 600;
}

.chat-status {
	font-size: 0.75rem;
	opacity: 0.8;
	display: flex;
	align-items: center;
	gap: 4px;
}

.chat-status::before {
	content: '';
	width: 6px;
	height: 6px;
	background: #2ecc71;
	border-radius: 50%;
	display: inline-block;
}

.chat-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 1.2rem;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
	transition: background 0.2s;
}

.chat-close:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.chat-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f5f7fa;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Messages */
.chat-msg {
	display: flex;
	gap: 8px;
	max-width: 85%;
	animation: msgFadeIn 0.3s ease;
}

@keyframes msgFadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
	align-self: flex-start;
}

.chat-msg.user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.chat-msg-avatar {
	font-size: 20px;
	flex-shrink: 0;
	margin-top: 4px;
}

.chat-msg-bubble {
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 0.88rem;
	line-height: 1.5;
	word-break: break-word;
}

.chat-msg.bot .chat-msg-bubble {
	background: #fff;
	color: #1a1a2e;
	border: 1px solid #e8e8e8;
	border-bottom-left-radius: 4px;
}

.chat-msg.user .chat-msg-bubble {
	background: linear-gradient(135deg, #0071c2 0%, #003580 100%);
	color: #fff;
	border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing-dots span {
	animation: typingBounce 1.4s infinite ease-in-out;
	font-size: 1.5rem;
	line-height: 1;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
	0%, 60%, 100% { opacity: 0.3; }
	30% { opacity: 1; }
}

/* Input Area */
.chat-input-area {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	background: #fff;
	border-top: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.chat-input-area input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 10px 16px;
	font-size: 0.88rem;
	outline: none;
	transition: border-color 0.2s;
}

.chat-input-area input:focus {
	border-color: #0071c2;
}

.chat-mic-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: #f0f0f0;
	color: #666;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	flex-shrink: 0;
}

.chat-mic-btn:hover {
	background: #e0e0e0;
}

.chat-mic-btn.listening {
	background: #ff4444;
	color: #fff;
	animation: micPulse 1s ease-in-out infinite;
}

@keyframes micPulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4); }
	50% { box-shadow: 0 0 0 10px rgba(255, 68, 68, 0); }
}

.chat-send-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: #0071c2;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	flex-shrink: 0;
}

.chat-send-btn:hover {
	background: #005fa3;
}

/* Confirmation Card */
.chat-confirm-card {
	background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
	border: 1px solid #b8d4f0;
	border-radius: 12px;
	padding: 14px;
	margin-top: 4px;
}

.confirm-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 0;
	border-bottom: 1px solid rgba(0, 113, 194, 0.1);
}

.confirm-row:last-of-type {
	border-bottom: none;
}

.confirm-label {
	font-size: 0.82rem;
	color: #555;
}

.confirm-value {
	font-size: 0.88rem;
	font-weight: 600;
	color: #003580;
}

.confirm-buttons {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.confirm-btn {
	flex: 1;
	padding: 10px 12px;
	border: none;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.confirm-yes {
	background: #0071c2;
	color: #fff;
}

.confirm-yes:hover {
	background: #005fa3;
}

.confirm-edit {
	background: #f0f0f0;
	color: #555;
}

.confirm-edit:hover {
	background: #e0e0e0;
}

/* Mobile responsive */
@media (max-width: 480px) {
	#chatWindow {
		width: 100%;
		height: 100%;
		bottom: 0;
		right: 0;
		border-radius: 0;
	}
	
	#chatFab {
		bottom: 16px;
		right: 16px;
		width: 56px;
		height: 56px;
		font-size: 28px;
	}
}
