/* ============================================================
   شماره‌گرهای اعلان کنار آیتم‌های منو + مرتب‌سازی کارت پروژه
   (این فایل بعد از style.css لود می‌شود)
   ============================================================ */

/* ---------- شماره‌گر منوی کنار (سایدبار) ---------- */
.nav-link { position: relative; }

.nav-count,
.tab-count {
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
}

.nav-count.is-on,
.tab-count.is-on { display: inline-flex; }

.nav-count {
  margin-inline-start: auto;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #f04438, #d92d20);
  box-shadow: 0 2px 8px rgba(217, 45, 32, .38), inset 0 1px 0 rgba(255, 255, 255, .22);
}

/* روی آیتم فعال (زمینهٔ آبی) شماره‌گر سفید می‌شود تا خوانا بماند */
.nav-link.active .nav-count {
  color: #1d4ed8;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .28);
}

/* یک نبض کوتاه هنگام رسیدن پیام تازه */
.nav-count.is-bump { animation: navCountBump .5s cubic-bezier(.22, 1, .36, 1); }

@keyframes navCountBump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.32); }
  100% { transform: scale(1); }
}

/* حلقهٔ نرم پیرامون شماره‌گر تازه، فقط یک‌بار */
.nav-count.is-bump::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid rgba(240, 68, 56, .55);
  animation: navCountRing .7s ease-out forwards;
}
.nav-link.active .nav-count.is-bump::after { border-color: rgba(255, 255, 255, .7); }
.nav-count { position: relative; }

@keyframes navCountRing {
  0%   { opacity: .9; transform: scale(.7); }
  100% { opacity: 0;  transform: scale(1.6); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-count.is-bump { animation: none; }
  .nav-count.is-bump::after { display: none; }
}

/* ---------- شماره‌گر نوار پایین موبایل ---------- */
.tabbar a, .mobile-tab { position: relative; }

.tab-count {
  position: absolute;
  top: 5px;
  inset-inline-end: calc(50% - 20px);
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #f04438, #d92d20);
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- کارت پروژه: ردیف بالای صاف و هم‌تراز ---------- */
.project-card { display: block; text-decoration: none; color: inherit; }

.project-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 24px;
}

.project-card-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-head .seal { flex: 0 0 auto; }

.project-card-del {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: .15s ease;
}
.project-card-del:hover { background: var(--danger-bg); border-color: #eccfc9; color: var(--danger); }
.project-card-del:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }

.project-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 11.5px;
}
