/* ═══════════════════════════════════════════════════════════════
   articles.css — سیستم طراحی یکپارچه بخش مقالات
   فونت: Vazirmatn | پالت: Navy/Slate | RTL
   ═══════════════════════════════════════════════════════════════ */

/* ── توکن‌های رنگی ───────────────────────────────────────────── */
:root {
  --navy:       #1e3a5f;
  --navy-mid:   #1e3a5f;
  --navy-light: #eff6ff;
  --white:      #ffffff;
  --bg:         #f0f4f8;
  --surface:    #ffffff;

  --gray-100: #f8fafc;
  --gray-200: #f1f5f9;
  --gray-300: #e2e8f0;
  --gray-400: #cbd5e1;
  --gray-500: #94a3b8;
  --gray-600: #64748b;
  --gray-700: #475569;
  --gray-800: #334155;
  --text:     #1e293b;

  --green:        #15803d;
  --green-bg:     #f0fdf4;
  --green-border: #bbf7d0;
  --red:          #b91c1c;
  --red-bg:       #fef2f2;
  --red-border:   #fecaca;
  --yellow:       #92400e;
  --yellow-bg:    #fffbeb;
  --yellow-border:#fde68a;
  --purple:       #6d28d9;
  --purple-bg:    #f5f3ff;
  --blue:         #1d4ed8;
  --blue-bg:      #eff6ff;
  --blue-border:  #bfdbfe;

  --radius:    10px;
  --radius-lg: 16px;
  --radius-sm: 6px;

  --shadow-sm: 0 1px 4px rgba(30,58,95,0.06);
  --shadow-md: 0 4px 20px rgba(30,58,95,0.10);
  --shadow-lg: 0 8px 32px rgba(30,58,95,0.14);
}

/* ── ریست و پایه ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Vazir", sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
  direction: rtl;
}

/* ── navbar ──────────────────────────────────────────────────── */
.art-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.art-navbar-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.art-navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.art-navbar-user {
  font-size: 0.82rem;
  color: var(--gray-600);
}

/* ── دکمه بازگشت ─────────────────────────────────────────────── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: none;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: "Vazir", sans-serif;
  font-size: 0.82rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn-back:hover { background: var(--gray-200); border-color: var(--gray-400); }

/* ── container ───────────────────────────────────────────────── */
.art-container {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 16px 48px;
}

.art-container--wide {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 16px 48px;
}

/* ── page header (لیست) ──────────────────────────────────────── */
.art-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.art-page-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 3px;
}

.art-page-header .subtitle {
  font-size: 0.82rem;
  color: var(--gray-500);
}

/* ── کارت ────────────────────────────────────────────────────── */
.art-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  margin-bottom: 16px;
}

.art-card--form { padding: 32px; }

.art-card-header { margin-bottom: 24px; }
.art-card-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.art-card-header p {
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ── section title ───────────────────────────────────────────── */
.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 14px;
  margin-top: 4px;
}

.art-divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 24px 0;
}

/* ── فرم ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 7px;
}

.form-label-opt {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 400;
  margin-right: 4px;
}

.form-required { color: #ef4444; }

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-400);
  border-radius: var(--radius);
  font-family: "Vazir", sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--gray-100);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--navy-mid);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}

.form-input.is-error,
.form-textarea.is-error,
.form-select.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.10);
}

.form-input[dir="ltr"],
.form-textarea[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.8;
}

.field-error {
  font-size: 0.78rem;
  color: #ef4444;
  margin-top: 5px;
  display: none;
}
.field-error.show { display: block; }

.char-count {
  font-size: 0.72rem;
  color: var(--gray-500);
  text-align: left;
  margin-top: 4px;
}

/* ── دکمه‌ها ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: "Vazir", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; transform: none !important; }

.btn-primary {
  background: var(--navy-mid);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(37,99,235,0.18);
}
.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37,99,235,0.26);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-secondary:hover:not(:disabled) { background: var(--gray-300); }

.btn-success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.btn-success:hover:not(:disabled) { background: #dcfce7; }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}
.btn-danger:hover:not(:disabled) { background: #fee2e2; }

.btn-outline-logout {
  background: none;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-600);
  padding: 5px 14px;
  border-radius: var(--radius);
  font-family: "Vazir", sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-outline-logout:hover { background: var(--gray-200); }

.btn-full { width: 100%; padding: 13px 20px; font-size: 1rem; }

.btn-sm { padding: 6px 14px; font-size: 0.78rem; }

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ── spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: art-spin 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
}

.spinner-dark {
  border-color: var(--gray-300);
  border-top-color: var(--navy-mid);
}

.spinner-inline {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--navy-mid);
  border-radius: 50%;
  animation: art-spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes art-spin { to { transform: rotate(360deg); } }

/* ── alerts ──────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 18px;
  display: none;
  line-height: 1.7;
  border-width: 1px;
  border-style: solid;
}
.alert.show { display: block; }

.alert-error   { background: var(--red-bg);    border-color: var(--red-border);    color: var(--red); }
.alert-success { background: var(--green-bg);  border-color: var(--green-border);  color: var(--green); }
.alert-warning { background: var(--yellow-bg); border-color: var(--yellow-border); color: var(--yellow); }
.alert-info    { background: var(--blue-bg);   border-color: var(--blue-border);   color: var(--blue); }

/* ── hint box ────────────────────────────────────────────────── */
.hint-box {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 0.82rem;
  color: var(--yellow);
  line-height: 1.9;
  margin-bottom: 20px;
}

