/* ==========================================================================
   AI Sales Agent - Frontend Styles
   ========================================================================== */

/* Launcher (Search Bar Style) */
.ai-launcher-wrapper {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 99999;
	width: 95%;
	max-width: 650px;
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	opacity: 1;
	visibility: visible;
}

.ai-launcher-wrapper.ai-launcher-hidden {
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 20px);
	pointer-events: none;
}

.ai-launcher-inner {
	display: flex;
	align-items: center;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-radius: 999px;
	padding: 12px 24px;
	box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
	cursor: pointer;
	position: relative;
	transition: all 0.3s ease;
	border: 1px solid transparent;
	background-clip: padding-box;
}

/* Gradient Border Hack */
.ai-launcher-inner::before {
	content: '';
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;
	z-index: -1;
	margin: -1px;
	border-radius: inherit;
	background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.2), rgba(0,123,255,0.3));
}

.ai-launcher-inner:hover {
	transform: translateY(-2px);
	box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.ai-launcher-icon {
	color: #007bff;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 16px;
	animation: ai-pulse 2s infinite;
}

.ai-launcher-placeholder {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	color: #6c757d;
	font-weight: 400;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@keyframes ai-pulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); }
	100% { transform: scale(1); }
}

/* Chat Panel */
.ai-panel-wrapper {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%) scale(1);
	transform-origin: bottom center;
	width: 100%;
	max-width: 700px;
	height: 650px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-radius: 24px;
	box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	opacity: 1;
	visibility: visible;
}

@media (max-width: 768px) {
	.ai-panel-wrapper {
		bottom: 0;
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
		height: 85vh;
	}
}

.ai-panel-wrapper.ai-panel-hidden {
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) scale(0.95) translateY(20px);
	pointer-events: none;
}

.ai-panel-header {
	padding: 16px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	background: rgba(255, 255, 255, 0.9);
}

.ai-panel-header-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ai-header-logo {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(0, 123, 255, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-header-info {
	display: flex;
	flex-direction: column;
}

.ai-header-info h3 {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.2;
}

.ai-online-status {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 12px;
	color: #6c757d;
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
}

.ai-status-dot {
	width: 8px;
	height: 8px;
	background-color: #28a745;
	border-radius: 50%;
	display: inline-block;
}

#ai-panel-close {
	background: none;
	border: none;
	color: #6c757d;
	cursor: pointer;
	padding: 4px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, color 0.2s;
}

#ai-panel-close:hover {
	background: rgba(0, 0, 0, 0.05);
	color: #1a1a1a;
}

.ai-panel-body {
	flex: 1;
	padding: 24px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
	scroll-behavior: smooth;
}

.ai-message {
	max-width: 80%;
	padding: 12px 16px;
	border-radius: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	word-wrap: break-word;
}

.ai-message p {
	margin: 0;
}

.ai-message-system {
	background: #f1f3f5;
	color: #1a1a1a;
	align-self: flex-start;
	border-bottom-left-radius: 4px;
}

.ai-message-user {
	background: #007bff;
	color: #ffffff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.ai-typing-indicator {
	display: flex;
	align-items: center;
	width: fit-content;
}

.ai-typing-dots {
	display: flex;
	gap: 4px;
	padding: 4px 0;
}

.ai-typing-dots span {
	width: 6px;
	height: 6px;
	background-color: #6c757d;
	border-radius: 50%;
	display: inline-block;
	animation: ai-typing 1.4s infinite ease-in-out both;
}

.ai-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-typing {
	0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
	40% { transform: scale(1); opacity: 1; }
}

.ai-panel-footer {
	padding: 16px 24px 20px;
	border-top: 1px solid rgba(0, 0, 0, 0.05);
	background: rgba(255, 255, 255, 0.9);
}

/* Quick Actions */
.ai-quick-actions {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 12px;
	margin-bottom: 4px;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE and Edge */
}

.ai-quick-actions::-webkit-scrollbar {
	display: none; /* Chrome, Safari, Opera */
}

.ai-chip {
	background: rgba(0, 123, 255, 0.08);
	border: 1px solid rgba(0, 123, 255, 0.15);
	color: #007bff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 13px;
	font-weight: 500;
	padding: 6px 14px;
	border-radius: 100px;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.2s ease;
}

.ai-chip:hover {
	background: #007bff;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.ai-chip:active {
	transform: translateY(1px);
	box-shadow: none;
}

.ai-input-wrapper {
	display: flex;
	align-items: center;
	background: #f8f9fa;
	border-radius: 999px;
	padding: 8px 8px 8px 20px;
	border: 1px solid rgba(0,0,0,0.05);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-input-wrapper:focus-within {
	border-color: #007bff;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

#ai-chat-input {
	flex: 1;
	border: none;
	background: none;
	outline: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	color: #1a1a1a;
	padding: 0;
	margin-right: 12px;
}

#ai-chat-input::placeholder {
	color: #adb5bd;
}

#ai-chat-submit {
	background: #007bff;
	color: #fff;
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s, transform 0.2s;
	flex-shrink: 0;
}

#ai-chat-submit:hover {
	background: #0056b3;
	transform: scale(1.05);
}
