/**
 * Lulebo WP Chat Widget Styles
 *
 * @package Lulebo_WP_Chat
 */

:root {
	--lulebo-primary-color: #0066cc;
	--lulebo-widget-position: bottom-right;
}

/* Floating Action Button (FAB) */
.lulebo-chat-button {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background-color: var(--lulebo-primary-color);
	color: #fff;
	border: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	z-index: 9998;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lulebo-chat-button:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.lulebo-chat-button.position-left {
	right: auto;
	left: 20px;
}

/* Chat Window */
.lulebo-chat-window {
	position: fixed;
	bottom: 90px;
	right: 20px;
	width: 380px;
	max-width: calc(100vw - 40px);
	height: 600px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	display: none;
	flex-direction: column;
	z-index: 9999;
	overflow: hidden;
}

.lulebo-chat-window.open {
	display: flex;
}

.lulebo-chat-window.position-left {
	right: auto;
	left: 20px;
}

/* Chat Header */
.lulebo-chat-header {
	background-color: var(--lulebo-primary-color);
	color: #fff;
	padding: 16px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-weight: 500;
	font-size: 16px;
}

.lulebo-chat-header-title {
	margin: 0;
	font-size: 16px;
	font-weight: 500;
}

.lulebo-chat-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	opacity: 0.9;
}

.lulebo-chat-close:hover {
	opacity: 1;
}

/* Message List */
.lulebo-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #f9f9f9;
}

/* Message Bubble */
.lulebo-message {
	display: flex;
	flex-direction: column;
	max-width: 80%;
	animation: fadeIn 0.3s ease;
}

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

.lulebo-message.visitor {
	align-self: flex-end;
}

.lulebo-message.assistant {
	align-self: flex-start;
}

.lulebo-message-bubble {
	padding: 12px 16px;
	border-radius: 18px;
	word-wrap: break-word;
	line-height: 1.5;
}

.lulebo-message.visitor .lulebo-message-bubble {
	background-color: var(--lulebo-primary-color);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.lulebo-message.assistant .lulebo-message-bubble {
	background-color: #fff;
	color: #333;
	border: 1px solid #e0e0e0;
	border-bottom-left-radius: 4px;
}

.lulebo-message-timestamp {
	font-size: 11px;
	color: #999;
	margin-top: 4px;
	padding: 0 16px;
}

/* Attachment Thumbnail */
.lulebo-message-attachment {
	margin-top: 8px;
	max-width: 200px;
	border-radius: 8px;
	overflow: hidden;
}

.lulebo-message-attachment img {
	width: 100%;
	height: auto;
	display: block;
}

/* Typing Indicator */
.lulebo-typing-indicator {
	display: none;
	align-items: center;
	gap: 6px;
	padding: 12px 16px;
	background-color: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 18px;
	border-bottom-left-radius: 4px;
	align-self: flex-start;
	max-width: 80px;
}

.lulebo-typing-indicator.active {
	display: flex;
}

.lulebo-typing-dot {
	width: 8px;
	height: 8px;
	background-color: #999;
	border-radius: 50%;
	animation: typing 1.4s infinite;
}

.lulebo-typing-dot:nth-child(2) {
	animation-delay: 0.2s;
}

.lulebo-typing-dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes typing {
	0%, 60%, 100% {
		transform: translateY(0);
	}
	30% {
		transform: translateY(-10px);
	}
}

/* Input Area */
.lulebo-chat-input-area {
	padding: 16px;
	background: #fff;
	border-top: 1px solid #e0e0e0;
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.lulebo-chat-input {
	flex: 1;
	min-height: 40px;
	max-height: 120px;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 20px;
	resize: none;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	outline: none;
	transition: border-color 0.2s ease;
}

.lulebo-chat-input:focus {
	border-color: var(--lulebo-primary-color);
}

.lulebo-chat-action-buttons {
	display: flex;
	gap: 4px;
}

.lulebo-chat-btn {
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background-color: #f0f0f0;
	color: #666;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	transition: background-color 0.2s ease;
}

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

.lulebo-chat-btn.primary {
	background-color: var(--lulebo-primary-color);
	color: #fff;
}

.lulebo-chat-btn.primary:hover {
	background-color: #0052a3;
}

.lulebo-chat-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.lulebo-chat-btn.recording {
	background-color: #dc3232;
	color: #fff;
	animation: pulse 1s infinite;
}

@keyframes pulse {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.1);
	}
}

/* Error Message */
.lulebo-error-message {
	background-color: #ffebee;
	border: 1px solid #ef5350;
	border-radius: 8px;
	padding: 12px;
	margin: 8px 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lulebo-error-text {
	color: #c62828;
	font-size: 14px;
}

.lulebo-retry-btn {
	align-self: flex-start;
	background-color: #ef5350;
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
}

.lulebo-retry-btn:hover {
	background-color: #c62828;
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.lulebo-chat-window {
		bottom: 0;
		right: 0;
		left: 0;
		width: 100%;
		max-width: 100%;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
	}

	.lulebo-chat-window.position-left {
		left: 0;
	}

	.lulebo-chat-button {
		bottom: 16px;
		right: 16px;
	}

	.lulebo-chat-button.position-left {
		right: auto;
		left: 16px;
	}
}

/* Print: Hide widget */
@media print {
	.lulebo-chat-button,
	.lulebo-chat-window {
		display: none !important;
	}
}