/* ── badge وضعیت ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-DRAFT        { background: var(--gray-200); color: var(--gray-600); }
.badge-SUBMITTED    { background: var(--blue-bg);  color: var(--blue); }
.badge-UNDER_REVIEW { background: var(--yellow-bg);color: var(--yellow); }
.badge-REVISION     { background: var(--purple-bg);color: var(--purple); }
.badge-ACCEPTED     { background: var(--green-bg); color: var(--green); }
.badge-REJECTED     { background: var(--red-bg);   color: var(--red); }
.badge-WITHDRAWN    { background: var(--gray-100); color: var(--gray-500); }

/* alias lowercase */
.badge-draft        { background: var(--gray-200); color: var(--gray-600); }
.badge-submitted    { background: var(--blue-bg);  color: var(--blue); }
.badge-under_review { background: var(--yellow-bg);color: var(--yellow); }
.badge-revision     { background: var(--purple-bg);color: var(--purple); }
.badge-accepted     { background: var(--green-bg); color: var(--green); }
.badge-rejected     { background: var(--red-bg);   color: var(--red); }
.badge-withdrawn    { background: var(--gray-100); color: var(--gray-500); }

/* ── loading ─────────────────────────────────────────────────── */
.loading-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* ── empty state ─────────────────────────────────────────────── */
.empty-state {
  background: var(--white);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
  color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 14px; }
.empty-state h3 { font-size: 1rem; color: var(--gray-700); margin-bottom: 6px; }
.empty-state p  { font-size: 0.84rem; }

/* ══════════════════════════════════════════════
   صفحه: لیست مقالات
   ══════════════════════════════════════════════ */

.article-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-300);
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-title    { font-size: 0.97rem; font-weight: 700; color: var(--navy); line-height: 1.5; }
.card-title-en { font-size: 0.78rem; color: var(--gray-500); margin-top: 3px; direction: ltr; text-align: right; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--gray-600);
  flex-wrap: wrap;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
  align-items: center;
}

.file-badge {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 0.72rem;
}

.no-file-badge {
  background: var(--red-bg);
  color: #e74c3c;
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 0.72rem;
}

.order-badge {
  background: #e0e7ff;
  color: #3730a3;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.warn-no-file {
  font-size: 0.75rem;
  color: #ef4444;
  align-self: center;
}

/* ══════════════════════════════════════════════
   صفحه: جزئیات مقاله
   ══════════════════════════════════════════════ */

.detail-title    { font-size: 1.2rem; font-weight: 700; color: var(--text); line-height: 1.5; margin-bottom: 6px; }
.detail-title-en { font-size: 0.82rem; color: var(--gray-500); direction: ltr; text-align: right; margin-bottom: 16px; }

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.status-id { font-size: 0.75rem; color: var(--gray-500); }

.meta-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--gray-600);
  margin-bottom: 18px;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 8px;
  margin-top: 20px;
}

.abstract-text {
  font-size: 0.88rem;
  line-height: 2;
  color: #374151;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 16px;
}

.keywords-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.keyword {
  background: var(--blue-bg);
  color: var(--navy);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 0.78rem;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
  margin-top: 16px;
}

