﻿/* ===== ===== ===== ===== ===== ===== ===== =====
   استایل‌های پیام‌ها (مشابه پیام رسان‌ها)
   ===== ===== ===== ===== ===== ===== ===== ===== */

/* ===== پیام‌ها ===== */
.message-wrapper {
	animation: messageSlide 0.25s ease;
}

.owner-message {
	animation: messageSlideLeft 0.25s ease;
}

.other-message {
	animation: messageSlideRight 0.25s ease;
}

/* ===== انیمیشن‌ها ===== */
@keyframes messageSlideLeft {
	from {
		opacity: 0;
		transform: translateX(-20px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateX(0) scale(1);
	}
}

@keyframes messageSlideRight {
	from {
		opacity: 0;
		transform: translateX(20px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateX(0) scale(1);
	}
}

/* ===== حباب پیام ===== */
.message-bubble {
	transition: all 0.15s ease;
	display: inline-block;
	max-width: 100%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

	.message-bubble:hover {
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
	}

/* ===== متن پیام ===== */
.message-text {
	max-width: 100%;
	word-wrap: break-word;
	overflow-wrap: break-word;
	text-align: initial;
}

	.message-text img {
		max-width: 100%;
		height: auto;
		border-radius: 8px;
	}

	.message-text p:last-child {
		margin-bottom: 0;
	}

/* ===== آواتار ===== */
.avatar {
	transition: transform 0.2s ease;
}

.message-wrapper:hover .avatar {
	transform: scale(1.05);
}

/* ===== پیوست (فایل) ===== */
.message-attachment {
	margin-top: 8px;
}

.attachment-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 8px;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.02);
	border: 1px solid rgba(0, 0, 0, 0.06);
}

.attachment-item-pdf {
	background: rgba(239, 68, 68, 0.05);
	border-color: rgba(239, 68, 68, 0.12);
}

.attachment-thumbnail {
	max-height: 70px;
	max-width: 70px;
	object-fit: cover;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
}

	.attachment-thumbnail:hover {
		transform: scale(1.05);
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	}

.attachment-icon-box {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e5e7eb;
	border-radius: 6px;
	flex-shrink: 0;
}

.attachment-icon-pdf {
	background: #fee2e2;
}

	.attachment-icon-pdf i {
		color: #dc2626;
	}

.attachment-info {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.attachment-name {
	font-size: 0.8rem;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.attachment-size {
	font-size: 0.6rem;
	color: #6c757d;
}

.attachment-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.btn-attachment {
	padding: 2px 8px;
	font-size: 0.7rem;
	border-radius: 4px;
}

/* ===== نشان‌ها (Badge) ===== */
.badge-purple {
	background-color: #f3e8ff !important;
	color: #7c22ce !important;
	border: 1px solid #d8b4fe !important;
}

.badge-green {
	background-color: #dcfce7 !important;
	color: #15803d !important;
	border: 1px solid #86efac !important;
}

.badge-blue {
	background-color: #dbeafe !important;
	color: #1d4ed8 !important;
	border: 1px solid #93c5fd !important;
}

.badge-amber {
	background-color: #fef3c7 !important;
	color: #b45309 !important;
	border: 1px solid #fcd34d !important;
}

/* ===== رنگ‌های بک‌گراند ===== */
.bg-blue-soft {
	background-color: #eef2ff;
}

.bg-purple-soft {
	background-color: #f0ebff;
}

.bg-green-soft {
	background-color: #e6f9f0;
}

.bg-gray-soft {
	background-color: #f1f3f5;
}

.bg-amber-soft {
	background-color: #fef3e2;
}

/* ===== رنگ‌های متن ===== */
.text-blue-dark {
	color: #4f6af5;
}

.text-purple-dark {
	color: #7c3aed;
}

.text-green-dark {
	color: #0f973d;
}

.text-amber-dark {
	color: #d97706;
}

/* ===== کلاس‌های کمکی ===== */
.cursor-pointer {
	cursor: pointer;
}

.text-truncate {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ===== حالت تاریک ===== */
@media (prefers-color-scheme: dark) {
	.bg-blue-soft {
		background-color: #1a2744 !important;
	}

	.bg-purple-soft {
		background-color: #241b3a !important;
	}

	.bg-green-soft {
		background-color: #0d281e !important;
	}

	.bg-amber-soft {
		background-color: #2a1f0e !important;
	}

	.bg-gray-soft {
		background-color: #2a2f3e !important;
	}

	.text-blue-dark {
		color: #6d8cff !important;
	}

	.text-purple-dark {
		color: #a78bfa !important;
	}

	.text-green-dark {
		color: #34d399 !important;
	}

	.message-text {
		color: #d1d5db !important;
	}

	.message-bubble:hover {
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
	}

	.attachment-item {
		background: rgba(255, 255, 255, 0.03);
		border-color: rgba(255, 255, 255, 0.06);
	}

	.attachment-item-pdf {
		background: rgba(239, 68, 68, 0.1);
		border-color: rgba(239, 68, 68, 0.2);
	}

	.attachment-icon-box {
		background: #2a2f3e;
	}
}

/* ===== موبایل ===== */
@media (max-width: 576px) {
	.message-container {
		max-width: 90% !important;
	}

	.avatar {
		width: 30px !important;
		height: 30px !important;
	}

		.avatar i {
			font-size: 0.75rem !important;
		}

	.message-bubble {
		padding: 0.4rem 0.75rem !important;
		border-radius: 10px !important;
	}

	.message-text {
		font-size: 0.85rem !important;
	}

		.message-text img {
			max-height: 100px !important;
		}

	.fw-semibold {
		font-size: 0.7rem !important;
	}

	.badge {
		font-size: 0.45rem !important;
		padding: 0.05rem 0.3rem !important;
	}

	.attachment-thumbnail {
		max-height: 50px;
		max-width: 50px;
	}

	.attachment-icon-box {
		width: 28px;
		height: 28px;
	}

		.attachment-icon-box i {
			font-size: 0.8rem !important;
		}

	.btn-attachment {
		padding: 1px 6px;
		font-size: 0.6rem;
	}
}
