/*
 * App Negar — v13.2 enhancement layer
 * افزوده‌ها: فونت نستعلیق برای عنوان هیرو، انیمیشن تایپ، شمارش انیمیشنی آمار،
 * دکمه شناور پشتیبانی با آیکون متحرک، دکمه واتساپ، نشانگر آنلاین پروفایل و
 * دکمه‌ی آمار بازدید در پنل مدیریت.
 */

/* ============================================================
   1) فونت نستعلیق (Noto Nastaliq Urdu — OFL 1.1) برای عنوان هیرو
   ============================================================ */
@font-face {
  font-family: "Nastaliq Local";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/assets/fonts/nastaliq-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+2010-2011,U+FB50-FDFF,U+FE70-FEFC;
}
@font-face {
  font-family: "Nastaliq Local";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/assets/fonts/nastaliq-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+2010-2011,U+FB50-FDFF,U+FE70-FEFC;
}

/* ============================================================
   1) عنوان هیرو با فونت نستعلیق + انیمیشن تایپ
   ============================================================ */
.hero__title.is-nastaliq {
  font-family: "Nastaliq Local", "Vazirmatn Local", serif;
  /* عنوان اصلی صفحه عمداً جمع‌وجورتر شده تا فضای بالای صفحه را اشغال نکند. */
  font-size: clamp(17px, 2vw, 24px) !important;
  font-weight: 700;
  line-height: 1.9;
  letter-spacing: 0;
  max-width: 28ch;
  padding-block: .06em .18em;
}
@media (max-width: 900px) {
  .hero__title.is-nastaliq {
    font-size: clamp(16px, 4.5vw, 21px) !important;
    line-height: 1.85;
    max-width: 100%;
  }
}
.hero__title.is-nastaliq .grad-text {
  /* گرادیان روی متن نستعلیق هم زیبا بنشیند */
  padding-block: .06em;
}
/* خطِ در حال تایپ + مکان‌نمای چشمک‌زن */
.hero__title .type-line {
  display: inline-block;
  position: relative;
}
.hero__title .type-caret {
  display: inline-block;
  width: .5ch;
  margin-inline-start: .06em;
  color: var(--brand-2);
  font-weight: 700;
  animation: an-caret-blink 1s steps(1) infinite;
}
.hero__title.is-typing-done .type-caret { display: none; }
@keyframes an-caret-blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }

@media (prefers-reduced-motion: reduce) {
  .hero__title .type-caret { display: none; }
}

/* ============================================================
   4) آمار هیرو با شمارش انیمیشنی و ظاهر جذاب‌تر
   ============================================================ */
