/* Throgept Widget Styles */

:root {
	--throgept-color: #007bff;
	--throgept-text: #333;
	--throgept-light: #f5f5f5;
	--throgept-border: #ddd;
}

/* Widget Container */
#throgept-widget-container,
#throgept-floating-widget {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Floating Widget */
.throgept-widget-floating {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 380px;
	max-width: 90vw;
	height: 600px;
	max-height: 80vh;
	border-radius: 12px;
	box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
	background: white;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Inline Widget */
.throgept-widget-inline {
	width: 100%;
	max-width: 500px;
	height: 500px;
	border-radius: 8px;
	border: 1px solid var(--throgept-border);
	background: white;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Inline Chat Widget - Full Width */
.throgept-inline-chat-wrapper {
	width: 100%;
	margin: 20px 0;
	border-radius: 8px;
	border: 1px solid var(--throgept-border);
	background: white;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.throgept-widget-inline-chat {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Widget Header */
.throgept-widget-header {
	background: var(--throgept-color);
	color: white;
	padding: 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
}

.throgept-widget-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

.throgept-widget-icon {
	width: 24px;
	height: 24px;
	background: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	color: var(--throgept-color);
	font-size: 14px;
}

.throgept-widget-close {
	background: none;
	border: none;
	color: white;
	font-size: 24px;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.2s ease;
}

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

/* Messages Container */
.throgept-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: white;
	scroll-behavior: smooth;
}

/* Inline chat scroll behavior - stays at current position */
.throgept-widget-inline-chat .throgept-messages {
	scroll-behavior: auto;
}

.throgept-message {
	display: flex;
	gap: 8px;
	animation: slideIn 0.3s ease;
}

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

.throgept-message.user {
	justify-content: flex-end;
}

.throgept-message.bot {
	justify-content: flex-start;
}

.throgept-message-content {
	max-width: 70%;
	padding: 10px 14px;
	border-radius: 12px;
	line-height: 1.5;
	font-size: 14px;
	word-wrap: break-word;
}

.throgept-message.user .throgept-message-content {
	background: var(--throgept-color);
	color: white;
	border-bottom-right-radius: 4px;
}

.throgept-message.bot .throgept-message-content {
	background: var(--throgept-light);
	color: var(--throgept-text);
	border-bottom-left-radius: 4px;
}

/* Sources */
.throgept-sources {
	margin-top: 8px;
	font-size: 12px;
	color: #666;
	max-width: 70%;
}

.throgept-sources-title {
	font-weight: 600;
	margin-bottom: 4px;
}

.throgept-source-item {
	padding: 6px 8px;
	background: #f9f9f9;
	border-left: 2px solid var(--throgept-color);
	margin: 4px 0;
	border-radius: 2px;
}

.throgept-source-title {
	font-weight: 500;
	color: var(--throgept-color);
	text-decoration: none;
	cursor: pointer;
}

.throgept-source-title:hover {
	text-decoration: underline;
}

.throgept-source-preview {
	font-size: 11px;
	color: #888;
	margin-top: 2px;
}

/* Loading State */
.throgept-loading {
	display: flex;
	gap: 4px;
	align-items: center;
}

.throgept-loading-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--throgept-color);
	animation: bounce 1.4s infinite;
}

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

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

@keyframes bounce {
	0%, 80%, 100% {
		opacity: 0.3;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-8px);
	}
}

/* Input Area */
.throgept-input-area {
	padding: 12px;
	border-top: 1px solid var(--throgept-border);
	background: white;
	flex-shrink: 0;
	display: flex;
	gap: 8px;
}

.throgept-input-wrapper {
	flex: 1;
	display: flex;
	gap: 8px;
}

.throgept-input {
	flex: 1;
	border: 1px solid var(--throgept-border);
	border-radius: 20px;
	padding: 10px 14px;
	font-size: 14px;
	font-family: inherit;
	resize: none;
	max-height: 100px;
}

.throgept-input:focus {
	outline: none;
	border-color: var(--throgept-color);
	box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.throgept-send-btn {
	background: var(--throgept-color);
	color: white;
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.throgept-send-btn:hover {
	background: #0056b3;
	transform: scale(1.05);
}

.throgept-send-btn:active {
	transform: scale(0.95);
}

.throgept-send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* WhatsApp Button */
.throgept-whatsapp-btn {
	background: #25d366;
	color: white;
	border: none;
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	width: 100%;
	margin-top: 8px;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.throgept-whatsapp-btn:hover {
	background: #1ebd56;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

.throgept-whatsapp-btn:active {
	transform: translateY(0);
}

/* Error State */
.throgept-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	border-radius: 6px;
	padding: 12px;
	margin: 12px 0;
	font-size: 13px;
}

.throgept-error-title {
	font-weight: 600;
	margin-bottom: 4px;
}

/* Empty State */
.throgept-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #999;
	text-align: center;
	padding: 20px;
}

.throgept-empty-icon {
	font-size: 48px;
	margin-bottom: 12px;
	opacity: 0.5;
}

.throgept-empty-text {
	font-size: 14px;
	margin-bottom: 8px;
}

.throgept-empty-subtext {
	font-size: 12px;
	color: #bbb;
}

/* Scrollbar Styling */
.throgept-messages::-webkit-scrollbar {
	width: 6px;
}

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

.throgept-messages::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}

.throgept-messages::-webkit-scrollbar-thumb:hover {
	background: #999;
}

/* Responsive Design */
@media (max-width: 768px) {
	.throgept-inline-chat-wrapper {
		margin: 10px 0;
	}
}

@media (max-width: 480px) {
	.throgept-widget-floating {
		width: calc(100vw - 16px);
		height: calc(100vh - 100px);
		bottom: 8px;
		right: 8px;
		left: 8px;
		border-radius: 8px;
	}

	.throgept-inline-chat-wrapper {
		margin: 10px 0;
		border-radius: 6px;
	}

	.throgept-message-content {
		max-width: 85%;
	}

	.throgept-sources {
		max-width: 85%;
	}

	.throgept-input-area {
		padding: 10px;
	}

	.throgept-send-btn {
		width: 32px;
		height: 32px;
		font-size: 14px;
	}
}

/* Print Styles */
@media print {
	.throgept-widget-floating,
	.throgept-widget-inline,
	.throgept-inline-chat-wrapper {
		display: none !important;
	}
}
