.collapsible-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	transition: all 0.2s ease;
	user-select: none;
}

.collapsible-header:hover {
	color: #374151;
}

.section-toggle {
	font-size: 12px;
	transition: transform 0.2s ease;
	color: #9ca3af;
}

.section-toggle.rotated {
	transform: rotate(-90deg);
}

.section-content {
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.2s ease;
	opacity: 1;
}

.section-content.collapsed {
	max-height: 0;
	opacity: 0;
}

.messaging-container {
	height: calc(100vh - 120px);
	max-height: calc(100vh - 120px);
	display: flex;
	background: white;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.conversations-sidebar {
	width: 350px;
	border-right: 1px solid #e5e7eb;
	display: flex;
	flex-direction: column;
	background: #fafafa;
}

.sidebar-header {
	padding: 20px;
	border-bottom: 1px solid #e5e7eb;
	background: white;
}

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

.conversation-section {
	margin-bottom: 10px;
}

.section-title {
	padding: 12px 20px 8px;
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.conversation-item {
	padding: 12px 20px;
	cursor: pointer;
	transition: background-color 0.15s ease;
	border-left: 3px solid transparent;
	display: flex;
	align-items: center;
	gap: 12px;
}

.conversation-item:hover {
	background: #f3f4f6;
}

.conversation-item.active {
	background: #eff6ff;
	border-left-color: #3b82f6;
}

.conversation-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	position: relative;
}

.conversation-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.avatar-initials {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: 600;
	font-size: 14px;
}

.conversation-info {
	flex: 1;
	min-width: 0;
}



.conversation-time {
	font-size: 10px;
	color: #6b7280;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.unread-badge {
	background: #ef4444;
	color: white;
	border-radius: 12px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
	min-width: 18px;
	height: 18px;
	text-align: center;
	word-break: keep-all;
}

.chat-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: white;
	height: calc(100vh - 140px);
}

.chat-header {
	padding: 20px 24px;
	border-bottom: 1px solid #e5e7eb;
	background: white;
	gap: 16px;
	display: flex;
	align-items: center;
}

.chat-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	position: relative;
}

.chat-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.chat-avatar .avatar-initials {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 18px;
	color: white;
}

.chat-subtitle {
	font-size: 14px;
	color: #6b7280;
	margin-top: 4px;
}

.messages-container {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	background: #f9fafb;
}

.message-group {
	margin-bottom: 24px;
}

.message-item {
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
}

.message-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
}

.message-content {
	max-width: 70%;
	min-width: 0;
	align-items: start;
}

.message-bubble {
	padding: 12px 16px;
	border-radius: 18px;
	font-size: 14px;
	line-height: 1.4;
	word-wrap: break-word;
}

.message-item:not(.mine) .message-bubble {
	background: white;
	color: #111827;
	border-bottom-left-radius: 6px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-item.mine .message-bubble {
	background: #3b82f6;
	color: white;
	border-bottom-right-radius: 6px;
}

.message-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	font-size: 12px;
	color: #6b7280;
}

.message-item.mine .message-meta {
	justify-content: flex-end;
}

.message-input-area {
	padding: 20px 24px;
	border-top: 1px solid #e5e7eb;
	background: white;
}

.message-form {
	display: flex;
	gap: 12px;
	align-items: center;
}

.message-input {
	flex: 1;
	padding: 12px 16px;
	border: 1px solid #d1d5db;
	border-radius: 24px;
	font-size: 16px;
	resize: none;
	max-height: 100px;
}

.message-input:focus {
	outline: none;
	border-color: #3b82f6;
}

