/**
 * Messages Styles - Modern Professional Design
 *
 * @package Coursee
 * @since 1.0.0
 */

.coursee-messages-wrapper {
	max-width: 1400px;
	margin: 2rem auto;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	border: 1px solid #e2e8f0;
	overflow: hidden;
}

.messages-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem 2rem;
	background: #ffffff;
	border-bottom: 1px solid #e2e8f0;
}

.messages-title {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 700;
	color: #0f172a;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.messages-title .dashicons {
	font-size: 1.5rem;
	color: #3b82f6;
}

.new-message-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: #3b82f6;
	border: 1px solid #3b82f6;
	color: #fff;
	padding: 0.625rem 1.25rem;
	border-radius: 8px;
	font-weight: 600;
	transition: all 0.2s ease;
}

.new-message-btn:hover {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
}

.messages-container {
	display: flex;
	height: calc(100vh - 300px);
	min-height: 600px;
}

/* Conversations Sidebar */
.conversations-sidebar {
	width: 350px;
	border-right: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	background: #f8fafc;
}

.conversations-search {
	position: relative;
	padding: 1rem;
	border-bottom: 1px solid #e2e8f0;
	background: #ffffff;
}

.conversations-search input {
	width: 100%;
	padding: 0.75rem 1rem 0.75rem 2.5rem;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 0.9375rem;
	background: #ffffff;
	transition: all 0.2s ease;
}

.conversations-search input:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
	position: absolute;
	left: 1.75rem;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	font-size: 1.125rem;
}

.conversations-list {
	flex: 1;
	overflow-y: auto;
	padding: 0.5rem;
}

.conversation-item {
	display: flex;
	gap: 1rem;
	padding: 1rem;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	margin-bottom: 0.5rem;
	background: #ffffff;
	border: 1px solid transparent;
}

.conversation-item:hover {
	background: #f8fafc;
	border-color: #e2e8f0;
}

.conversation-item.active {
	background: #eff6ff;
	border-color: #3b82f6;
}

.conversation-avatar {
	position: relative;
	flex-shrink: 0;
}

.conversation-avatar img {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid #e2e8f0;
}

.unread-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #ef4444;
	color: #fff;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	border: 2px solid #ffffff;
}

.conversation-info {
	flex: 1;
	min-width: 0;
}

.conversation-name {
	font-weight: 600;
	color: #0f172a;
	margin-bottom: 0.25rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.unread-indicator {
	width: 8px;
	height: 8px;
	background: #3b82f6;
	border-radius: 50%;
}

.conversation-preview {
	font-size: 0.875rem;
	color: #64748b;
	margin-bottom: 0.25rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.conversation-time {
	font-size: 0.75rem;
	color: #94a3b8;
}

.empty-conversations {
	padding: 3rem 2rem;
	text-align: center;
	color: #94a3b8;
}

/* Messages Main Area */
.messages-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #ffffff;
}

.conversation-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem 2rem;
	border-bottom: 1px solid #e2e8f0;
	background: #ffffff;
}

.conversation-user-info {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.conversation-user-info img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 2px solid #e2e8f0;
}

.conversation-user-info h3 {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	color: #0f172a;
}

.user-status {
	font-size: 0.8125rem;
	color: #64748b;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.25rem;
}

.status-online {
	width: 8px;
	height: 8px;
	background: #10b981;
	border-radius: 50%;
}

.status-offline {
	width: 8px;
	height: 8px;
	background: #94a3b8;
	border-radius: 50%;
}

.conversation-actions-btn {
	background: transparent;
	border: none;
	color: #64748b;
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.conversation-actions-btn:hover {
	background: #f8fafc;
	color: #334155;
}

.messages-list {
	flex: 1;
	overflow-y: auto;
	padding: 2rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	background: #f8fafc;
}

.message-item {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	max-width: 70%;
}

.message-item.message-sent {
	margin-left: auto;
	flex-direction: row-reverse;
}

.message-avatar {
	flex-shrink: 0;
}

.message-avatar img {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 2px solid #e2e8f0;
}

.message-content {
	flex: 1;
	min-width: 0;
}

.message-sender {
	font-size: 0.8125rem;
	font-weight: 600;
	color: #334155;
	margin-bottom: 0.25rem;
}

.message-bubble {
	background: #ffffff;
	padding: 0.875rem 1.125rem;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-item.message-sent .message-bubble {
	background: #3b82f6;
	border-color: #3b82f6;
	color: #ffffff;
}

.message-bubble p {
	margin: 0;
	color: inherit;
	line-height: 1.6;
}

.message-item.message-sent .message-bubble p {
	color: #ffffff;
}

.message-time {
	font-size: 0.75rem;
	color: #94a3b8;
	margin-top: 0.5rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.message-read-indicator {
	color: #3b82f6;
}

.no-conversation-selected {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 3rem;
	color: #94a3b8;
	text-align: center;
}

.empty-state-icon {
	font-size: 4rem;
	margin-bottom: 1rem;
	opacity: 0.5;
}

.no-conversation-selected h3 {
	margin: 0 0 0.5rem 0;
	color: #334155;
	font-size: 1.25rem;
}

.no-conversation-selected p {
	margin: 0;
	color: #64748b;
}

/* Message Form */
.message-form-container {
	padding: 1.5rem 2rem;
	border-top: 1px solid #e2e8f0;
	background: #ffffff;
}

.message-form {
	display: flex;
	gap: 1rem;
	align-items: flex-end;
}

.message-input-wrapper {
	flex: 1;
	display: flex;
	gap: 0.75rem;
	align-items: flex-end;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 0.75rem;
}

.message-input {
	flex: 1;
	border: none;
	background: transparent;
	resize: none;
	font-size: 0.9375rem;
	color: #0f172a;
	font-family: inherit;
	padding: 0.5rem;
}

.message-input:focus {
	outline: none;
}

.send-message-btn {
	background: #3b82f6;
	border: 1px solid #3b82f6;
	color: #fff;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.send-message-btn:hover {
	background: #2563eb;
	border-color: #2563eb;
}

/* Modal */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.6);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	backdrop-filter: blur(4px);
}

.modal-content {
	background: #ffffff;
	border-radius: 12px;
	max-width: 600px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
	border: 1px solid #e2e8f0;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem 2rem;
	border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: #0f172a;
}

.modal-close {
	background: transparent;
	border: none;
	font-size: 1.5rem;
	color: #64748b;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.modal-close:hover {
	background: #f8fafc;
	color: #334155;
}

.modal-body {
	padding: 2rem;
}

.form-group {
	margin-bottom: 1.5rem;
}

.form-group label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
	color: #334155;
	font-size: 0.9375rem;
}

.form-control {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 0.9375rem;
	transition: all 0.2s ease;
	background: #ffffff;
}

.form-control:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
	display: flex;
	gap: 1rem;
	justify-content: flex-end;
	margin-top: 2rem;
}

.modal-cancel {
	background: transparent;
	border: 1px solid #cbd5e1;
	color: #475569;
}

.modal-cancel:hover {
	background: #f8fafc;
	border-color: #94a3b8;
	color: #334155;
}

/* Responsive */
@media (max-width: 768px) {
	.messages-container {
		flex-direction: column;
		height: auto;
		min-height: auto;
	}

	.conversations-sidebar {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid #e2e8f0;
		max-height: 300px;
	}

	.message-item {
		max-width: 85%;
	}

	.modal {
		padding: 1rem;
	}

	.modal-content {
		max-height: 95vh;
	}
}
