/* ChatGPT-inspired styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	background: #f7f7f8;
	color: #202123;
	height: 100vh;
	overflow: hidden;
}

.app-container {
	display: flex;
	height: 100vh;
}

/* Sidebar Styles */
.sidebar {
	width: 260px;
	background: #202123;
	color: white;
	display: flex;
	flex-direction: column;
	border-right: 1px solid #4d4d4f;
}

.sidebar-header {
	padding: 18px 12px;
	border-bottom: 1px solid #4d4d4f;
}

.sidebar-header h2 {
	font-size: 16px;
	font-weight: 600;
	color: white;
}

.department-selector {
	flex: 1;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.dept-btn {
	width: 100%;
	padding: 12px;
	background: transparent;
	border: 1px solid transparent;
	color: #c5c5d2;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 14px;
	text-align: left;
	display: flex;
	align-items: center;
	gap: 8px;
}

.dept-btn:hover {
	background: #2a2b32;
	color: white;
}

.dept-btn.active {
	background: #10a37f;
	color: white;
	border-color: #10a37f;
}

.sidebar-footer {
	padding: 12px;
	border-top: 1px solid #4d4d4f;
}

.clear-btn {
	width: 100%;
	padding: 12px;
	background: transparent;
	border: 1px solid #4d4d4f;
	color: #c5c5d2;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	justify-content: center;
}

.clear-btn:hover {
	background: #2a2b32;
	color: white;
	border-color: #565869;
}

/* Main Content */
.main-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: white;
}

.messages-container {
	flex: 1;
	overflow-y: auto;
	padding: 0;
}

/* Welcome Screen */
.welcome-screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	text-align: center;
	padding: 0 20px;
}

.welcome-title {
	font-size: 32px;
	font-weight: 300;
	color: #202123;
	margin-bottom: 16px;
}

.welcome-subtitle {
	font-size: 16px;
	color: #6e6e80;
	margin-bottom: 32px;
}

/* Message Styles */
.message {
	display: flex;
	padding: 24px 0;
	border-bottom: 1px solid #f0f0f0;
}

.message.user {
	background: #f7f7f8;
}

.message.assistant {
	background: white;
}

.message.system {
	background: #fff4e6;
	border-bottom-color: #fed7aa;
}

.message-wrapper {
	max-width: 768px;
	margin: 0 auto;
	width: 100%;
	padding: 0 20px;
	display: flex;
	gap: 24px;
}

.avatar {
	width: 30px;
	height: 30px;
	border-radius: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
	font-weight: 600;
}

.message.user .avatar {
	background: #10a37f;
	color: white;
}

.message.assistant .avatar {
	background: #19c37d;
	color: white;
}

.message.system .avatar {
	background: #ff9500;
	color: white;
}

.message-content {
	flex: 1;
	line-height: 1.7;
	font-size: 16px;
	word-wrap: break-word;
}

/* Rich Text Formatting */
.message-content h1,
.message-content h2,
.message-content h3 {
	margin: 16px 0 8px 0;
	font-weight: 600;
}

.message-content h1 {
	font-size: 24px;
}
.message-content h2 {
	font-size: 20px;
}
.message-content h3 {
	font-size: 18px;
}

.message-content p {
	margin: 12px 0;
}

.message-content ul,
.message-content ol {
	margin: 12px 0;
	padding-left: 24px;
}

.message-content li {
	margin: 4px 0;
}

.message-content code {
	background: #f4f4f4;
	padding: 2px 6px;
	border-radius: 3px;
	font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
		"Courier New", monospace;
	font-size: 14px;
}

.message-content pre {
	background: #f4f4f4;
	padding: 16px;
	border-radius: 6px;
	overflow-x: auto;
	margin: 12px 0;
	font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
		"Courier New", monospace;
	font-size: 14px;
	line-height: 1.4;
}

.message-content pre code {
	background: none;
	padding: 0;
}

.message-content strong {
	font-weight: 600;
}

.message-content blockquote {
	border-left: 3px solid #d1d5db;
	margin: 12px 0;
	padding: 8px 16px;
	background: #f9fafb;
	color: #6b7280;
}

/* Input Container */
.input-container {
	padding: 24px 20px 24px 20px;
	background: white;
	border-top: 1px solid #f0f0f0;
}

.input-wrapper {
	max-width: 768px;
	margin: 0 auto;
	position: relative;
	display: flex;
	align-items: end;
	gap: 8px;
	background: white;
	border: 1px solid #d1d5db;
	border-radius: 12px;
	padding: 12px 16px;
	box-shadow: 0 0 0 0 rgba(16, 163, 127, 0);
	transition: all 0.2s ease;
}

.input-wrapper:focus-within {
	border-color: #10a37f;
	box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.1);
}

.message-input {
	flex: 1;
	border: none;
	outline: none;
	resize: none;
	font-size: 16px;
	line-height: 1.5;
	font-family: inherit;
	background: transparent;
	min-height: 24px;
	max-height: 200px;
	overflow-y: hidden;
}

.message-input::placeholder {
	color: #9ca3af;
}

.send-btn {
	width: 32px;
	height: 32px;
	background: #f4f4f4;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
	background: #e5e5e5;
}

.send-btn:not(:disabled) {
	background: #10a37f;
	color: white;
}

.send-btn:not(:disabled):hover {
	background: #0d8f69;
}

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

/* Loading Animation */
.loading {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 0;
}

.dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #9ca3af;
	animation: pulse 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) {
	animation-delay: -0.32s;
}
.dot:nth-child(2) {
	animation-delay: -0.16s;
}
.dot:nth-child(3) {
	animation-delay: 0;
}

@keyframes pulse {
	0%,
	80%,
	100% {
		transform: scale(0.8);
		opacity: 0.5;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Sources Section */
.sources-section {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e5e7eb;
}

.sources-title {
	font-size: 14px;
	color: #6b7280;
	margin-bottom: 8px;
	font-weight: 500;
}

.sources-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.source-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	text-decoration: none;
	color: #374151;
	transition: all 0.2s ease;
	font-size: 14px;
}

.source-link:hover {
	background: #f3f4f6;
	border-color: #d1d5db;
	text-decoration: none;
	color: #111827;
}

.source-icon .lucide-icon {
	width: 16px;
	height: 16px;
	stroke: #6b7280;
}

.source-filename {
	font-weight: 500;
	flex: 1;
}

.source-relevance {
	font-size: 12px;
	color: #9ca3af;
}

/* Status Indicator */
.status-indicator {
	position: fixed;
	top: 20px;
	right: 20px;
	background: #10a37f;
	color: white;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 14px;
	z-index: 1000;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.status-indicator.error {
	background: #ef4444;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
	.sidebar {
		width: 100%;
		position: fixed;
		top: 0;
		left: -100%;
		z-index: 1000;
		transition: left 0.3s ease;
	}

	.sidebar.open {
		left: 0;
	}

	.main-content {
		width: 100%;
	}

	.welcome-title {
		font-size: 28px;
	}

	.input-container {
		padding: 16px;
	}

	.message-wrapper {
		padding: 0 16px;
	}
}

/* Animations */
@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.message {
	animation: slideIn 0.3s ease-out;
}