.send-button {
	width: 53px;
	height: 53px;
	border-radius: 50%;
	background: #3b82f6;
	border: none;
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.send-button:hover {
	background: #2563eb;
}

/* Attach button */
.attach-button {
	width: 53px;
	height: 53px;
	border-radius: 50%;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	color: #6b7280;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.15s ease;
	flex-shrink: 0;
}

.attach-button:hover {
	background: #e5e7eb;
	color: #374151;
}

/* Attachment preview bar */
.attachment-preview {
	padding: 8px 24px;
	background: #f9fafb;
	border-top: 1px solid #e5e7eb;
}

.attachment-preview-content {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: white;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 13px;
	color: #374151;
}

.attachment-preview-content i:first-child {
	color: #3b82f6;
}

.attachment-preview-content span {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.attachment-remove {
	background: none;
	border: none;
	color: #9ca3af;
	cursor: pointer;
	padding: 2px 4px;
	font-size: 14px;
}

.attachment-remove:hover {
	color: #ef4444;
}

/* Attachment display in messages */
.message-attachment {
	margin-top: 8px;
}

.attachment-image {
	max-width: 300px;
	max-height: 200px;
	border-radius: 8px;
	cursor: pointer;
	display: block;
}

.attachment-image:hover {
	opacity: 0.9;
}

.attachment-file-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	color: #374151;
	text-decoration: none;
	font-size: 13px;
	transition: background 0.15s;
}

.attachment-file-link:hover {
	background: #e5e7eb;
}

.attachment-file-link i:first-child {
	color: #3b82f6;
	font-size: 18px;
}

.attachment-file-link i:last-child {
	color: #9ca3af;
	font-size: 12px;
}

.empty-state {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #6b7280;
	text-align: center;
	padding: 48px 24px;
}

.empty-state i {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.5;
}

/* Special avatar styles */
.mentors-avatar {
	background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

.director-avatar {
	background: linear-gradient(135deg, #059669, #10b981);
}

.tech-support-avatar {
	background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.teacher-avatar {
	background: linear-gradient(135deg, #dc2626, #ef4444);
}

.student-avatar {
	background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.parent-avatar {
	background: linear-gradient(135deg, #ea580c, #f97316);
}

.admin-avatar {
	background: linear-gradient(135deg, #059669, #10b981);
}

/* House colors */
.house-avatar {
	border: 2px solid currentColor;
}

.success-message {
	background: #d1fae5;
	border: 1px solid #a7f3d0;
	color: #065f46;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
}



/* Enhanced Messages CSS - Saints Classical Academy */

.messaging-container {
	display: flex;
	height: calc(100vh - 140px);
	background: #f8f9fa;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Left Sidebar */
.conversations-sidebar {
	width: 320px;
	background: white;
	border-right: 1px solid #e1e5e9;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	height: calc(100vh - 130px);
}

.sidebar-header {
	padding: 20px;
	border-bottom: 1px solid #e1e5e9;
	background: #f8f9fa;
}

.search-box:focus {
	outline: none;
	border-color: #3b82f6;
	background: white;
}
.search-box {
	width: 100%;
	padding: 10.75px 16px;
	border: 2px solid #e1e5e9;
	border-radius: 5px;
	font-size: 14px;
	transition: border-color 0.2s ease;
}

/* New User Search Results */
.new-user-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: white;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
	max-height: 79vh;
	height: 79vh;
	overflow-y: auto;
	z-index: 1000;
	margin-top: 4px;
}

.new-user-results.hidden {
	display: none;
}

.new-user-result-item {
	display: flex;
	align-items: center;
	padding: 12px;
	cursor: pointer;
	border-bottom: 1px solid #f3f4f6;
	transition: background-color 0.15s ease;
}

.new-user-result-item:hover {
	background-color: #f9fafb;
}

.new-user-result-item:last-child {
	border-bottom: none;
}

.new-user-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #6b7280;
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 14px;
	margin-right: 12px;
	flex-shrink: 0;
}

.new-user-info h4 {
	margin: 0 0 2px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
}

.new-user-info p {
	margin: 0;
	font-size: 12px;
	color: #6b7280;
}

.sidebar-header {
	position: relative;
}

/* Hide conversation button */
.hide-conversation-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	background: none;
	border: none;
	color: #9ca3af;
	font-size: 12px;
	cursor: pointer;
	padding: 4px;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: all 0.15s ease;
}

.conversation-item {
	position: relative;
}

.conversation-item:hover .hide-conversation-btn {
	opacity: 1;
}

.hide-conversation-btn:hover {
	background: #f3f4f6;
	color: #ef4444;
}

.conversations-list {
	flex: 1;
	overflow-y: auto;
	padding: 0;
}

/* Conversation Sections */
.conversation-section {
	border-bottom: 1px solid #f0f0f0;
}

.section-title {
	padding: 16px 20px 12px 20px;
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6b7280;
	background: #f8f9fa;
	position: sticky;
	top: 0;
	z-index: 10;
}

.section-title.collapsible-header {
	cursor: pointer;
	user-select: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: background-color 0.2s ease;
}

.section-title.collapsible-header:hover {
	background: #f1f3f4;
}

.section-toggle {
	transition: transform 0.2s ease;
	font-size: 12px;
}

.section-toggle.rotated {
	transform: rotate(-90deg);
}

.section-content {
	transition: all 0.2s ease;
}

.section-content.collapsed {
	display: none;
}

/* Conversation Items */
.conversation-item {
	display: flex;
	align-items: center;
	padding: 12px 20px;
	cursor: pointer;
	transition: all 0.2s ease;
	border-left: 4px solid transparent;
	position: relative;
}

.conversation-item:hover {
	background: #f8f9fa;
}

.conversation-item.active {
	background-color: #e3f2fd;
	border-left: 4px solid #2196f3;
}

.conversation-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	margin-right: 2px;
	position: relative;
	flex-shrink: 0;
}

.conversation-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.avatar-initials {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 16px;
	color: white;
}

/* Avatar Type Colors */
.teacher-avatar {
	background: #355946;
}

.student-avatar {
	background: #7c2d12;
}

.parent-avatar {
	background: #1e40af;
}

.director-avatar {
	background: #7c2d12;
}

.mentors-avatar {
	background: #059669;
}

.tech-support-avatar {
	background: #1f2937;
}

.house-avatar {
	border: 2px solid currentColor;
}

.conversation-info {
	flex: 1;
	min-width: 0;
}

.conversation-name {
	font-weight: 500;
	font-size: 14px;
	line-height: 14px;
	color: #1f2937;
	margin-bottom: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.conversation-preview {
	font-size: 12px;
	color: var(--color-success);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Chat Area */
.chat-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: white;
}

.chat-header {
	padding: 20px 24px;
	border-bottom: 1px solid #e1e5e9;
	background: #f8f9fa;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.chat-title-section {
	flex: 1;
}

.chat-title {
	margin: 0;
	font-size: 21px;
	font-weight: 600;
	color: #1f2937;
}

.chat-subtitle {
	font-size: 14px;
	color: #6b7280;
	margin-top: 2px;
}

.chat-meta {
	color: #6b7280;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.member-count {
	background: #f3f4f6;
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
}

/* Messages Container */
.messages-container {
	flex: 1;
	overflow-y: auto;
	padding: 20px 24px;
	background: #fafafa;
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #6b7280;
	text-align: center;
}

.empty-state i {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.5;
}

.empty-state h3 {
	margin: 0 0 8px 0;
	font-size: 18px;
	font-weight: 600;
}

.empty-state p {
	margin: 0;
	font-size: 14px;
}

/* Message Items */
.message-item {
	display: flex;
	margin-bottom: 16px;
	gap: 12px;
}

.message-item.mine {
	flex-direction: row-reverse;
}

.message-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	flex-shrink: 0;
}

.message-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.message-content {
	max-width: 70%;
	display: flex;
	flex-direction: column;
}

.message-item.mine .message-content {
	align-items: flex-end;
}

.message-bubble {
	background: white;
	padding: 12px 16px;
	border-radius: 18px;
	border: 1px solid #e1e5e9;
	word-wrap: break-word;
	line-height: 1.4;
	position: relative;
}

.message-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	font-size: 12px;
	color: #6b7280;
}

.message-item.mine .message-meta {
	flex-direction: row-reverse;
}

.message-actions {
	display: none;
	align-items: center;
	gap: 4px;
	margin-left: 8px;
}

.message-item:hover .message-actions {
	display: flex;
}

.action-btn {
	background: none;
	border: none;
	color: #6b7280;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	font-size: 11px;
	transition: all 0.2s ease;
}

.action-btn:hover {
	background: #f3f4f6;
	color: #374151;
}

/* Message Input */
.message-input-area {
	padding: 20px 24px;
	border-top: 1px solid #e1e5e9;
	background: white;
}

.message-form {
	display: flex;
	gap: 12px;
	align-items: flex-end;
}

.message-input {
	flex: 1;
	padding: 12px 16px;
	border: 2px solid #e1e5e9;
	border-radius: 24px;
	font-size: 16px;
	font-family: inherit;
	resize: none;
	max-height: 100px;
	transition: border-color 0.2s ease;
}

.message-input:focus {
	outline: none;
	border-color: #355946;
}



/* Modal Styles */
.modal {
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
}

.modal-content {
	background-color: white;
	margin: 5% auto;
	padding: 0;
	border-radius: 12px;
	width: 500px;
	max-width: 90%;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.modal-header {
	padding: 24px;
	border-bottom: 1px solid #e1e5e9;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-header h3 {
	margin: 0;
	color: #1f2937;
	font-size: 18px;
	font-weight: 600;
}

.close {
	font-size: 24px;
	cursor: pointer;
	color: #6b7280;
	transition: color 0.2s ease;
	background: none;
	border: none;
	padding: 4px;
	border-radius: 4px;
}

.close:hover {
	color: #374151;
	background: #f3f4f6;
}

.modal-body {
	padding: 24px;
}

.search-input {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #e1e5e9;
	border-radius: 8px;
	font-size: 16px;
	margin-bottom: 16px;
	transition: border-color 0.2s ease;
}

.search-input:focus {
	outline: none;
	border-color: #355946;
}

.search-results {
	max-height: 300px;
	overflow-y: auto;
	border-radius: 8px;
	border: 1px solid #e1e5e9;
}

.search-result-item {
	padding: 12px 16px;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 12px;
	transition: background-color 0.2s ease;
}

.search-result-item:last-child {
	border-bottom: none;
}

.search-result-item:hover {
	background-color: #f8f9fa;
}

.search-result-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #355946;
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 14px;
	flex-shrink: 0;
}

.search-result-info {
	flex: 1;
	min-width: 0;
}

.search-result-info h4 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #1f2937;
}

.search-result-info p {
	margin: 2px 0 0 0;
	font-size: 13px;
	color: #6b7280;
}

.modal-actions {
	margin-top: 20px;
	display: flex;
	gap: 12px;
	justify-content: flex-end;
}

.btn-primary {
	background: #355946;
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-primary:hover {
	background: #2d4a3a;
	transform: translateY(-1px);
}

.btn-secondary {
	background: #f3f4f6;
	color: #374151;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-secondary:hover {
	background: #e5e7eb;
}

#editMessageContent {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #e1e5e9;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	resize: vertical;
	min-height: 80px;
	transition: border-color 0.2s ease;
}

#editMessageContent:focus {
	outline: none;
	border-color: #355946;
}

/* Success and Error Messages */
.success-message, .error-message {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 16px;
	font-weight: 500;
}

.success-message {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.error-message {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}



.close {
	font-size: 24px;
	cursor: pointer;
	color: #999;
}

.close:hover {
	color: #333;
}

.modal-body {
	padding: 20px;
}

.search-input {
	width: 100%;
	padding: 12px;
	border: 2px solid #e1e5e9;
	border-radius: 6px;
	font-size: 16px;
	margin-bottom: 15px;
}

.search-input:focus {
	outline: none;
	border-color: #355946;
}

.search-results {
	max-height: 300px;
	overflow-y: auto;
}

.search-result-item {
	padding: 12px;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 12px;
}

.search-result-item:hover {
	background-color: #f8f9fa;
}

.search-result-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #355946;
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
}

.search-result-info h4 {
	margin: 0;
	font-size: 16px;
	color: #333;
}

.search-result-info p {
	margin: 4px 0 0 0;
	font-size: 14px;
	color: #666;
}

.modal-actions {
	margin-top: 20px;
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.message-actions {
	display: none;
	gap: 8px;
	margin-left: 10px;
}

.message-item:hover .message-actions {
	display: flex;
}

.action-btn {
	background: none;
	border: none;
	color: #666;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	font-size: 12px;
}

.action-btn:hover {
	background-color: #f0f0f0;
	color: #333;
}

.chat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.chat-title-section {
	flex: 1;
}

.chat-meta {
	color: #666;
	font-size: 14px;
}

.section-title.collapsible-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	user-select: none;
}

.section-toggle {
	transition: transform 0.2s ease;
}

.section-toggle.rotated {
	transform: rotate(-90deg);
}

.section-content.collapsed {
	display: none;
}

#editMessageContent {
	width: 100%;
	padding: 12px;
	border: 2px solid #e1e5e9;
	border-radius: 6px;
	font-family: inherit;
	font-size: 14px;
	resize: vertical;
}

#editMessageContent:focus {
	outline: none;
	border-color: #355946;
}

