@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Variable.woff2') format('woff2-variations'),
       url('/fonts/Vazirmatn-Variable.woff2') format('woff2 supports variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* پالت اصلی: الهام‌گرفته از تخته‌سیاه کلاس درس (ink) + زعفران (accent طلایی) */
  --ink: #12201c;
  --ink-soft: #1b2f28;
  --paper: #faf6ee;
  --paper-card: #ffffff;
  --text: #1b2420;
  --text-muted: #5b6b63;
  --border: #e6dfd0;

  --gold: #e2a63d;
  --gold-dark: #c78b26;
  --teal: #2f8f7e;
  --teal-dark: #23695d;

  --danger: #c0392b;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  background: var(--paper);
  color: var(--text);
  direction: rtl;
  text-align: right;
  line-height: 1.85;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 800; line-height: 1.35; margin: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- هدر ---------- */
header.site-header {
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.logo {
  font-weight: 800;
  font-size: 19px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav-links a, .nav-links button {
  font-size: 14.5px;
  color: #d8ddd6;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s;
}
.nav-links a:hover, .nav-links button:hover { color: var(--gold); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--gold);
  color: #1b1404;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--gold-dark); }
.btn:active { transform: translateY(1px); }
.btn.outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn.outline:hover { background: rgba(226,166,61,.12); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #a5301f; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* light-context outline button (used on paper background) */
.btn.outline.on-paper { color: var(--teal-dark); border-color: var(--teal-dark); }
.btn.outline.on-paper:hover { background: rgba(47,143,126,.1); }

/* ---------- هیرو ساده (برای صفحات داخلی مثل داشبورد) ---------- */
.hero {
  padding: 54px 0 34px;
  text-align: center;
  background: var(--ink);
  color: #fff;
}
.hero h1 { font-size: 30px; margin-bottom: 10px; color: #fff; }
.hero p { color: #b9c2bc; font-size: 15.5px; }

/* ---------- هیروی صفحه اصلی ---------- */
.hero-home {
  background: radial-gradient(120% 160% at 15% -10%, #1c3a30 0%, var(--ink) 55%);
  color: #fff;
  padding: 70px 0 0;
  position: relative;
}
.hero-home .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(226,166,61,.12);
  border: 1px solid rgba(226,166,61,.35);
  padding: 6px 14px;
  border-radius: 30px;
  margin-bottom: 22px;
}
.hero-home .hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
  padding-bottom: 50px;
}
@media (max-width: 860px) { .hero-home .hero-grid { grid-template-columns: 1fr; } }

.hero-home h1 {
  font-size: 46px;
  color: #fff;
  letter-spacing: -.5px;
}
.hero-home h1 .mark {
  color: var(--ink);
  background: var(--gold);
  padding: 2px 10px;
  border-radius: 8px;
  display: inline-block;
  transform: rotate(-1deg);
}
.hero-home p.lead {
  font-size: 17px;
  color: #c6cec7;
  margin: 20px 0 28px;
  max-width: 46ch;
}
.hero-home .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- signature element: نوار زمان‌بندی ویدیو (chapter scrubber) --- */
.scrubber-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 22px 22px 26px;
  backdrop-filter: blur(6px);
}
.scrubber-card .scrubber-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #9aa79f;
  margin-bottom: 12px;
}
.scrubber-track {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,.14);
  border-radius: 10px;
  margin: 0 4px 26px;
}
.scrubber-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: 10px;
  animation: fillScrubber 1.6s .3s ease-out forwards;
}
@keyframes fillScrubber { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .scrubber-fill { animation: none; width: 100%; }
}
.scrubber-track .chapter-dot {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(50%, -50%);
  background: var(--ink);
  border: 3px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--gold);
}
.chapter-dot.c1 { right: 0%; }
.chapter-dot.c2 { right: 33%; }
.chapter-dot.c3 { right: 66%; }
.chapter-dot.c4 { right: 100%; border-color: var(--teal); color: var(--teal); }

