/* بانک پرامپت — استایل اختصاصی، راست‌به‌چپ و واکنش‌گرا */

.pb-card-grid,
.pb-submit-wrap,
.pb-filter-form,
.pb-prompt-box,
.pb-rating,
.pb-home-section {
	direction: rtl;
	text-align: right;
	box-sizing: border-box;
}

.pb-card-grid *,
.pb-submit-wrap *,
.pb-filter-form *,
.pb-prompt-box *,
.pb-rating *,
.pb-home-section * {
	box-sizing: border-box;
}

:root {
	--pb-primary: #6d28d9;
	--pb-primary-dark: #5b21b6;
	--pb-accent: #f59e0b;
	--pb-bg-soft: #f7f5ff;
	--pb-border: #e5e0f5;
	--pb-text: #241f33;
	--pb-text-muted: #6b647f;
	--pb-radius: 14px;
}

/* ---------- بخش‌های صفحه اصلی ---------- */
.pb-home-section {
	margin: 40px 0;
}
.pb-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
}
.pb-section-header h2 {
	font-size: 1.4em;
	margin: 0;
	color: var(--pb-text);
}
.pb-see-all {
	font-size: 0.9em;
	color: var(--pb-primary);
	text-decoration: none;
	white-space: nowrap;
}
.pb-see-all:hover { text-decoration: underline; }

.pb-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 18px;
}

.pb-card {
	display: block;
	background: #fff;
	border: 1px solid var(--pb-border);
	border-radius: var(--pb-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform .15s ease, box-shadow .15s ease;
}
.pb-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(109, 40, 217, 0.12);
	border-color: var(--pb-primary);
}
.pb-card-thumb {
	position: relative;
	height: 140px;
	background: var(--pb-bg-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.pb-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.pb-card-thumb-placeholder {
	font-size: 2.2em;
	color: var(--pb-primary);
	opacity: 0.5;
}
.pb-card-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(109, 40, 217, 0.9);
	color: #fff;
	font-size: 0.72em;
	padding: 3px 10px;
	border-radius: 999px;
}
.pb-card-body { padding: 14px 16px 16px; }
.pb-card-title {
	font-size: 1.05em;
	margin: 0 0 6px;
	color: var(--pb-text);
	line-height: 1.5;
}
.pb-card-excerpt {
	font-size: 0.88em;
	color: var(--pb-text-muted);
	margin: 0 0 12px;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.pb-card-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.82em;
	color: var(--pb-text-muted);
}
.pb-card-rating { color: var(--pb-accent); font-weight: 600; }
.pb-card-rating small { color: var(--pb-text-muted); font-weight: 400; }

/* ---------- جستجو و فیلتر ---------- */
.pb-filter-form { margin: 20px 0 30px; }
.pb-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.pb-filter-search,
.pb-filter-select {
	padding: 11px 14px;
	border: 1px solid var(--pb-border);
	border-radius: 10px;
	font-size: 0.95em;
	background: #fff;
	color: var(--pb-text);
}
.pb-filter-search { flex: 2 1 220px; }
.pb-filter-select { flex: 1 1 140px; }

.pb-btn {
	display: inline-block;
	padding: 11px 22px;
	border: none;
	border-radius: 10px;
	font-size: 0.95em;
	cursor: pointer;
	font-weight: 600;
}
.pb-btn-primary {
	background: var(--pb-primary);
	color: #fff;
	transition: background .15s ease;
}
.pb-btn-primary:hover { background: var(--pb-primary-dark); }

/* ---------- صفحه تک‌پرامپت ---------- */
.pb-single-meta {
	font-size: 0.88em;
	color: var(--pb-text-muted);
	margin-bottom: 10px;
}
.pb-prompt-box {
	background: var(--pb-bg-soft);
	border: 1px solid var(--pb-border);
	border-radius: var(--pb-radius);
	margin: 16px 0 24px;
	overflow: hidden;
}
.pb-prompt-box-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 18px;
	background: #fff;
	border-bottom: 1px solid var(--pb-border);
	font-weight: 600;
	color: var(--pb-text);
}
.pb-copy-btn {
	background: var(--pb-primary);
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.85em;
	transition: background .15s ease;
}
.pb-copy-btn:hover { background: var(--pb-primary-dark); }
.pb-copy-btn.pb-copied { background: #16a34a; }
.pb-prompt-text {
	padding: 18px;
	line-height: 2;
	white-space: pre-wrap;
	color: var(--pb-text);
}

/* ---------- امتیازدهی ---------- */
.pb-rating {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin: 10px 0 30px;
	padding: 14px 18px;
	border: 1px solid var(--pb-border);
	border-radius: var(--pb-radius);
	background: #fff;
}
.pb-rating-stars { display: flex; gap: 4px; }
.pb-star {
	background: none;
	border: none;
	font-size: 1.6em;
	line-height: 1;
	color: #d8d3ea;
	cursor: pointer;
	padding: 0;
	transition: color .1s ease, transform .1s ease;
}
.pb-star:hover:not(:disabled),
.pb-star:hover:not(:disabled) ~ .pb-star { color: var(--pb-accent); }
.pb-rating-stars:hover .pb-star:not(:disabled) { color: var(--pb-accent); }
.pb-star-disabled { color: var(--pb-accent) !important; cursor: default; }
.pb-rating-summary { font-size: 0.9em; color: var(--pb-text-muted); }
.pb-rating-avg { font-weight: 700; color: var(--pb-text); }
.pb-rating-message { font-size: 0.85em; color: var(--pb-primary); width: 100%; }

/* ---------- فرم ثبت پرامپت ---------- */
.pb-submit-wrap { max-width: 640px; }
.pb-submit-form { display: flex; flex-direction: column; gap: 16px; }
.pb-field { display: flex; flex-direction: column; gap: 6px; }
.pb-field label { font-weight: 600; font-size: 0.92em; color: var(--pb-text); }
.pb-field input[type="text"],
.pb-field input[type="file"],
.pb-field select,
.pb-field textarea {
	padding: 11px 14px;
	border: 1px solid var(--pb-border);
	border-radius: 10px;
	font-size: 0.95em;
	font-family: inherit;
	background: #fff;
	color: var(--pb-text);
	width: 100%;
}
.pb-field textarea { resize: vertical; }
.pb-notice {
	background: var(--pb-bg-soft);
	border: 1px solid var(--pb-primary);
	color: var(--pb-primary-dark);
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 18px;
	font-size: 0.92em;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 600px) {
	.pb-card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
	.pb-section-header { flex-direction: column; align-items: flex-start; gap: 6px; }
	.pb-filter-row { flex-direction: column; }
}
