/**
 * Chat Widget Styles
 * Customer-facing chat interface
 */

/* Chat Widget Container */
.wpai-chat-widget {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 9999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Registration Form */
.wpai-registration-form {
	padding: 30px 20px;
	text-align: center;
}

.wpai-registration-content {
	max-width: 320px;
	margin: 0 auto;
}

.wpai-registration-icon {
	margin-bottom: 20px;
}

.wpai-registration-form h3 {
	margin: 0 0 10px;
	color: #333;
	font-size: 20px;
	font-weight: 600;
}

.wpai-registration-form p {
	margin: 0 0 20px;
	color: #666;
	font-size: 14px;
}

.wpai-guest-form {
	text-align: left;
}

.wpai-form-group {
	margin-bottom: 15px;
}

.wpai-form-group label {
	display: block;
	margin-bottom: 5px;
	color: #333;
	font-size: 14px;
	font-weight: 500;
}

.wpai-form-group input {
	width: 100%;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	box-sizing: border-box;
	transition: border-color 0.3s;
}

.wpai-form-group input:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wpai-btn-primary {
	width: 100%;
	padding: 12px;
	background: #667eea;
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.3s;
}

.wpai-btn-primary:hover {
	background: #5568d3;
}

.wpai-registration-note {
	margin: 15px 0 0;
	color: #999;
	font-size: 12px;
}

/* Chat Bubble (Closed State) */
.wpai-chat-bubble {
	width: 60px;
	height: 60px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transition: all 0.3s ease;
	position: relative;
}

.wpai-chat-bubble:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.wpai-chat-bubble svg {
	color: white;
	width: 28px;
	height: 28px;
}

.wpai-unread-badge {
	position: absolute;
	top: -5px;
	right: -5px;
	background: #ef4444;
	color: white;
	border-radius: 50%;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: bold;
}

/* Chat Window (Open State) */
.wpai-chat-window {
	width: 380px;
	height: 600px;
	max-height: 80vh;
	background: white;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: slideUp 0.3s ease;
}

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

/* Header */
.wpai-chat-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.wpai-chat-header-info h3 {
	margin: 0 0 5px 0;
	font-size: 18px;
	font-weight: 600;
}

.wpai-chat-status {
	display: flex;
	align-items: center;
	font-size: 13px;
	opacity: 0.9;
}

.wpai-status-dot {
	width: 8px;
	height: 8px;
	background: #10b981;
	border-radius: 50%;
	margin-right: 6px;
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.wpai-chat-header-actions {
	display: flex;
	gap: 8px;
}

.wpai-btn-minimize,
.wpai-btn-close {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: white;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.wpai-btn-minimize:hover,
.wpai-btn-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* Messages Container */
.wpai-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	background: #f9fafb;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.wpai-chat-messages::-webkit-scrollbar {
	width: 6px;
}

.wpai-chat-messages::-webkit-scrollbar-track {
	background: transparent;
}

.wpai-chat-messages::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 3px;
}

/* Message */
.wpai-message {
	display: flex;
	gap: 10px;
	animation: fadeIn 0.3s ease;
}

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

.wpai-message-user {
	flex-direction: row-reverse;
}

.wpai-message-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #667eea;
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.wpai-message-user .wpai-message-avatar {
	background: #10b981;
}

.wpai-message-content {
	max-width: 70%;
}

.wpai-message-bubble {
	background: white;
	padding: 12px 16px;
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	word-wrap: break-word;
	line-height: 1.5;
}

.wpai-message-user .wpai-message-bubble {
	background: #667eea;
	color: white;
}

.wpai-message-time {
	font-size: 11px;
	color: #9ca3af;
	margin-top: 4px;
	padding: 0 4px;
}

/* Typing Indicator */
.wpai-typing-indicator {
	display: flex;
	gap: 4px;
	padding: 12px 20px;
	background: #f9fafb;
}

.wpai-typing-dot {
	width: 8px;
	height: 8px;
	background: #9ca3af;
	border-radius: 50%;
	animation: typing 1.4s infinite;
}

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

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

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

/* Input Area */
.wpai-chat-input {
	padding: 16px;
	background: white;
	border-top: 1px solid #e5e7eb;
	display: flex;
	gap: 12px;
	align-items: flex-end;
}

.wpai-message-input {
	flex: 1;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 10px 14px;
	font-size: 14px;
	resize: none;
	max-height: 100px;
	font-family: inherit;
	transition: border-color 0.2s;
}

.wpai-message-input:focus {
	outline: none;
	border-color: #667eea;
}

.wpai-send-button {
	width: 40px;
	height: 40px;
	background: #667eea;
	border: none;
	border-radius: 12px;
	color: white;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	flex-shrink: 0;
}

.wpai-send-button:hover {
	background: #5568d3;
}

.wpai-send-button:disabled {
	background: #d1d5db;
	cursor: not-allowed;
}

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

/* Product Card (for product recommendations) */
.wpai-product-card {
	background: white;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 12px;
	margin-top: 8px;
	display: flex;
	gap: 12px;
}

.wpai-product-image {
	width: 60px;
	height: 60px;
	border-radius: 8px;
	object-fit: cover;
}

.wpai-product-info {
	flex: 1;
}

.wpai-product-name {
	font-weight: 600;
	margin-bottom: 4px;
	font-size: 14px;
}

.wpai-product-price {
	color: #667eea;
	font-weight: 600;
	font-size: 16px;
}

.wpai-product-button {
	background: #667eea;
	color: white;
	border: none;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 12px;
	cursor: pointer;
	margin-top: 8px;
}

.wpai-product-button:hover {
	background: #5568d3;
}