.scrubber-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.scrubber-steps div { font-size: 12px; color: #aeb8b1; text-align: center; }
.scrubber-steps strong { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }

/* --- کارت‌های آماری شناور --- */
.stats-float {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  transform: translateY(38px);
  position: relative;
  z-index: 5;
}
@media (max-width: 760px) { .stats-float { grid-template-columns: repeat(2, 1fr); } }
.stat-float-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 14px 30px rgba(18,32,28,.12);
}
.stat-float-card .num { font-size: 24px; font-weight: 800; color: var(--teal-dark); }
.stat-float-card .label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* ---------- بخش‌های عمومی صفحه اصلی ---------- */
.section { padding: 90px 0 60px; }
.section.tight { padding: 60px 0; }
.section-head { max-width: 640px; margin: 0 auto 42px; text-align: center; }
.section-head .eyebrow-sm {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 10px;
}
.section-head h2 { font-size: 30px; }
.section-head p { color: var(--text-muted); margin-top: 10px; font-size: 15px; }

.divider-scrub {
  height: 3px;
  width: 64px;
  margin: 18px auto 0;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: 10px;
}

/* --- ویژگی‌ها --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
}
.feature-card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(47,143,126,.12);
  color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 16.5px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); margin: 0; }

/* --- مراحل کار (چطور کار می‌کند) --- */
.steps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  position: relative;
}
@media (max-width: 860px) { .steps-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps-row { grid-template-columns: 1fr; } }
.step-card { position: relative; padding-top: 8px; }
.step-card .step-num {
  font-size: 34px;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--gold);
  display: block;
  margin-bottom: 10px;
}
.step-card h3 { font-size: 15.5px; margin-bottom: 6px; }
.step-card p { font-size: 13.5px; color: var(--text-muted); margin: 0; }

/* --- دسته‌بندی‌ها (نمایشی) --- */
.chips-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 30px;
  background: var(--paper-card);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ---------- کارت‌های دوره ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
  padding: 20px 0 20px;
}
.course-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.course-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(18,32,28,.1); }
.course-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, var(--teal), var(--ink));
}
.course-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.course-title { font-size: 16.5px; font-weight: 700; }
.course-meta { color: var(--text-muted); font-size: 13px; }
.course-price { font-weight: 800; color: var(--gold-dark); margin-top: auto; font-size: 15px; }
.course-price.free { color: var(--teal-dark); }

