/* Augustine - Assistante de direction IA */

.augustine-container {
	display: flex;
	height: calc(100vh - 180px);
	min-height: 500px;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

/* Sidebar */
.augustine-sidebar {
	width: 280px;
	min-width: 280px;
	background: #1a1a2e;
	color: #e0e0e0;
	display: flex;
	flex-direction: column;
	border-right: 1px solid #16213e;
}

.augustine-sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 15px;
	border-bottom: 1px solid rgba(255,255,255,0.1);
}

.augustine-sidebar-header h3 {
	margin: 0;
	font-size: 1.1em;
	color: #fff;
}

.augustine-btn-new {
	background: rgba(255,255,255,0.1);
	color: #fff;
	border: 1px solid rgba(255,255,255,0.2);
	border-radius: 6px;
	padding: 6px 10px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s;
}

.augustine-btn-new:hover {
	background: rgba(255,255,255,0.2);
	color: #fff;
	text-decoration: none;
}

.augustine-conversations-list {
	flex: 1;
	overflow-y: auto;
	padding: 8px;
}

.augustine-conv-item {
	display: block;
	padding: 10px 12px;
	border-radius: 6px;
	margin-bottom: 4px;
	color: #ccc;
	text-decoration: none;
	transition: background 0.2s;
	cursor: pointer;
}

.augustine-conv-item:hover {
	background: rgba(255,255,255,0.08);
	color: #fff;
	text-decoration: none;
}

.augustine-conv-item.active {
	background: rgba(255,255,255,0.15);
	color: #fff;
}