/* فایل‌ها در جزئیات */
.file-item {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.file-item-name { font-size: 0.85rem; font-weight: 600; }
.file-item-meta { font-size: 0.72rem; color: var(--gray-500); margin-top: 2px; }
.no-files-msg {
  text-align: center;
  padding: 24px;
  color: var(--gray-500);
  font-size: 0.84rem;
}

/* timeline */
.timeline { position: relative; padding-right: 24px; }
.timeline::before {
  content: "";
  position: absolute;
  right: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--gray-300);
}
.timeline-item {
  position: relative;
  margin-bottom: 22px;
  padding-right: 20px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  right: -8px; top: 5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--navy-mid);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--navy-mid);
}
.timeline-event   { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.timeline-meta    { font-size: 0.72rem; color: var(--gray-500); }
.timeline-reason  {
  font-size: 0.78rem; color: var(--gray-600); margin-top: 6px;
  background: var(--gray-100); border-radius: var(--radius-sm); padding: 6px 10px;
}

/* ══════════════════════════════════════════════
   صفحه: ویرایش مقاله
   ══════════════════════════════════════════════ */

.status-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 8px;
}
.status-tag.draft    { background: var(--gray-200); color: var(--gray-600); }
.status-tag.revision { background: var(--purple-bg); color: var(--purple); }

/* ══════════════════════════════════════════════
   صفحه: آپلود فایل
   ══════════════════════════════════════════════ */

.dropzone {
  border: 2px dashed var(--gray-400);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--gray-100);
}
.dropzone:hover,
.dropzone.over { border-color: var(--navy-mid); background: #eef3fb; }
.dz-icon { font-size: 2.5rem; margin-bottom: 10px; }
.dz-text { font-size: 0.9rem; color: var(--gray-600); }
.dz-hint { font-size: 0.75rem; color: var(--gray-500); margin-top: 4px; }

.file-preview {
  display: none;
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.file-preview.show { display: flex; }

.file-info { display: flex; align-items: center; gap: 10px; }
.file-icon { font-size: 1.5rem; }
.file-name { font-size: 0.85rem; font-weight: 700; color: var(--navy); }
.file-size { font-size: 0.72rem; color: var(--gray-500); }
.btn-remove {
  background: none; border: none; cursor: pointer;
  color: #e74c3c; font-size: 1.2rem; padding: 4px;
  transition: color 0.2s;
}
.btn-remove:hover { color: #b91c1c; }

.progress-wrap {
  background: var(--gray-300);
  border-radius: 99px;
  height: 5px;
  margin-top: 10px;
  display: none;
  overflow: hidden;
}
.progress-wrap.show { display: block; }
.progress-bar {
  background: var(--navy-mid);
  height: 5px;
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
}

.current-file-item {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.current-file-name { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.current-file-meta { font-size: 0.72rem; color: var(--gray-500); margin-top: 2px; }
.btn-del-file {
  background: var(--red-bg);
  color: #c0392b;
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: "Vazir", sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-del-file:hover { background: #fad7d3; }

/* ══════════════════════════════════════════════
   ریسپانسیو موبایل
   ══════════════════════════════════════════════ */

@media (max-width: 640px) {
  .art-navbar { padding: 0 14px; }
  .art-navbar-brand { font-size: 0.9rem; }
  .art-navbar-user  { display: none; }

  .art-container,
  .art-container--wide { padding: 0 12px 40px; margin-top: 20px; }

  .art-card, .art-card--form { padding: 18px; }

  .art-page-header { flex-direction: column; align-items: flex-start; }
  .art-page-header .btn { width: 100%; justify-content: center; }

  .card-top { flex-direction: column; gap: 8px; }
  .card-top > div:last-child { align-self: flex-start; }

  .card-actions { gap: 6px; }
  .card-actions .btn-sm { padding: 7px 12px; }

  .detail-actions { gap: 8px; }
  .detail-actions .btn { flex: 1 1 calc(50% - 8px); justify-content: center; }

  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; }

  .meta-row { gap: 10px; }

  .timeline { padding-right: 18px; }

  .dropzone { padding: 28px 16px; }

  .btn-full { padding: 12px; font-size: 0.95rem; }
}

@media (max-width: 380px) {
  .art-card, .art-card--form { padding: 14px; }
  .article-card { padding: 14px 16px; }
  .detail-actions .btn { flex: 1 1 100%; }
}
