/*
 * استایل بازار خرید و فروش اکانت نبردینو
 * هم‌خانواده با ظاهر افزونه «ثبت‌نام تورنمنت» (پس‌زمینه تیره + درخشش رنگی + پترن HUD)
 * تمام کلاس‌ها با پیشوند nbm- تا با افزونه‌ها/قالب‌های دیگر (و افزونه نبردینو دیگر) تداخل نداشته باشد.
 */

.nbm-wrapper {
	max-width: 900px;
	margin: 30px auto;
	font-family: inherit;
	box-sizing: border-box;
}

.nbm-wrapper * {
	box-sizing: border-box;
}

/* ---------- فرم‌ها (ثبت آگهی / جستجو) ---------- */

.nbm-form {
	position: relative;
	z-index: 1;
	max-width: 640px;
	margin: 0 auto;
	background: rgba(16, 21, 29, 0.92);
	border-radius: 17px;
	padding: 32px 28px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.nbm-wrapper:has(.nbm-form) {
	position: relative;
	padding: 3px;
	border-radius: 20px;
	overflow: hidden;
	background:
		radial-gradient(circle at 15% 15%, rgba(0, 200, 150, 0.3), transparent 45%),
		radial-gradient(circle at 85% 85%, rgba(0, 140, 255, 0.25), transparent 45%),
		linear-gradient(135deg, #05070a 0%, #0d1420 55%, #05070a 100%);
	background-size: 200% 200%;
	animation: nbm-bg-shift 12s ease infinite;
}

@keyframes nbm-bg-shift {
	0%   { background-position: 0% 0%; }
	50%  { background-position: 100% 100%; }
	100% { background-position: 0% 0%; }
}

@media (prefers-reduced-motion: reduce) {
	.nbm-wrapper:has(.nbm-form) {
		animation: none;
	}
}

.nbm-form-header h3 {
	color: #ffffff;
	font-size: 22px;
	margin: 0 0 8px;
	font-weight: 700;
}

.nbm-form-header p {
	color: #9aa4b2;
	font-size: 14px;
	margin: 0 0 24px;
	line-height: 1.8;
}

.nbm-form-group {
	margin-bottom: 18px;
}

.nbm-form-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.nbm-form-row .nbm-half {
	flex: 1 1 220px;
}

.nbm-form label {
	display: block;
	color: #d7dce2;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
}

.nbm-required {
	color: #ff5c5c;
}

.nbm-form input[type="text"],
.nbm-form input[type="tel"],
.nbm-form input[type="number"],
.nbm-form input[type="file"],
.nbm-form select,
.nbm-form textarea {
	width: 100%;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: #1c2733;
	color: #ffffff;
	font-size: 14px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	outline: none;
	font-family: inherit;
}

.nbm-form textarea {
	resize: vertical;
	min-height: 110px;
}

.nbm-form input::placeholder,
.nbm-form textarea::placeholder {
	color: #6b7684;
}

.nbm-form input:focus,
.nbm-form select:focus,
.nbm-form textarea:focus {
	border-color: #00c896;
	box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

.nbm-form select option {
	background: #1c2733;
	color: #fff;
}

.nbm-honeypot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.nbm-submit-btn {
	width: 100%;
	padding: 14px 18px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, #00c896 0%, #008cff 100%);
	color: #ffffff;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 6px 18px rgba(0, 140, 255, 0.35);
}

.nbm-submit-btn:hover {
	transform: translateY(-1px);
}

.nbm-alert {
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 18px;
	font-size: 14px;
	line-height: 1.8;
}

.nbm-alert-success {
	background: rgba(46, 204, 113, 0.12);
	border: 1px solid rgba(46, 204, 113, 0.4);
	color: #2ecc71;
}

.nbm-alert-error {
	background: rgba(255, 92, 92, 0.12);
	border: 1px solid rgba(255, 92, 92, 0.4);
	color: #ff5c5c;
}

.nbm-alert-info {
	background: rgba(0, 140, 255, 0.1);
	border: 1px solid rgba(0, 140, 255, 0.35);
	color: #4db2ff;
	text-align: center;
}

/* ---------- جستجو ---------- */

.nbm-search-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	background: rgba(16, 21, 29, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.08);
	padding: 16px;
	border-radius: 14px;
	margin-bottom: 22px;
}

.nbm-search-form input[type="text"],
.nbm-search-form select {
	background: #1c2733;
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: #fff;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 14px;
}

.nbm-search-form input[type="text"] {
	flex: 2 1 220px;
}

.nbm-search-form select {
	flex: 1 1 140px;
}

.nbm-search-form button {
	flex: 0 0 auto;
	padding: 10px 22px;
	background: linear-gradient(135deg, #00c896 0%, #008cff 100%);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-weight: 700;
	cursor: pointer;
}

/* ---------- لیست آگهی‌ها ---------- */

.nbm-listing-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 18px;
}

.nbm-listing-card {
	background: #101820;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 14px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nbm-listing-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.nbm-listing-thumb {
	position: relative;
	height: 160px;
	background: #1c2733;
	overflow: hidden;
}

.nbm-listing-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nbm-listing-thumb-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #4a5568;
	font-weight: 700;
	letter-spacing: 1px;
}

.nbm-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.nbm-listing-thumb .nbm-badge {
	position: absolute;
	top: 10px;
	right: 10px;
}

.nbm-badge-sell {
	background: #d4edda;
	color: #1e7e34;
}

.nbm-badge-buy {
	background: #cfe2ff;
	color: #0a53be;
}

.nbm-listing-body {
	padding: 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nbm-listing-title {
	color: #fff;
	font-size: 16px;
	margin: 0;
}

.nbm-listing-desc {
	color: #9aa4b2;
	font-size: 13px;
	line-height: 1.7;
	margin: 0;
	flex: 1;
}

.nbm-listing-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: #6b7684;
}

.nbm-listing-price {
	color: #00c896;
	font-weight: 700;
	font-size: 14px;
}

.nbm-listing-contact {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	padding-top: 10px;
	color: #d7dce2;
	font-size: 13px;
}

.nbm-contact-btn {
	background: linear-gradient(135deg, #00c896 0%, #008cff 100%);
	color: #fff !important;
	padding: 6px 14px;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 700;
	font-size: 12px;
}

.nbm-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 24px;
	flex-wrap: wrap;
}

.nbm-page-link {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 8px;
	background: #1c2733;
	color: #d7dce2;
	text-decoration: none;
	font-size: 13px;
}

.nbm-page-current {
	background: linear-gradient(135deg, #00c896 0%, #008cff 100%);
	color: #fff;
	font-weight: 700;
}

@media (max-width: 480px) {
	.nbm-form {
		padding: 22px 16px;
	}
	.nbm-search-form {
		flex-direction: column;
	}
}

/* ---------- چت خریدار/فروشنده (طراحی مدرن) ---------- */

.nbm-chat-btn {
	display: block;
	text-align: center;
	margin-top: 8px;
	padding: 8px 12px;
	background: linear-gradient(135deg, #008cff 0%, #00c896 100%);
	color: #fff !important;
	border-radius: 8px;
	text-decoration: none;
	font-size: 12px;
	font-weight: 700;
}

.nbm-chat-btn-secondary {
	background: #1c2733;
	color: #9aa4b2 !important;
}

.nbm-messages-title {
	color: #fff;
	font-size: 20px;
	margin: 0 0 18px;
	font-weight: 700;
}

.nbm-conversation-avatar {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: linear-gradient(135deg, #00c896 0%, #008cff 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 16px;
}

.nbm-conversation-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nbm-conversation-item {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #101820;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 14px;
	padding: 14px 16px;
	text-decoration: none;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.nbm-conversation-item:hover {
	border-color: rgba(0, 200, 150, 0.35);
	transform: translateX(-2px);
}

.nbm-conversation-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.nbm-conversation-main strong {
	color: #fff;
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nbm-conversation-main span {
	color: #9aa4b2;
	font-size: 12px;
}

.nbm-unread-badge {
	background: linear-gradient(135deg, #ff5c33 0%, #ff9900 100%);
	color: #fff;
	border-radius: 50%;
	min-width: 22px;
	height: 22px;
	padding: 0 5px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
}

.nbm-back-link {
	display: inline-block;
	color: #9aa4b2;
	text-decoration: none;
	font-size: 13px;
	margin-bottom: 14px;
}

.nbm-thread-header {
	background: #101820;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 16px 16px 0 0;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.nbm-thread-header-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.nbm-thread-header-text strong {
	color: #fff;
	font-size: 15px;
}

.nbm-thread-header-text span {
	color: #9aa4b2;
	font-size: 12px;
}

.nbm-thread-messages {
	background: #0b1119;
	background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
	background-size: 16px 16px;
	border-right: 1px solid rgba(255, 255, 255, 0.07);
	border-left: 1px solid rgba(255, 255, 255, 0.07);
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 440px;
	overflow-y: auto;
}

.nbm-empty {
	color: #9aa4b2;
	font-size: 13px;
	text-align: center;
	margin: auto;
}

.nbm-message-bubble {
	max-width: 75%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 13px;
	line-height: 1.7;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nbm-message-bubble p {
	margin: 0 0 4px;
	color: #fff;
	word-break: break-word;
	white-space: pre-wrap;
}

.nbm-message-time {
	font-size: 10px;
	color: rgba(255, 255, 255, 0.55);
}

.nbm-message-mine {
	align-self: flex-start;
	background: linear-gradient(135deg, #008cff 0%, #00c896 100%);
	border-radius: 14px 14px 14px 3px;
}

.nbm-message-theirs {
	align-self: flex-end;
	background: #1c2733;
	border-radius: 14px 14px 3px 14px;
}

.nbm-message-form {
	background: #101820;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-top: none;
	border-radius: 0 0 16px 16px;
	padding: 12px 14px;
	display: flex;
	gap: 10px;
	align-items: center;
}

.nbm-message-form textarea {
	flex: 1;
	background: #1c2733;
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: #fff;
	border-radius: 20px;
	padding: 11px 16px;
	font-size: 13px;
	font-family: inherit;
	resize: none;
	max-height: 100px;
}

.nbm-message-send-btn {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: linear-gradient(135deg, #008cff 0%, #00c896 100%);
	color: #fff;
	border: none;
	cursor: pointer;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}

.nbm-message-send-btn:hover {
	transform: scale(1.06);
}

.nbm-message-send-btn svg {
	transform: scaleX(-1); /* جهت پیکان مناسب راست‌به‌چپ */
}

.nbm-field-note {
	color: #6b7684;
	font-size: 12px;
	margin: -10px 0 18px;
}

.nbm-listing-uid {
	font-size: 11px;
	color: #6b7684;
	direction: ltr;
	text-align: right;
}

.nbm-listing-uid strong {
	color: #d7dce2;
}

@media (max-width: 480px) {
	.nbm-thread-messages {
		max-height: 340px;
	}
}

/* ---------- کارت‌های لیست: لینک قابل‌کلیک + نشان تعداد تصویر ---------- */

.nbm-listing-thumb {
	display: block;
	text-decoration: none;
}

.nbm-gallery-count {
	position: absolute;
	bottom: 10px;
	left: 10px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 11px;
	padding: 3px 10px;
	border-radius: 20px;
}

.nbm-listing-title-link {
	text-decoration: none;
}

.nbm-view-detail-btn {
	display: block;
	text-align: center;
	padding: 9px 12px;
	border-radius: 8px;
	background: rgba(0, 200, 150, 0.12);
	border: 1px solid rgba(0, 200, 150, 0.35);
	color: #00c896 !important;
	text-decoration: none;
	font-size: 12px;
	font-weight: 700;
}

/* ==========================================================
 * صفحه اختصاصی جزئیات آگهی
 * ========================================================== */

.nbm-detail-wrapper {
	max-width: 1100px;
}

.nbm-detail-layout {
	display: grid;
	grid-template-columns: 1.3fr 1fr;
	gap: 26px;
	align-items: start;
}

@media (max-width: 860px) {
	.nbm-detail-layout {
		grid-template-columns: 1fr;
	}
}

/* --- گالری --- */

.nbm-detail-gallery {
	background: #101820;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 16px;
	overflow: hidden;
}

.nbm-gallery-main {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #1c2733;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	cursor: zoom-in;
}

.nbm-gallery-main-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #0d1420;
}

.nbm-gallery-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.nbm-gallery-arrow:hover {
	background: rgba(0, 0, 0, 0.75);
}

.nbm-gallery-prev {
	right: 12px;
}

.nbm-gallery-next {
	left: 12px;
}

.nbm-gallery-thumbs {
	display: flex;
	gap: 8px;
	padding: 12px;
	overflow-x: auto;
}

.nbm-gallery-thumb-btn {
	flex: 0 0 auto;
	width: 62px;
	height: 62px;
	border-radius: 8px;
	overflow: hidden;
	border: 2px solid transparent;
	padding: 0;
	cursor: pointer;
	background: #1c2733;
	opacity: 0.6;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.nbm-gallery-thumb-btn img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nbm-gallery-thumb-btn:hover {
	opacity: 0.85;
}

.nbm-gallery-thumb-active {
	opacity: 1;
	border-color: #00c896;
}

.nbm-detail-no-image {
	background: #101820;
	border: 1px dashed rgba(255, 255, 255, 0.12);
	border-radius: 16px;
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #6b7684;
}

/* --- لایت‌باکس (نمایش تمام‌صفحه تصویر) --- */

.nbm-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.nbm-lightbox-overlay[hidden] {
	display: none;
}

.nbm-lightbox-img {
	max-width: 100%;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 6px;
	touch-action: pan-y;
}

.nbm-lightbox-close {
	position: absolute;
	top: 18px;
	left: 18px;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-size: 20px;
	cursor: pointer;
}

.nbm-lightbox-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
}

.nbm-lightbox-prev {
	right: 18px;
}

.nbm-lightbox-next {
	left: 18px;
}

.nbm-lightbox-counter {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 12px;
}

/* --- ستون اطلاعات --- */

.nbm-detail-header {
	background: #101820;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 16px;
	padding: 20px;
	margin-bottom: 16px;
}

.nbm-detail-title {
	color: #fff;
	font-size: 20px;
	margin: 10px 0;
	line-height: 1.6;
}

.nbm-detail-price {
	color: #00c896;
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 10px;
}

.nbm-detail-sub-meta {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	font-size: 12px;
	color: #6b7684;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	padding-top: 12px;
}

.nbm-detail-uid strong {
	color: #d7dce2;
	direction: ltr;
	display: inline-block;
}

.nbm-detail-description {
	background: #101820;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 16px;
	padding: 20px;
	margin-bottom: 16px;
}

.nbm-detail-description h3,
.nbm-detail-seller-card h3 {
	color: #fff;
	font-size: 15px;
	margin: 0 0 14px;
	border-right: 3px solid #00c896;
	padding-right: 10px;
}

.nbm-detail-description-text {
	color: #d7dce2;
	font-size: 14px;
	line-height: 2;
}

.nbm-detail-description-text p {
	margin: 0 0 14px;
}

.nbm-detail-seller-card {
	background: #101820;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 16px;
	padding: 20px;
	position: sticky;
	top: 20px;
}

.nbm-seller-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
}

.nbm-seller-avatar {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: linear-gradient(135deg, #00c896 0%, #008cff 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 18px;
	flex-shrink: 0;
}

.nbm-seller-name {
	color: #fff;
	font-size: 15px;
	font-weight: 600;
}

.nbm-detail-contact-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.nbm-detail-call-btn,
.nbm-detail-chat-btn {
	display: block;
	text-align: center;
	padding: 13px 16px;
	border-radius: 10px;
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
}

.nbm-detail-call-btn {
	background: linear-gradient(135deg, #00c896 0%, #008cff 100%);
	color: #fff !important;
}

.nbm-detail-chat-btn {
	background: #1c2733;
	border: 1px solid rgba(0, 140, 255, 0.4);
	color: #4db2ff !important;
}

.nbm-detail-chat-btn-secondary {
	border-color: rgba(255, 255, 255, 0.12);
	color: #9aa4b2 !important;
}

@media (max-width: 480px) {
	.nbm-detail-seller-card {
		position: static;
	}
}
