/**
 * Messaging System Styles
 *
 * @package Together_Job_Board
 * @since 1.0.0
 */

.tjb-messages-page {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

.tjb-messages-layout {
	display: grid;
	grid-template-columns: 350px 1fr;
	gap: 20px;
	margin-top: 20px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	min-height: 600px;
}

/* Conversations List */
.tjb-conversations-list {
	border-right: 1px solid #e0e0e0;
	background: #f8f9fa;
	display: flex;
	flex-direction: column;
}

.tjb-conversations-header {
	padding: 20px;
	border-bottom: 1px solid #e0e0e0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #fff;
}

.tjb-conversations-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
}

.tjb-unread-badge {
	background: #dc3545;
	color: #fff;
	border-radius: 12px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 600;
}

.tjb-conversations {
	flex: 1;
	overflow-y: auto;
}

.tjb-conversation-item {
	display: flex;
	padding: 15px;
	border-bottom: 1px solid #e0e0e0;
	text-decoration: none;
	color: #333;
	transition: background 0.2s;
	background: #fff;
}

.tjb-conversation-item:hover {
	background: #f0f0f0;
}

.tjb-conversation-item.active {
	background: #e3f2fd;
	border-left: 3px solid #447AB3;
}

.tjb-conversation-item.unread {
	background: #fff3cd;
}

.tjb-conversation-item.unread.active {
	background: #e3f2fd;
}

.tjb-conversation-avatar {
	margin-right: 12px;
	flex-shrink: 0;
}

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

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

.tjb-conversation-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 5px;
}

.tjb-conversation-name {
	font-weight: 600;
	font-size: 14px;
	color: #333;
}

.tjb-unread-indicator {
	background: #dc3545;
	color: #fff;
	border-radius: 10px;
	padding: 2px 6px;
	font-size: 11px;
	font-weight: 600;
}

.tjb-conversation-preview {
	font-size: 13px;
	color: #666;
	margin-bottom: 5px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tjb-conversation-time {
	font-size: 11px;
	color: #999;
}

.tjb-no-conversations {
	padding: 40px 20px;
	text-align: center;
	color: #999;
}

/* Messages Area */
.tjb-messages-area {
	display: flex;
	flex-direction: column;
	background: #fff;
}

.tjb-conversation-view {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.tjb-conversation-header-bar {
	padding: 15px 20px;
	border-bottom: 1px solid #e0e0e0;
	background: #f8f9fa;
}

.tjb-conversation-participant {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tjb-conversation-participant img {
	border-radius: 50%;
	width: 40px;
	height: 40px;
}

.tjb-conversation-participant span {
	font-weight: 600;
	font-size: 16px;
}

.tjb-messages-list {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 15px;
}

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

.tjb-message-item.sent {
	align-self: flex-end;
}

.tjb-message-item.received {
	align-self: flex-start;
}

.tjb-message-content {
	padding: 12px 16px;
	border-radius: 12px;
	word-wrap: break-word;
}

.tjb-message-item.sent .tjb-message-content {
	background: #447AB3;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.tjb-message-item.received .tjb-message-content {
	background: #f0f0f0;
	color: #333;
	border-bottom-left-radius: 4px;
}

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

.tjb-message-content p:last-child {
	margin-bottom: 0;
}

.tjb-message-attachments {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.tjb-message-item.received .tjb-message-attachments {
	border-top-color: rgba(0, 0, 0, 0.1);
}

.tjb-attachment-link {
	display: inline-block;
	padding: 6px 12px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	color: inherit;
	text-decoration: none;
	font-size: 12px;
	margin-right: 8px;
	margin-top: 5px;
}

.tjb-message-item.received .tjb-attachment-link {
	background: rgba(0, 0, 0, 0.05);
}

.tjb-message-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 5px;
	padding: 0 4px;
	font-size: 11px;
	color: #999;
}

.tjb-message-read {
	color: #447AB3;
}

.tjb-message-compose {
	padding: 20px;
	border-top: 1px solid #e0e0e0;
	background: #f8f9fa;
}

.tjb-send-message-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tjb-message-input-wrapper {
	display: flex;
	gap: 10px;
	align-items: flex-end;
}

.tjb-message-input {
	flex: 1;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	resize: vertical;
	font-family: inherit;
	font-size: 14px;
}

.tjb-message-input:focus {
	outline: none;
	border-color: #447AB3;
}

.tjb-send-message-btn {
	padding: 12px 24px;
	white-space: nowrap;
}

.tjb-message-errors {
	color: #dc3545;
	font-size: 13px;
	margin-top: 5px;
}

.tjb-no-conversation-selected {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #999;
	font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
	.tjb-messages-layout {
		grid-template-columns: 1fr;
	}

	.tjb-conversations-list {
		border-right: none;
		border-bottom: 1px solid #e0e0e0;
		max-height: 300px;
	}

	.tjb-message-item {
		max-width: 85%;
	}
}

