/* ------------------------------
           Sidebar Container
        ------------------------------ */
.chat-sidebar {
	position: fixed;
	top: 0;
	right: 0;
	width: 30%;
	height: 100%;
	background-color: #f4f4f4;
	box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	outline: none; /* Remove outline when focused */
}

/* ------------------------------
           Chat Window
        ------------------------------ */
#chatWindow {
	flex-grow: 1;
	padding: 10px;
	overflow-y: auto;
	background-color: #ffffff;
	border-bottom: 1px solid #ddd;
	display: flex;
	flex-direction: column;
}

/* ------------------------------
           Input Container & Elements
        ------------------------------ */
#chatInputContainer {
	border-top: 1px solid #ddd;
	background-color: #f9f9f9;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

#chatInput {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	width: 100%;
}

	#chatInput input {
		flex-grow: 1;
		padding: 10px 12px;
		border: 1px solid #ccc;
		border-radius: 4px;
		font-size: 16px;
		box-sizing: border-box;
		width: 100%;
		height: 40px;
	}

	#chatInput button {
		padding: 10px 20px;
		font-size: 16px;
		border: none;
		border-radius: 4px;
		background-color: #007bff;
		color: white;
		cursor: pointer;
	}

		#chatInput button:hover {
			background-color: #0056b3;
		}

/* ------------------------------
           Message Bubbles
        ------------------------------ */
/* Base class for message styles */
.chat-message {
	max-width: 100%;
	margin: 8px 0;
	padding: 10px 15px;
	border-radius: 20px;
	position: relative;
	font-size: 14px;
	line-height: 1.4;
	word-wrap: break-word;
}

/* Chatbot (left) message */
.chatbot-message {
	background-color: #f4f4f4;
	color: #333;
	align-self: flex-start;
}

	.chatbot-message::after {
		content: "";
		position: absolute;
		left: -10px;
		top: 15px;
		width: 0;
		height: 0;
		border-right: 10px solid #f4f4f4;
		border-top: 5px solid transparent;
		border-bottom: 5px solid transparent;
	}

/* User (right) message */
.user-message {
	background-color: #007bff;
	color: #fff;
	align-self: flex-end;
}

	.user-message::after {
		content: "";
		position: absolute;
		right: -10px;
		top: 15px;
		width: 0;
		height: 0;
		border-left: 10px solid #007bff;
		border-top: 5px solid transparent;
		border-bottom: 5px solid transparent;
	}

/* ------------------------------
           Inline Buttons (e.g., inline in chatbot messages)
        ------------------------------ */
.btn-outline-success, .btn-outline-danger {
	padding: 5px 10px;
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 5px;
	border: 1px solid transparent;
	border-radius: 4px;
}

.btn-outline-success {
	border-color: #28a745;
	color: #28a745;
}

	.btn-outline-success:hover {
		background-color: #28a745;
		color: white;
	}

.btn-outline-danger {
	border-color: #dc3545;
	color: #dc3545;
}

	.btn-outline-danger:hover {
		background-color: #dc3545;
		color: white;
	}

.chatbot-message .btn {
	margin-top: 5px;
}

/* ------------------------------
           Table Container (inside chatbot bubble)
        ------------------------------ */
.chat-table-container {
	max-width: 100%;
	/* max-height: 200px;*/
	overflow-x: auto;
	overflow-y: auto;
	border: 1px solid #ddd;
	border-radius: 8px;
	background-color: #f9f9f9;
	padding: 5px;
	margin-top: 5px;
}

	.chat-table-container table {
		width: 100%;
		border-collapse: collapse;
		font-size: 12px;
		table-layout: auto;
	}

	.chat-table-container th,
	.chat-table-container td {
		border: 1px solid #ccc;
		padding: 4px;
		text-align: left;
		word-wrap: break-word;
	}

	.chat-table-container th {
		background-color: #f1f1f1;
		font-weight: bold;
	}

	.chat-table-container tbody tr:nth-child(odd) {
		background-color: #f7f7f7;
	}
/* When maximized, the chat sidebar takes the full screen */
.chat-maximized {
	position: fixed !important;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 9999;
	background: #fff; /* Ensure a proper background when maximized */
	overflow: auto; /* Allow scrolling if needed */
}