/* Scrollbar Styling */
.conversations-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
	width: 6px;
}

.conversations-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.conversations-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* Loading States */
.loading-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #355946;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}
.section-unread-badge {
	background: #ef4444;
	color: white;
	border-radius: 12px;
	padding: 2px 5px;
	font-size: 11px;
	font-weight: 600;
	min-width: 18px;
	height: 18px;
	text-align: center;
	margin-left: auto;
	margin-right: 10px;
	line-height: 15px;
}

.empty-section {
	text-align: center;
	align-items: center;
	padding: 40px 20px;
	font-style: italic;
}
/* Add these styles to your messaging.css file */

/* Message link styling */
.message-link {
	color: #3b82f6;
	text-decoration: underline;
	word-break: break-word;
	transition: color 0.2s ease;
}

.message-link:hover {
	color: #1d4ed8;
	text-decoration: none;
}

/* For links in user's own messages (white background) */
.message-item.mine .message-link {
	color: #60a5fa;
}

.message-item.mine .message-link:hover {
	color: #93c5fd;
}

/* Ensure links don't break the message bubble layout */
.message-bubble {
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Optional: Add icon before external links */
.message-link::before {
	content: "🔗 ";
	font-size: 0.8em;
	opacity: 0.7;
}

/* Style for truncated URLs */
.message-link[title] {
	cursor: help;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
	.message-link {
		font-size: 14px;
		word-break: break-all;
	}
}
.message-item.mine a {
	color: white !important;
}

.chat-panel {
	width: 100%;
}


/* Mobile Responsiveness - Updated for sliding panels */
@media (max-width: 768px) {
	.messaging-container {
		height: calc(100vh - 60px);
		position: relative;
		overflow: hidden;
	}
	
	/* Panel System */
	.mobile-panel {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		transition: transform 0.3s ease;
		background: white;
	}
	
	.conversations-sidebar {
		width: 100%;
		position: relative;
		border-right: none;
		transform: translateX(0);
		z-index: 10;
	}
	
	.conversations-sidebar.hidden {
		transform: translateX(-100%);
	}
	
	.chat-area {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		transform: translateX(100%);
		z-index: 20;
		background: white;
	}
	
	.chat-area.active {
		transform: translateX(0);
	}
	
	/* Chat Header Updates */
	.chat-header {
		padding: 16px;
		gap: 12px;
		position: relative;
	}
	
	.back-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		background: none;
		border: none;
		color: #374151;
		font-size: 18px;
		padding: 8px;
		border-radius: 50%;
		cursor: pointer;
		transition: all 0.2s ease;
		margin-right: 12px;
		width: 36px;
		height: 36px;
	}
	
	.back-btn:hover {
		background: #f3f4f6;
		color: #1f2937;
	}
	
	/* Message adjustments */
	.messages-container {
		padding: 16px;
	}
	
	.message-input-area {
		padding: 16px;
	}
	
	.modal-content {
		margin: 10% auto;
		width: 95%;
	}
	
	.conversation-item {
		padding: 16px 20px;
		min-height: 60px;
	}
	
	.message-content {
		max-width: 85%;
	}
	
	.chat-avatar {
		width: 40px;
		height: 40px;
	}
	
	.chat-avatar .avatar-initials {
		width: 40px;
		height: 40px;
		font-size: 16px;
	}
	
	/* Section headers */
	.section-title {
		padding: 16px 20px 12px 20px;
		position: sticky;
		top: 0;
		background: #f8f9fa;
		z-index: 5;
	}
	
	/* Search box */
	.sidebar-header {
		padding: 16px;
		background: #f8f9fa;
		border-bottom: 1px solid #e1e5e9;
		position: sticky;
		top: 0;
		z-index: 5;
	}
	
	/* Ensure proper stacking */
	.conversations-list {
		padding-bottom: 20px;
	}
}