.augustine-conv-title {
	font-size: 0.9em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.augustine-conv-meta {
	font-size: 0.75em;
	color: #888;
	margin-top: 3px;
}

.augustine-no-conv {
	text-align: center;
	padding: 20px;
	color: #666;
	font-size: 0.9em;
}

/* Chat area */
.augustine-chat {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #f8f9fa;
	min-width: 0;
}

/* Welcome screen */
.augustine-welcome {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px;
	text-align: center;
}

.augustine-welcome-icon {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
}

.augustine-welcome-icon i {
	font-size: 36px;
	color: #fff;
}

.augustine-welcome h2 {
	margin: 0 0 10px;
	color: #333;
}

.augustine-welcome p {
	color: #666;
	max-width: 500px;
	margin-bottom: 30px;
}

.augustine-examples {
	width: 100%;
	max-width: 700px;
	margin-bottom: 30px;
}

.augustine-examples h4 {
	color: #555;
	margin-bottom: 15px;
}

.augustine-examples-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.augustine-example-card {
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	padding: 12px 15px;
	cursor: pointer;
	transition: all 0.2s;
	text-align: left;
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.augustine-example-card:hover {
	border-color: #667eea;
	box-shadow: 0 2px 8px rgba(102,126,234,0.15);
	transform: translateY(-1px);
}

.augustine-example-card i {
	color: #667eea;
	margin-top: 2px;
}

.augustine-example-card span {
	color: #444;
	font-size: 0.9em;
}

.augustine-btn-start {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 12px 24px;
	font-size: 1em;
	cursor: pointer;
	transition: opacity 0.2s;
}

.augustine-btn-start:hover {
	opacity: 0.9;
}

/* Messages */
.augustine-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.augustine-welcome-mini {
	text-align: center;
	padding: 30px;
	color: #666;
}

.augustine-welcome-mini i {
	font-size: 48px;
	color: #667eea;
	margin-bottom: 15px;
}

.augustine-welcome-mini p {
	max-width: 500px;
	margin: 0 auto 20px;
}

.augustine-examples-inline {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.augustine-example-chip {
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 20px;
	padding: 6px 14px;
	font-size: 0.85em;
	color: #555;
	cursor: pointer;
	transition: all 0.2s;
}

.augustine-example-chip:hover {
	border-color: #667eea;
	color: #667eea;
}

.augustine-message {
	display: flex;
	gap: 12px;
	max-width: 85%;
}

.augustine-message-user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

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

.augustine-message-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.augustine-message-user .augustine-message-avatar {
	background: #e3e8f0;
	color: #555;
}

.augustine-message-assistant .augustine-message-avatar {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
}

.augustine-message-content {
	flex: 1;
	min-width: 0;
}

.augustine-message-user .augustine-message-content {
	text-align: right;
}

.augustine-message-text {
	display: inline-block;
	padding: 10px 16px;
	border-radius: 12px;
	text-align: left;
	line-height: 1.5;
	word-wrap: break-word;
}

.augustine-message-user .augustine-message-text {
	background: #667eea;
	color: #fff;
	border-bottom-right-radius: 4px;
}

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

/* Rendu Markdown dans les réponses */
.augustine-message-assistant .augustine-message-text h1,
.augustine-message-assistant .augustine-message-text h2,
.augustine-message-assistant .augustine-message-text h3,
.augustine-message-assistant .augustine-message-text h4 {
	margin: 14px 0 8px;
	color: #333;
	line-height: 1.3;
}

.augustine-message-assistant .augustine-message-text h3 {
	font-size: 1.1em;
	border-bottom: 1px solid #eee;
	padding-bottom: 4px;
}

.augustine-message-assistant .augustine-message-text p {
	margin: 6px 0;
}

.augustine-message-assistant .augustine-message-text ul,
.augustine-message-assistant .augustine-message-text ol {
	margin: 6px 0;
	padding-left: 22px;
}

.augustine-message-assistant .augustine-message-text li {
	margin-bottom: 4px;
}

.augustine-message-assistant .augustine-message-text strong {
	color: #222;
}

.augustine-message-assistant .augustine-message-text em {
	color: #555;
}

.augustine-message-assistant .augustine-message-text code {
	background: #f1f3f5;
	padding: 1px 5px;
	border-radius: 3px;
	font-size: 0.9em;
	color: #d63384;
}

.augustine-message-assistant .augustine-message-text pre {
	background: #2d2d2d;
	color: #f8f8f2;
	padding: 12px;
	border-radius: 6px;
	overflow-x: auto;
	margin: 10px 0;
}

.augustine-message-assistant .augustine-message-text pre code {
	background: none;
	padding: 0;
	color: inherit;
}

.augustine-message-assistant .augustine-message-text blockquote {
	border-left: 3px solid #667eea;
	margin: 10px 0;
	padding: 4px 12px;
	color: #555;
	background: #f8f9fa;
	border-radius: 0 4px 4px 0;
}

.augustine-message-assistant .augustine-message-text hr {
	border: none;
	border-top: 1px solid #dee2e6;
	margin: 12px 0;
}

/* Tableaux dans les réponses */
.augustine-message-assistant .augustine-message-text table {
	border-collapse: collapse;
	margin: 10px 0;
	width: 100%;
	font-size: 0.9em;
}

.augustine-message-assistant .augustine-message-text th,
.augustine-message-assistant .augustine-message-text td {
	border: 1px solid #dee2e6;
	padding: 6px 10px;
	text-align: left;
}

.augustine-message-assistant .augustine-message-text th {
	background: #f1f3f5;
	font-weight: 600;
}

.augustine-message-assistant .augustine-message-text tr:nth-child(even) {
	background: #f8f9fa;
}

.augustine-message-time {
	font-size: 0.75em;
	color: #999;
	margin-top: 4px;
}

.augustine-sql-details {
	margin-top: 8px;
	font-size: 0.85em;
}

.augustine-sql-details summary {
	cursor: pointer;
	color: #667eea;
	padding: 4px 0;
}

.augustine-sql-details pre {
	background: #2d2d2d;
	color: #f8f8f2;
	padding: 10px;
	border-radius: 6px;
	overflow-x: auto;
	font-size: 0.85em;
	margin-top: 6px;
}

/* Typing indicator */
.augustine-typing {
	display: flex;
	gap: 12px;
	align-self: flex-start;
}

.augustine-typing-dots {
	display: flex;
	gap: 4px;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
}

.augustine-typing-dots span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #999;
	animation: augustine-bounce 1.4s infinite ease-in-out;
}

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

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

/* Input area */
.augustine-input-area {
	padding: 15px 20px;
	background: #fff;
	border-top: 1px solid #dee2e6;
}

.augustine-input-wrapper {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 12px;
	padding: 8px 12px;
	transition: border-color 0.2s;
}

.augustine-input-wrapper:focus-within {
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

#augustine-input {
	flex: 1;
	border: none;
	background: transparent;
	resize: none;
	font-size: 0.95em;
	font-family: inherit;
	line-height: 1.5;
	max-height: 150px;
	outline: none;
	padding: 4px 0;
}

#augustine-send-btn {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border: none;
	border-radius: 8px;
	width: 38px;
	height: 38px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: opacity 0.2s;
}

#augustine-send-btn:hover {
	opacity: 0.9;
}

#augustine-send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.augustine-input-footer {
	text-align: center;
	font-size: 0.75em;
	color: #999;
	margin-top: 8px;
}

/* Alert */
.augustine-alert {
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffeeba;
	border-radius: 8px;
	padding: 20px;
	margin: 20px;
	text-align: center;
}

.augustine-alert i {
	margin-right: 8px;
}

/* Chart container */
.augustine-chart-container {
	max-width: 100%;
	margin: 15px 0;
	padding: 10px;
	background: #fff;
	border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
	.augustine-container {
		flex-direction: column;
		height: calc(100vh - 120px);
	}

	.augustine-sidebar {
		width: 100%;
		min-width: unset;
		max-height: 200px;
		border-right: none;
		border-bottom: 1px solid #16213e;
	}

	.augustine-examples-grid {
		grid-template-columns: 1fr;
	}

	.augustine-message {
		max-width: 95%;
	}
}