/* --- نظرات کاربران --- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.testimonial-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.testimonial-card p.quote { font-size: 14.5px; color: var(--text); margin: 0 0 18px; }
.testimonial-card .who { display: flex; align-items: center; gap: 10px; }
.testimonial-card .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.testimonial-card .name { font-size: 13.5px; font-weight: 700; }
.testimonial-card .role { font-size: 12px; color: var(--text-muted); }

/* --- بنر فراخوان اقدام --- */
.cta-banner {
  background: var(--ink);
  border-radius: 20px;
  padding: 50px 40px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-banner h2 { font-size: 26px; color: #fff; margin-bottom: 10px; }
.cta-banner p { color: #c6cec7; font-size: 15px; margin-bottom: 24px; }

/* ---------- فرم‌ها ---------- */
.form-wrap {
  max-width: 420px;
  margin: 60px auto;
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.form-wrap h2 { margin-top: 0; text-align: center; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-muted); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}
.field textarea { resize: vertical; min-height: 90px; }
.form-wrap .btn { width: 100%; margin-top: 6px; }
.form-footer { text-align: center; margin-top: 14px; font-size: 14px; color: var(--text-muted); }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert.error { background: #fdf0ee; color: var(--danger); border: 1px solid #f3cfc7; }
.alert.success { background: #eef8f2; color: var(--teal-dark); border: 1px solid #bfe4d3; }

/* ---------- صفحه دوره ---------- */
.course-detail-header {
  background: var(--ink);
  color: #fff;
  padding: 46px 0;
}
.course-detail-header h1 { margin: 0 0 10px; font-size: 26px; color: #fff; }
.course-detail-header .meta { color: #b9c2bc; font-size: 14px; }

.course-detail-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  padding: 30px 0 60px;
}
@media (max-width: 800px) { .course-detail-body { grid-template-columns: 1fr; } }

/* مقاله بلاگی که ادمین به این دوره وصل کرده (اختیاری)، زیر ویدیوها */
.course-article-section { border-top: 1px solid var(--border); background: var(--paper); }
.course-article-title { text-align: center; font-size: 24px; margin: 46px 0 0; }
.course-article-cover { margin-top: 26px; }
.course-article-body { padding-top: 26px; }

.video-list { background: var(--paper-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.video-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.video-item:last-child { border-bottom: none; }
.video-item:hover { background: #f3efe4; }
.video-item.active { background: rgba(226,166,61,.12); }
.video-item.locked { opacity: .55; cursor: not-allowed; }
.video-item .idx { color: var(--text-muted); font-size: 13px; width: 22px; }
.video-item .title { flex: 1; font-size: 14px; }
.video-item .lock-icon { color: var(--text-muted); }

.player-box { background: #000; border-radius: var(--radius); overflow: hidden; }
.player-box video { width: 100%; display: block; max-height: 480px; background: #000; }
.player-placeholder {
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  background: var(--ink);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.sidebar-box {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
}
.sidebar-box .price { font-size: 24px; font-weight: 800; color: var(--gold-dark); margin: 10px 0; }
.sidebar-box .btn { width: 100%; margin-top: 10px; }

/* ---------- فوتر ---------- */
footer.site-footer {
  background: var(--ink);
  color: #b9c2bc;
  padding: 54px 0 26px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 30px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { color: #fff; font-size: 14.5px; margin-bottom: 14px; }
.footer-grid p { font-size: 13.5px; line-height: 1.9; margin: 0; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-grid ul a { font-size: 13.5px; color: #b9c2bc; }
.footer-grid ul a:hover { color: var(--gold); }
.footer-bottom {
  padding-top: 22px;
  text-align: center;
  font-size: 12.5px;
  color: #8b968f;
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

table.admin-table { width: 100%; border-collapse: collapse; background: var(--paper-card); border-radius: var(--radius); overflow: hidden; }
table.admin-table th, table.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; text-align: right; }
table.admin-table th { background: #f3efe4; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag.green { background: #e3f4ea; color: var(--teal-dark); }
.tag.gray { background: #f0ece0; color: #6b6355; }
.tag.red { background: #fdeae7; color: var(--danger); }

.spinner { text-align: center; padding: 40px; color: var(--text-muted); }

/* ---------- پنل مدیریت ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: var(--ink);
  color: #e5e7eb;
  padding: 24px 16px;
  flex-shrink: 0;
}
.admin-sidebar .logo { color: #fff; font-weight: 800; margin-bottom: 26px; display: block; font-size: 17px; }
.admin-sidebar a, .admin-sidebar button {
  display: block;
  width: 100%;
  text-align: right;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  margin-bottom: 4px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.admin-sidebar a:hover, .admin-sidebar a.active, .admin-sidebar button:hover { background: var(--ink-soft); color: var(--gold); }
.admin-main { flex: 1; padding: 30px 34px; background: var(--paper); }
.admin-main h1 { margin-top: 0; font-size: 22px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--paper-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--gold-dark); }
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.card-panel { background: var(--paper-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 24px; }
.card-panel h3 { margin-top: 0; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(18,32,28,.55);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-box {
  background: #fff; border-radius: var(--radius); padding: 26px; width: 460px; max-width: 92vw;
  max-height: 90vh; overflow-y: auto;
}
.modal-box h3 { margin-top: 0; }
.row-actions { display: flex; gap: 8px; }
.progress-bar-wrap { width: 100%; height: 8px; background: #ece6d8; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progress-bar-fill { height: 100%; background: var(--gold); width: 0%; transition: width .2s; }

/* ---------- بلاگ ---------- */
.blog-hero {
  background: var(--ink);
  color: #fff;
  padding: 56px 0 40px;
  text-align: center;
}
.blog-hero h1 { color: #fff; font-size: 30px; margin-bottom: 8px; }
.blog-hero p { color: #b9c2bc; font-size: 15px; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 40px 0 70px;
}
.post-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(18,32,28,.1); }
.post-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, var(--gold), var(--ink));
}
.post-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-title { font-size: 16.5px; font-weight: 700; }
.post-excerpt { font-size: 13.5px; color: var(--text-muted); flex: 1; }
.post-meta { font-size: 12.5px; color: var(--text-muted); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }

/* صفحه یک مقاله */
.post-header {
  background: var(--ink);
  color: #fff;
  padding: 50px 0 36px;
}
.post-header .post-meta-top { font-size: 13px; color: var(--gold); margin-bottom: 12px; }
.post-header h1 { color: #fff; font-size: 30px; max-width: 46ch; }
.post-header .byline { color: #b9c2bc; font-size: 13.5px; margin-top: 12px; }

.post-cover {
  max-width: 860px;
  margin: -30px auto 0;
  padding: 0 20px;
}
.post-cover img { width: 100%; border-radius: var(--radius); display: block; box-shadow: 0 20px 40px rgba(18,32,28,.18); }

.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 50px 20px 80px;
  font-size: 16.5px;
  line-height: 2;
}
.article-body h2 { font-size: 24px; margin: 34px 0 14px; }
.article-body h3 { font-size: 19px; margin: 26px 0 10px; }
.article-body p { margin: 0 0 18px; }
.article-body img { max-width: 100%; border-radius: 10px; margin: 20px 0; display: block; }
.article-body video { max-width: 100%; border-radius: 10px; margin: 20px 0; display: block; background: #000; }
.article-body a { color: var(--teal-dark); text-decoration: underline; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-inline-start: 26px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-inline-start: 3px solid var(--gold);
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- بلوک پرامپت قابل کپی (هم توی مقاله منتشرشده، هم توی ادیتور) ---------- */
.article-body .prompt-block,
.editor-content .prompt-block {
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(18, 32, 28, .05);
}
.prompt-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: var(--ink);
}
.prompt-block-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}
.prompt-block-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prompt-copy-btn {
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  white-space: nowrap;
}
.prompt-copy-btn:hover { background: rgba(255, 255, 255, .18); }
.prompt-copy-btn:active { transform: scale(.96); }
.prompt-copy-btn.copied { background: var(--teal); border-color: var(--teal); }

/* دکمه «مستقیم عکس بساز» — فقط وقتی بلوک پرامپت به یک پرامپت پنل کاربران وصل شده باشد نمایش داده می‌شود */
.prompt-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: var(--gold);
  color: #1b1404;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, transform .1s ease;
}
.prompt-generate-btn:hover { background: var(--gold-dark); }
.prompt-generate-btn:active { transform: scale(.96); }

/* دکمه «اتصال به پرامپت پنل» فقط داخل ادیتور مدیریت دیده می‌شود، نه در مقاله منتشرشده */
.prompt-link-btn {
  display: none;
  align-items: center;
  gap: 4px;
  border: 1px dashed rgba(255, 255, 255, .35);
  background: transparent;
  color: #d8ddd6;
  font-family: inherit;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.editor-content .prompt-link-btn { display: inline-flex; }
.prompt-link-btn:hover { background: rgba(255, 255, 255, .1); }
.prompt-link-btn.linked { border-style: solid; border-color: var(--teal); color: var(--teal); background: rgba(47, 143, 126, .15); }
.article-body .prompt-block-text,
.editor-content .prompt-block-text {
  margin: 0;
  padding: 16px 18px;
  font-family: 'Courier New', Consolas, Menlo, monospace;
  font-size: 14.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: start;
}
/* توی مقاله منتشرشده، پرامپت‌های طولانی کل صفحه را نمی‌کشند پایین؛ فقط یک تکه کوچیک با اسکرول نمایش داده می‌شود */
.article-body .prompt-block-text {
  max-height: 190px;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.article-body .prompt-block-text::-webkit-scrollbar { width: 7px; }
.article-body .prompt-block-text::-webkit-scrollbar-track { background: transparent; }
.article-body .prompt-block-text::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }
.article-body .prompt-block-text::after {
  content: '';
  position: sticky;
  display: block;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  margin-top: -28px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, #fff);
}

/* ---------- ادیتور مقاله (پنل مدیریت) ---------- */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: #f3efe4;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}
.editor-toolbar button {
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.editor-toolbar button:hover { background: #e6dfd0; }
.editor-toolbar button.sep { width: 1px; background: var(--border); margin: 4px 6px; cursor: default; }
.editor-toolbar button.sep:hover { background: var(--border); }

.editor-content {
  min-height: 380px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  font-size: 15.5px;
  line-height: 1.95;
  background: #fff;
}
.editor-content:focus { outline: 2px solid var(--gold); outline-offset: -2px; }
.editor-content img { max-width: 100%; border-radius: 8px; margin: 10px 0; display: block; }
.editor-content video { max-width: 100%; border-radius: 8px; margin: 10px 0; display: block; background: #000; }
.editor-content h2 { font-size: 22px; margin: 16px 0 8px; }
.editor-content h3 { font-size: 18px; margin: 14px 0 8px; }
.editor-content blockquote { border-inline-start: 3px solid var(--gold); padding-inline-start: 14px; color: var(--text-muted); margin: 12px 0; }
.editor-content:empty:before {
  content: attr(data-placeholder);
  color: #9a9284;
}

/* ================= پرامپت‌های ساخت عکس با هوش مصنوعی ================= */

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  padding: 20px 0 20px;
}
.prompt-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.prompt-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(18,32,28,.1); }
.prompt-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: linear-gradient(135deg, var(--teal), var(--gold));
}
.prompt-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.prompt-title { font-size: 16.5px; font-weight: 700; }
.prompt-desc { color: var(--text-muted); font-size: 13.5px; flex: 1; }
.prompt-price { font-weight: 800; color: var(--gold-dark); margin-top: auto; font-size: 15px; }
.prompt-price.free { color: var(--teal-dark); }

.prompt-hero { padding: 54px 0 34px; text-align: center; background: var(--ink); color: #fff; }
.prompt-hero h1 { font-size: 28px; margin-bottom: 8px; color: #fff; }
.prompt-hero p { color: #b9c2bc; font-size: 15px; }

/* جزئیات یک پرامپت */
.prompt-detail-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 34px;
  padding: 40px 0 70px;
  align-items: start;
}
@media (max-width: 760px) {
  .prompt-detail-grid { grid-template-columns: 1fr; }
}
.prompt-detail-cover {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal), var(--gold));
  box-shadow: 0 16px 30px rgba(18,32,28,.12);
  display: block;
}
.prompt-detail-price { font-size: 22px; font-weight: 800; color: var(--gold-dark); margin: 14px 0 4px; }
.prompt-detail-price.free { color: var(--teal-dark); }

.upload-dropzone {
  display: block; /* <label> پیش‌فرض inline است؛ بدون این خط، border/padding/text-align درست کار نمی‌کنند */
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--paper-card);
}
.upload-dropzone:hover, .upload-dropzone.drag-over { border-color: var(--gold); background: rgba(226,166,61,.06); }
.upload-dropzone input[type=file] { display: none; }
.upload-dropzone .icon { font-size: 30px; margin-bottom: 8px; }
.upload-preview { max-width: 220px; max-height: 220px; border-radius: 10px; margin: 14px auto 0; display: block; box-shadow: 0 6px 16px rgba(18,32,28,.15); }

.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
@media (max-width: 480px) { .before-after { grid-template-columns: 1fr; } }
.before-after figure { margin: 0; }
.before-after img { width: 100%; border-radius: var(--radius); display: block; box-shadow: 0 10px 24px rgba(18,32,28,.12); }
.before-after figcaption { text-align: center; font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }

/* گالری/تاریخچه عکس‌های ساخته‌شده کاربر */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px 0 20px;
}
.gallery-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gallery-thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--ink); }
.gallery-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.gallery-title { font-size: 14.5px; font-weight: 700; }
.gallery-meta { font-size: 12px; color: var(--text-muted); }

/* بخش معرفی پرامپت‌های اخیر در صفحه اصلی (ترغیب ثبت‌نام کاربر مهمان) */
.prompt-teaser-card { position: relative; }
.prompt-teaser-card .lock-badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  background: rgba(18,32,28,.75);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
}