.hero__metrics li {
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.hero__metrics li::after {
  /* براقی نرم که هنگام ظاهر شدن روی کارت می‌لغزد */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}
.hero__metrics li.is-counted::after { animation: an-metric-shine .9s ease forwards; }
.hero__metrics li.is-counted { transform: translateY(-2px); }
.hero__metrics strong {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
@keyframes an-metric-shine {
  from { transform: translateX(-120%); }
  to   { transform: translateX(120%); }
}

/* ============================================================
   5) دکمه شناور پشتیبانی: بدون متن، آیکون متحرک جذاب
   ============================================================ */
.ai-widget__fab {
  min-width: 0 !important;
  width: 64px;
  height: 64px;
  padding: 0 !important;
  border-radius: 50% !important;
  position: relative;
  overflow: visible;
  isolation: isolate;
}
.ai-widget__fab .fab-icon {
  width: 30px;
  height: 30px;
  display: block;
  animation: an-fab-bob 2.4s ease-in-out infinite;
}
.ai-widget__fab .fab-icon path,
.ai-widget__fab .fab-icon circle { stroke: #fff; }
/* حلقه‌های پالس که از دکمه بیرون می‌زنند */
.ai-widget__fab::before,
.ai-widget__fab::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(35,104,179,.55);
  z-index: -1;
  animation: an-fab-pulse 2.6s ease-out infinite;
}
.ai-widget__fab::after { animation-delay: 1.3s; }
/* نقطه سبز «آنلاین» روی دکمه */
.ai-widget__fab .fab-live {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: an-fab-live 1.8s ease-out infinite;
}
.ai-widget__fab:hover .fab-icon { animation-duration: 1.1s; }
@keyframes an-fab-bob {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-4px) rotate(-6deg); }
}
@keyframes an-fab-pulse {
  0%   { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes an-fab-live {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-widget__fab .fab-icon,
  .ai-widget__fab::before,
  .ai-widget__fab::after,
  .ai-widget__fab .fab-live { animation: none; }
}

/* ============================================================
   2) نشانگر «آنلاین/لاگین» روی آیکون پروفایل هدر
   ============================================================ */
.topbar__user-avatar { position: relative; }
.topbar__user-btn .topbar__user-avatar::after {
  content: "";
  position: absolute;
  bottom: -1px;
  inset-inline-end: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

/* ============================================================
   6) دکمه واتساپ پشتیبانی (پنل کاربری)
   ============================================================ */
.support-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #25d366, #128c7e);
  box-shadow: 0 14px 30px -18px rgba(18,140,126,.9);
  transition: transform .18s ease, box-shadow .18s ease;
}
.support-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -18px rgba(18,140,126,1); }
.support-whatsapp svg { width: 20px; height: 20px; flex: 0 0 auto; }

/* ============================================================
   6) دکمه شناور «پشتیبانی مستقیم واتساپ» روی صفحه اصلی
   (وسط لبه‌ی صفحه، با آیکون واتساپ)
   ============================================================ */
.wa-float {
  position: fixed;
  inset-inline-end: 0;              /* در RTL یعنی سمت چپ صفحه */
  top: 50%;
  transform: translateY(-50%);
  z-index: 75;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 14px;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  border-start-start-radius: 16px;
  border-end-start-radius: 16px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 18px 40px -18px rgba(18,140,126,.95);
  font-weight: 800;
  font-size: 13px;
  isolation: isolate;
}
.wa-float__icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: block;
  animation: an-wa-bob 2.6s ease-in-out infinite;
}
.wa-float__label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width .35s ease, opacity .3s ease;
}
.wa-float:hover .wa-float__label,
.wa-float:focus-visible .wa-float__label { max-width: 190px; opacity: 1; }
.wa-float::before {
  content: "";
  position: absolute;
  inset-inline-start: 8px;
  top: 50%;
  width: 30px; height: 30px;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 2px solid rgba(37,211,102,.6);
  z-index: -1;
  animation: an-wa-pulse 2.4s ease-out infinite;
}
@keyframes an-wa-bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-3px)} }
@keyframes an-wa-pulse { 0%{transform:translateY(-50%) scale(1);opacity:.7} 100%{transform:translateY(-50%) scale(1.9);opacity:0} }
@media (max-width: 560px) {
  .wa-float { padding: 11px 13px; top: auto; bottom: 90px; transform: none; }
  .wa-float__icon { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-float__icon, .wa-float::before { animation: none; }
}

.floating-muted .wa-float { opacity: 0 !important; visibility: hidden !important; pointer-events: none; }

/* نقشه‌ی جابه‌جاشده به بالای نماد اعتماد */
.trust-map { margin: 0 auto 18px; }
.trust-map .footer__map iframe { width: 100%; height: 260px; border: 0; border-radius: 16px; display: block; }
.trust-map .footer__address { display: flex; align-items: center; gap: 6px; justify-content: center; margin-bottom: 10px; color: var(--ink-soft); font-size: 13.5px; }
.trust-map .footer__map-link { display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--brand-2); }

/* ============================================================
   3) دکمه‌ی «آمار بازدید» شاخص در هدر پنل مدیریت
   ============================================================ */
.admin-actions .btn--analytics {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border: 0;
}
.admin-actions .btn--analytics:hover { filter: brightness(1.06); }
.admin-actions .btn--analytics svg { stroke: #fff; }

/* ============================================================
   6) گفتگوی جدید با کاربر ثبت‌نام‌شده (پنل مدیریت)
   ============================================================ */
.admin-support__new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.admin-support__new:hover { filter: brightness(1.06); }

.an-user-picker {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8,20,40,.55);
  backdrop-filter: blur(3px);
}
.an-user-picker__card {
  width: min(520px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 40px 90px -40px rgba(8,20,40,.7);
  overflow: hidden;
}
.an-user-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.an-user-picker__head strong { font-size: 15px; }
.an-user-picker__close {
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: #f1f5f9; cursor: pointer; font-size: 18px; color: var(--ink-soft);
}
.an-user-picker__search {
  margin: 12px 16px 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
}
.an-user-picker__list {
  overflow: auto;
  padding: 4px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.an-user-picker__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.an-user-picker__item:hover { border-color: var(--brand-2); background: #f5f9ff; }
.an-user-picker__item strong { font-size: 13.5px; color: var(--ink); }
.an-user-picker__item small { font-size: 12px; color: var(--ink-mute); direction: ltr; text-align: right; }
.an-user-picker__empty { padding: 30px 10px; text-align: center; color: var(--ink-mute); font-size: 13px; }
