/* ==========================================================================
   Dream Core — Fonts (لطفا فایل‌های Vazirmatn رو داخل static/fonts بذار)
   ========================================================================== */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   A Sade — فونت اصلی فارسی سایت
   نکته: این فونت فقط یک وزن (Regular) داره، پس وزن ۴۰۰ تا ۷۰۰ رو بهش می‌دیم
   و برای بولد از ضخیم‌کردن نوری (text-stroke) استفاده می‌کنیم، نه بولد مصنوعی مرورگر.
   unicode-range باعث میشه فقط فارسی/عربی با A Sade بیاد و حروف لاتین و اعداد
   انگلیسی (مثل Dream Core و مبلغ‌ها) با وزیرمتن نوشته بشن که تمیزتره.
   اگه می‌خوای لاتین هم A Sade باشه، کافیه خط unicode-range رو پاک کنی.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "A Sade";
  src: url("../fonts/ASade.woff") format("woff"),
       url("../fonts/ASade.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  /* این فونت ذاتاً کوچیک‌تر از وزیرمتن رندر میشه؛ با size-adjust هم‌اندازه‌ش می‌کنیم */
  size-adjust: 112%;
  /* متریک‌های اصلی فونت خیلی بازن و باعث فاصله‌ی زیاد بین خطوط می‌شدن */
  ascent-override: 92%;
  descent-override: 46%;
  line-gap-override: 0%;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200F,
                 U+FB50-FDFF, U+FE70-FEFF, U+00AB, U+00BB, U+061F, U+060C;
}

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg-0: #0a0710;
  --bg-1: #120c1c;
  --bg-2: #191225;
  --surface: #1c1428;
  --surface-hover: #241a33;
  --border: #2e2140;

  --pink: #ff6fb5;
  --pink-soft: #ff9dd0;
  --pink-deep: #d94f95;
  --white: #f7f3fb;
  --muted: #d2c9de;

  --success: #7ee0b0;
  --error: #ff8fa3;
  --info: #9fd3ff;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --shadow-glow: 0 0 60px rgba(255, 111, 181, 0.18);
  --transition: 0.35s cubic-bezier(.22,.7,.2,1);

  /* آیکن‌ها به‌صورت PNG مشکی هستن؛ توی دارک مود سفید میشن */
  --icon-filter: invert(1);
  --icon-filter-soft: invert(1) opacity(0.85);
}

[data-theme="light"] {
  --bg-0: #fdf5fa;
  --bg-1: #ffffff;
  --bg-2: #fdeef6;
  --surface: #ffffff;
  --surface-hover: #fff1f8;
  --border: #f3d6e8;

  --pink: #ff5fa8;
  --pink-soft: #d63e86;
  --pink-deep: #c23b7d;
  --white: #2a1830;
  --muted: #6b5872;

  --success: #24966b;
  --error: #d63a55;
  --info: #2e7fc4;

  --shadow-glow: 0 0 50px rgba(255, 95, 168, 0.12);

  /* توی لایت مود آیکن‌های مشکی همون‌جوری مشکی می‌مونن */
  --icon-filter: none;
  --icon-filter-soft: opacity(0.75);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* پایه‌ی اندازه‌ی متن‌ها؛ تقریباً همه‌چیز rem هست، پس با تغییر همین یک عدد
     کل سایت بزرگ یا کوچیک میشه. قبلاً پیش‌فرض ۱۶ بود. */
  font-size: 21px;
}
@media (max-width: 480px) {
  html { font-size: 19px; }  /* روی گوشی‌های کوچیک یه‌کم جمع‌وجورتر */
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, var(--bg-2) 0%, var(--bg-0) 55%) fixed;
  color: var(--white);
  font-family: "A Sade", "Vazirmatn", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.8;
  transition: background var(--transition), color var(--transition);
}

/* بولد مصنوعی مرورگر روی فونت فارسی زشت میشه؛ خاموشش می‌کنیم و
   به‌جاش تیترها رو با یه استروک نازک ضخیم می‌کنیم */
body { font-synthesis-weight: none; }
h1, h2, h3, h4, .brand, .nav-cta, .btn, strong, b {
  -webkit-text-stroke: 0.32px currentColor;
  paint-order: stroke fill;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button, input, textarea { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   Liminal floating background orbs
   ========================================================================== */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: float 18s ease-in-out infinite;
}
.orb-1 {
  width: 420px; height: 420px;
  background: var(--pink);
  top: -120px; right: -100px;
  animation-duration: 22s;
}
.orb-2 {
  width: 340px; height: 340px;
  background: #8a5cff;
  bottom: -100px; left: -80px;
  animation-duration: 26s;
  animation-delay: 2s;
}
.orb-3 {
  width: 260px; height: 260px;
  background: var(--pink-soft);
  top: 40%; left: 50%;
  animation-duration: 30s;
  animation-delay: 4s;
  opacity: 0.18;
}
[data-theme="light"] .orb { opacity: 0.16; filter: blur(90px); }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.08); }
  66% { transform: translate(-25px, 25px) scale(0.95); }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(10, 7, 16, 0.65);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
}
.brand-icon { width: 30px; height: 30px; filter: drop-shadow(0 0 10px var(--pink)); }

.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color var(--transition);
  position: relative;
}
.main-nav a:hover { color: var(--pink-soft); }
.main-nav a.nav-cta {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: var(--bg-0);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(255, 111, 181, 0.25);
  transition: transform var(--transition), box-shadow var(--transition);
}
.main-nav a.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 111, 181, 0.4); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle img { width: 26px; filter: var(--icon-filter); }

/* سوییچ دارک / لایت مود، بدون آیکن، فقط CSS */
.theme-toggle {
  --toggle-w: 56px;
  --toggle-h: 30px;
  width: var(--toggle-w);
  height: var(--toggle-h);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  cursor: pointer;
  padding: 3px;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.theme-toggle-knob {
  display: block;
  width: calc(var(--toggle-h) - 8px);
  height: calc(var(--toggle-h) - 8px);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  box-shadow: 0 0 12px rgba(255, 111, 181, 0.5);
  transform: translateX(0);
  transition: transform var(--transition), background var(--transition);
  position: relative;
}
/* حالت تاریک: نماد هلال ماه با ترکیب دو دایره */
.theme-toggle-knob::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--surface);
  transform: translate(35%, -20%) scale(0.72);
  transition: opacity var(--transition), background var(--transition);
  opacity: 1;
}
[data-theme="light"] .theme-toggle-knob {
  transform: translateX(calc(-1 * (var(--toggle-w) - var(--toggle-h))));
  background: linear-gradient(135deg, #ffd27a, #ff9d5c);
  box-shadow: 0 0 12px rgba(255, 180, 90, 0.6);
}
[data-theme="light"] .theme-toggle-knob::after {
  opacity: 0; /* توی لایت مود خورشید کامل بمونه، بدون هلال */
}

/* ==========================================================================
   Flash messages
   ========================================================================== */
.flash-wrap { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  animation: fadeInDown 0.5s ease;
  font-size: 0.9rem;
}
.flash-success { background: rgba(126, 224, 176, 0.1); color: var(--success); border-color: rgba(126,224,176,0.3); }
.flash-error { background: rgba(255, 143, 163, 0.1); color: var(--error); border-color: rgba(255,143,163,0.3); }
.flash-info { background: rgba(159, 211, 255, 0.1); color: var(--info); border-color: rgba(159,211,255,0.3); }
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Page transition
   ========================================================================== */
.page-fade { min-height: 60vh; animation: pageFade 0.6s ease; padding-bottom: 60px; }
@keyframes pageFade {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeUp 0.6s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { text-align: center; padding: 80px 20px 50px; }
.hero-title { font-size: clamp(1.8rem, 4vw, 3rem); margin: 0 0 16px; font-weight: 700; }
.glow-text {
  color: var(--pink-soft);
  text-shadow: 0 0 30px rgba(255, 111, 181, 0.6);
  animation: pulseGlow 3.5s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(255,111,181,0.4); }
  50% { text-shadow: 0 0 40px rgba(255,111,181,0.8); }
}
.hero-sub { color: var(--muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }
.page-hero { padding-bottom: 30px; }

/* ==========================================================================
   Home page hero — عکس تمام‌عرض با فید و انیمیشن
   ========================================================================== */
.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 86vh;
  min-height: 86svh;          /* روی موبایل نوار آدرس مرورگر رو حساب می‌کنه */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 20px 120px;
}

/* --- ظرف عکس؛ پارالاکس روی همین اعمال میشه --- */
.hero-media {
  position: absolute;
  inset: -12% 0;              /* بلندتر از خود هیرو تا موقع پارالاکس لبه خالی نمونه */
  z-index: -2;
  overflow: hidden;
  transform: translate3d(0, var(--parallax, 0px), 0);
  will-change: transform;
}

/* لایه‌ی بلور: کل عرض رو پر می‌کنه تا روی مانیتور پهن، دو طرف عکس خالی نمونه.
   عکس اصلی ۷۳۶ پیکسله؛ اگه کشش بدیم تار میشه، برای همین کشیده‌ی بلورشده
   می‌ذاریم پشتش و نسخه‌ی شارپ رو وسط نگه می‌داریم. */
.hero-media-blur {
  position: absolute;
  inset: -6%;
  background: url("../img/hero.jpg") center / cover no-repeat;
  background-image: image-set(url("../img/hero.webp") type("image/webp"),
                              url("../img/hero.jpg")  type("image/jpeg"));
  filter: blur(44px) saturate(1.25) brightness(0.75);
  transform: scale(1.1);
}

/* لایه‌ی اصلی: ارتفاع رو پر می‌کنه و عرضش خودکاره، یعنی تقریباً همیشه
   نزدیک رزولوشن اصلی عکس می‌مونه و شارپ می‌مونه */
.hero-media-img {
  position: absolute;
  inset: 0;
  background: url("../img/hero.jpg") center / auto 100% no-repeat;
  background-image: image-set(url("../img/hero.webp") type("image/webp"),
                              url("../img/hero.jpg")  type("image/jpeg"));
  animation: heroZoom 30s ease-in-out infinite alternate,
             heroFadeIn 1.6s ease both;
  will-change: transform;
}
@keyframes heroZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.09); }
}
@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* چشمک ملایم نور پنجره‌ها — دقیقاً روی راهروی وسط عکس.
   داخل لایه‌ی عکسه تا با زوم آروم هماهنگ جلو بیاد. */
.hero-lights {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 92%, rgba(255, 160, 225, 0.55), transparent 9%),
    radial-gradient(circle at 50% 78%, rgba(255, 140, 215, 0.45), transparent 7%),
    radial-gradient(circle at 50% 66%, rgba(255, 170, 230, 0.40), transparent 5%);
  animation: heroFlicker 4.5s ease-in-out infinite;
}
.hero-lights-2 {
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 150, 220, 0.40), transparent 4%),
    radial-gradient(circle at 50% 53%, rgba(255, 190, 240, 0.35), transparent 3%),
    radial-gradient(circle at 50% 85%, rgba(200, 140, 255, 0.35), transparent 6%);
  animation: heroFlicker 7.3s ease-in-out infinite reverse;
  animation-delay: -1.8s;
}
@keyframes heroFlicker {
  0%, 100% { opacity: 0.35; }
  35%      { opacity: 0.85; }
  55%      { opacity: 0.5; }
  75%      { opacity: 0.95; }
}

/* پرده‌ی تیره: هم متن خونا میشه، هم پایین عکس نرم توی پس‌زمینه‌ی سایت محو میشه */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(10, 7, 16, 0.55) 100%),
    linear-gradient(to bottom,
      rgba(10, 7, 16, 0.72) 0%,
      rgba(10, 7, 16, 0.32) 30%,
      rgba(10, 7, 16, 0.55) 62%,
      rgba(10, 7, 16, 0.92) 88%,
      var(--bg-0) 100%);
}

/* حالت روشن: عکس کم‌رنگ‌تر و روشن‌تر، پرده هم سفید میشه */
[data-theme="light"] .hero-media-img,
[data-theme="light"] .hero-media-blur {
  filter: brightness(1.35) saturate(0.7) contrast(0.92);
  opacity: 0.5;
}
[data-theme="light"] .hero-media-blur { filter: blur(44px) brightness(1.35) saturate(0.7); }
[data-theme="light"] .hero-lights { opacity: 0.4; }
[data-theme="light"] .hero-scrim {
  background:
    radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(253, 245, 250, 0.6) 100%),
    linear-gradient(to bottom,
      rgba(253, 245, 250, 0.55) 0%,
      rgba(253, 245, 250, 0.25) 30%,
      rgba(253, 245, 250, 0.6) 65%,
      rgba(253, 245, 250, 0.94) 88%,
      var(--bg-0) 100%);
}

/* --- متن روی عکس --- */
.home-hero-inner { position: relative; z-index: 1; }
.home-hero-inner > * {
  animation: heroRise 0.9s cubic-bezier(.22,.7,.2,1) both;
}
.home-hero-inner > *:nth-child(1) { animation-delay: 0.25s; }
.home-hero-inner > *:nth-child(2) { animation-delay: 0.45s; }
.home-hero-inner > *:nth-child(3) { animation-delay: 0.62s; }
.home-hero-inner > *:nth-child(4) { animation-delay: 0.8s; }
@keyframes heroRise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand-title {
  font-size: clamp(2.6rem, 7.5vw, 4.8rem);
  font-weight: 700;
  margin: 0 0 22px;
  letter-spacing: 1px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .brand-title { text-shadow: 0 2px 20px rgba(255, 255, 255, 0.7); }

.home-hero-tagline {
  font-size: clamp(1.08rem, 2.2vw, 1.3rem);
  color: var(--white);
  opacity: 1;
  max-width: 620px;
  margin: 0 auto 18px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}
.home-hero-desc {
  font-size: 1.08rem;
  color: var(--white);
  opacity: 0.96;
  max-width: 660px;
  margin: 0 auto 34px;
  line-height: 2;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .home-hero-tagline,
[data-theme="light"] .home-hero-desc { text-shadow: none; }

.home-hero-btn { font-size: 1.08rem; padding: 16px 38px; }

/* فلش کوچیک پایین هیرو */
.hero-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: 26px;
  height: 42px;
  border: 2px solid var(--muted);
  border-radius: 999px;
  opacity: 0.55;
  animation: heroFadeIn 1s ease 1.4s both;
}
.hero-cue::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 999px;
  background: var(--pink-soft);
  animation: cueDot 1.8s ease-in-out infinite;
}
@keyframes cueDot {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(14px); opacity: 0.2; }
}

/* --- موبایل --- */
@media (max-width: 720px) {
  .home-hero {
    min-height: 78vh;
    min-height: 78svh;
    padding: 70px 18px 90px;
  }
  /* بلور سنگین روی موبایل گرونه؛ سبک‌ترش می‌کنیم */
  .hero-media-blur { filter: blur(28px) saturate(1.2) brightness(0.75); }
  .hero-cue { display: none; }
}

/* کاربری که انیمیشن کم می‌خواد: عکس ثابت، بدون زوم و چشمک و پارالاکس */
@media (prefers-reduced-motion: reduce) {
  .hero-media { transform: none !important; }
  .hero-media-img { animation: none; }
  .hero-lights { animation: none; opacity: 0.5; }
  .home-hero-inner > * { animation: none; }
  .hero-cue::after { animation: none; }
}

/* ==========================================================================
   Home page — سه کادر اصلی
   ========================================================================== */

/* تیتر کوچیک بالای کادرها */
.home-sections-head {
  text-align: center;
  margin: 10px 0 34px;
}
.home-sections-head h2 {
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  margin: 0 0 8px;
}
.home-sections-head p {
  color: var(--muted);
  margin: 0;
  font-size: 1.06rem;
}

.home-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  padding: 10px 0 90px;
  scroll-margin-top: 30px;
}

/* --- لایه‌ی بیرونی: فقط مسئول ظاهر شدن پله‌ای موقع اسکرول ---
   نکته‌ی مهم: حالت پیش‌فرض «دیده شدن» هست، نه مخفی بودن.
   فقط وقتی کلاس js-reveal روی <html> باشه (یعنی جاوااسکریپت واقعاً اجرا شده)
   کارت‌ها اول مخفی می‌شن تا با اسکرول ظاهر بشن. اینجوری اگه JS لود نشه یا
   نسخه‌ی قدیمیش از کش بیاد، کارت‌ها ناپدید نمی‌شن. */
.home-card {
  opacity: 1;
  transform: none;
  transition: opacity 0.75s cubic-bezier(.22,.7,.2,1),
              transform 0.75s cubic-bezier(.22,.7,.2,1);
  transition-delay: var(--reveal-delay, 0s);
}
.js-reveal .home-card:not(.is-visible) {
  opacity: 0;
  transform: translateY(38px) scale(0.97);
}

/* --- لایه‌ی میانی: حاشیه‌ی نئونی چرخان --- */
.home-feature {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 1.5px;                 /* ضخامت حاشیه‌ی نئونی */
  background: var(--border);
  height: 100%;
  isolation: isolate;
  overflow: hidden;              /* نور چرخان رو داخل گوشه‌های گرد نگه می‌داره */
  transition: transform 0.5s cubic-bezier(.22,.7,.2,1),
              box-shadow var(--transition);
  will-change: transform;

  /* چرخش سه‌بعدی: مقدار --rx و --ry رو جاوااسکریپت با حرکت موس ست می‌کنه */
  transform:
    perspective(1000px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translateY(var(--ty, 0px))
    scale(var(--sc, 1));
}
/* موقعی که موس روی کارته، حرکت باید بلافاصله دنبال موس بیاد، نه با تاخیر */
.home-feature.is-tilting { transition: transform 0.08s linear, box-shadow var(--transition); }
@media (hover: hover) and (pointer: fine) {
  .home-feature:hover { --ty: -6px; --sc: 1.015; }
}

/* نور چرخان دور کادر */
.home-feature::before {
  content: "";
  position: absolute;
  inset: -60%;
  z-index: -2;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--pink) 40deg,
    var(--pink-soft) 80deg,
    transparent 150deg,
    transparent 210deg,
    #8a5cff 250deg,
    var(--pink) 290deg,
    transparent 360deg
  );
  animation: neonSpin 7s linear infinite;
  animation-delay: var(--neon-delay, 0s);
  opacity: 0.55;
  transition: opacity var(--transition);
}
.home-feature:hover::before { opacity: 1; }
.home-feature:hover {
  box-shadow: 0 18px 45px -20px rgba(255, 111, 181, 0.75),
              0 0 60px -25px rgba(138, 92, 255, 0.6);
}

@keyframes neonSpin {
  to { transform: rotate(1turn); }
}

/* --- لایه‌ی عکس پس‌زمینه‌ی کارت --- */
.home-feature-bg {
  position: absolute;
  inset: 1.5px;                                  /* تا حاشیه‌ی نئونی رو نپوشونه */
  z-index: 0;
  border-radius: calc(var(--radius-lg) - 1.5px);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.88;
  filter: saturate(1.08) brightness(0.95);
  /* --bgx و --bgy رو جاوااسکریپت با حرکت موس ست می‌کنه */
  transform: scale(1.06) translate(var(--bgx, 0px), var(--bgy, 0px));
  transition: transform 0.7s cubic-bezier(.22,.7,.2,1),
              opacity 0.5s ease,
              filter 0.5s ease;
  will-change: transform;
}
.card-bg-courses {
  background-image: url("../img/cards/courses.jpg");
  background-image: image-set(url("../img/cards/courses.webp") type("image/webp"),
                              url("../img/cards/courses.jpg")  type("image/jpeg"));
}
.card-bg-consulting {
  background-image: url("../img/cards/consulting.jpg?v=2");
  background-image: image-set(url("../img/cards/consulting.webp?v=2") type("image/webp"),
                              url("../img/cards/consulting.jpg?v=2")  type("image/jpeg"));
}
.card-bg-articles {
  background-image: url("../img/cards/articles.jpg");
  background-image: image-set(url("../img/cards/articles.webp") type("image/webp"),
                              url("../img/cards/articles.jpg")  type("image/jpeg"));
}

/* موقع هاور: واضح‌تر، روشن‌تر و کمی زوم */
@media (hover: hover) and (pointer: fine) {
  .home-feature:hover .home-feature-bg {
    opacity: 1;
    filter: saturate(1.18) brightness(1.05);
    transform: scale(1.13) translate(var(--bgx, 0px), var(--bgy, 0px));
  }
}

[data-theme="light"] .home-feature-bg {
  opacity: 0.8;
  filter: saturate(0.95) brightness(1.12);
}
[data-theme="light"] .home-feature:hover .home-feature-bg {
  opacity: 0.95;
  filter: saturate(1) brightness(1.05);
}

/* --- لایه‌ی داخلی: خود محتوا ---
   پس‌زمینه‌ش دیگه رنگ پر نیست، یه پرده‌ی نیمه‌شفافه تا عکس زیرش دیده بشه
   ولی متن هم خونا بمونه */
.home-feature-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  border-radius: calc(var(--radius-lg) - 1.5px);
  background: linear-gradient(180deg,
      rgba(10, 6, 16, 0.10) 0%,
      rgba(10, 6, 16, 0.28) 32%,
      rgba(10, 6, 16, 0.66) 62%,
      rgba(10, 6, 16, 0.88) 100%);
  padding: 40px 28px 34px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: background var(--transition);
}
.home-feature:hover .home-feature-inner {
  background: linear-gradient(180deg,
      rgba(10, 6, 16, 0.04) 0%,
      rgba(10, 6, 16, 0.2) 32%,
      rgba(10, 6, 16, 0.58) 62%,
      rgba(10, 6, 16, 0.84) 100%);
}
[data-theme="light"] .home-feature-inner {
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0.42) 32%,
      rgba(255, 255, 255, 0.80) 60%,
      rgba(255, 255, 255, 0.94) 100%);
}
[data-theme="light"] .home-feature:hover .home-feature-inner {
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.10) 0%,
      rgba(255, 255, 255, 0.34) 32%,
      rgba(255, 255, 255, 0.74) 60%,
      rgba(255, 255, 255, 0.92) 100%);
}

/* متن روی عکس یه سایه‌ی نرم می‌گیره تا هرجای عکس که افتاد خونا بمونه */
.home-feature-text h2,
.home-feature-text p { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55); }
[data-theme="light"] .home-feature-text h2,
[data-theme="light"] .home-feature-text p { text-shadow: 0 1px 8px rgba(255, 255, 255, 0.9); }
[data-theme="light"] .home-feature-icon {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 240, 248, 0.75));
  border-color: rgba(214, 62, 134, 0.3);
}
[data-theme="light"] .home-feature-index { text-shadow: 0 2px 10px rgba(255, 255, 255, 0.9); }

/* شماره‌ی کم‌رنگ گوشه‌ی کادر */
.home-feature-index {
  position: absolute;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  top: 14px;
  left: 20px;
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--pink);
  opacity: 0.10;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}
.home-feature:hover .home-feature-index {
  opacity: 0.2;
  transform: translateY(-4px);
}

/* آیکن بالای کارت */
.home-feature-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 0 20px;
  background: linear-gradient(135deg, rgba(20, 12, 30, 0.72), rgba(30, 18, 45, 0.6));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 157, 208, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.5s cubic-bezier(.22,.7,.2,1), box-shadow var(--transition);
}
.home-feature-icon img {
  width: 30px;
  height: 30px;
  filter: var(--icon-filter);
  transition: transform 0.5s cubic-bezier(.22,.7,.2,1);
}
.home-feature:hover .home-feature-icon {
  box-shadow: 0 0 26px rgba(255, 111, 181, 0.45);
}
.home-feature:hover .home-feature-icon img { transform: scale(1.12) rotate(-6deg); }

.home-feature-text {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.home-feature-text h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
}
.home-feature-text p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 26px;
  line-height: 2;
  flex: 1;           /* باعث میشه دکمه‌ی هر سه کارت هم‌تراز پایین بشینه */
}
.home-feature .btn { width: 100%; justify-content: center; }

/* اگه کاربر انیمیشن کم می‌خواد، همه‌چی آروم و ساکن بشه */
@media (prefers-reduced-motion: reduce) {
  .js-reveal .home-card:not(.is-visible) { opacity: 1; transform: none; }
  .home-card { transition: none; }
  .home-feature::before { animation: none; }
  .home-feature-bg { transition: none; }
  .home-feature, .home-feature-icon, .home-feature-icon img { transition: none; }
}

/* ---------- موبایل و تبلت ---------- */
@media (max-width: 980px) {
  .home-sections { grid-template-columns: 1fr; gap: 20px; perspective: none; }
  .home-feature-text p { flex: 0; }
  .home-feature-inner { padding: 32px 22px 28px; }
  .home-feature-index { font-size: 2.8rem; }
}

/* روی صفحه‌های لمسی، افکت هاور و نور چرخان سبک‌تر میشه (باتری و روانی اسکرول) */
@media (hover: none) {
  /* چون هاوری وجود نداره، عکس رو از همون اول کمی واضح‌تر نشون می‌دیم */
  .home-feature-bg { opacity: 0.92; transform: scale(1.04); }
  [data-theme="light"] .home-feature-bg { opacity: 0.85; }
  .home-feature::before { animation-duration: 12s; opacity: 0.45; }
  .home-feature:hover { box-shadow: none; }
}

/* ==========================================================================
   Reservation placeholder
   ========================================================================== */
.reservation-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 60px;
}

/* ==========================================================================
   Course grid / cards
   ========================================================================== */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 20px 0 60px;
}
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.course-card:hover {
  transform: translateY(-6px);
  border-color: var(--pink);
  box-shadow: var(--shadow-glow);
}
.course-cover { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.course-card:hover .course-cover img { transform: scale(1.06); }
.course-cover-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #241a33, #3a2350);
}
.course-cover-placeholder.large { aspect-ratio: 16/9; border-radius: var(--radius-md); }

.badge {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-free { background: var(--pink); color: var(--bg-0); }
.badge-owned {
  display: inline-block;
  background: rgba(126, 224, 176, 0.15);
  color: var(--success);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-top: 10px;
}

.course-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.course-body h3 { margin: 0; font-size: 1.05rem; }
.course-desc { color: var(--muted); font-size: 0.85rem; margin: 0; flex: 1; }
.course-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.85rem; color: var(--muted); margin-top: 6px;
}
.course-meta img { width: 15px; display: inline-block; vertical-align: middle; margin-left: 4px; filter: var(--icon-filter-soft); }
.course-price { color: var(--pink-soft); font-weight: 700; }
.course-price.big { font-size: 1.3rem; }

.empty-state { color: var(--muted); text-align: center; padding: 40px 0; grid-column: 1 / -1; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn img { width: 18px; filter: var(--icon-filter); }
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: var(--bg-0);
  box-shadow: 0 10px 30px rgba(255, 111, 181, 0.25);
}
.btn-primary img { filter: none; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(255, 111, 181, 0.4); }
.btn-secondary {
  background: var(--surface-hover);
  color: var(--white);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--pink); }
.btn-telegram, .btn-bale {
  background: var(--surface); color: var(--white); border: 1px solid var(--border);
}
.btn-telegram:hover, .btn-bale:hover { border-color: var(--info); transform: translateY(-3px); }
.btn-telegram img, .btn-bale img { filter: none; }

/* ==========================================================================
   Auth forms
   ========================================================================== */
.auth-wrap { display: flex; justify-content: center; padding: 60px 20px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-glow);
}
.auth-card h2 { margin: 0 0 6px; text-align: center; }
.auth-card label { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.auth-card input {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--white);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.auth-card input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 111, 181, 0.15);
}
.auth-switch { text-align: center; color: var(--muted); font-size: 0.85rem; }
.auth-switch a { color: var(--pink-soft); font-weight: 700; }
.inline-icon { width: 22px; vertical-align: middle; margin-left: 8px; }

/* ==========================================================================
   Course detail
   ========================================================================== */
.course-detail {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  padding: 50px 20px;
  align-items: start;
}
.course-detail-cover img, .course-detail-cover .course-cover-placeholder {
  border-radius: var(--radius-lg);
  width: 100%;
}
.course-detail-info h1 { margin-top: 0; }
.course-detail-desc { color: var(--muted); }
.course-detail-meta { display: flex; gap: 20px; align-items: center; margin: 16px 0; color: var(--muted); }
.parts-title { margin-top: 40px; }
.parts-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.parts-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), transform var(--transition);
}
.parts-list li:hover { border-color: var(--pink); transform: translateX(-4px); }
.parts-list a, .part-locked-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  color: var(--white);
}
.parts-list li.locked { opacity: 0.55; }
.parts-list img { width: 18px; filter: var(--icon-filter); }
.parts-list.mini li.active { border-color: var(--pink); background: var(--surface-hover); }

/* ==========================================================================
   Watch page
   ========================================================================== */
.watch-wrap { padding: 40px 20px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 20px; }
.back-link img { width: 16px; filter: var(--icon-filter); }
.watch-course-name { color: var(--muted); margin-top: -10px; }
.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-glow);
  margin: 24px 0 40px;
}
.player-frame iframe { width: 100%; height: 100%; border: none; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash-quick-links { display: flex; gap: 16px; flex-wrap: wrap; margin: 24px 0 10px; }
.quick-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  transition: transform var(--transition), border-color var(--transition);
}
.quick-card:hover { transform: translateY(-4px); border-color: var(--pink); }
.quick-card img { width: 24px; filter: var(--icon-filter); }

/* ==========================================================================
   Wallet
   ========================================================================== */
.wallet-balance-card {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, var(--surface), var(--surface-hover));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin: 24px 0;
  box-shadow: var(--shadow-glow);
}
.wallet-balance-card img { width: 36px; filter: var(--icon-filter); }
.wallet-balance-num { font-size: 1.6rem; font-weight: 700; margin: 0; color: var(--pink-soft); }
.wallet-balance-label { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }

.charge-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 30px;
}
.charge-box p { color: var(--muted); }
.charge-actions { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }

.wallet-log-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.wallet-log-list li {
  display: flex; justify-content: space-between; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.amount-plus { color: var(--success); font-weight: 700; }
.amount-minus { color: var(--error); font-weight: 700; }
.log-reason { color: var(--muted); flex: 1; text-align: center; }
.log-date { color: var(--muted); }

/* ==========================================================================
   Admin layout
   ========================================================================== */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; gap: 30px; padding: 40px 20px; }
.admin-sidebar {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  height: fit-content;
  position: sticky;
  top: 90px;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}
.admin-sidebar a:hover { background: var(--surface-hover); color: var(--pink-soft); }
.admin-sidebar img { width: 18px; filter: var(--icon-filter-soft); }
.admin-content { min-width: 0; }

.admin-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

.admin-stats { display: flex; gap: 16px; flex-wrap: wrap; margin: 20px 0 30px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 22px 30px; text-align: center; min-width: 140px;
}
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--pink-soft); margin: 0; }
.stat-label { color: var(--muted); margin: 6px 0 0; font-size: 0.85rem; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.admin-table th, .admin-table td {
  text-align: right; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.admin-table th { color: var(--muted); font-weight: 600; }
.admin-actions { display: flex; gap: 14px; align-items: center; }
.admin-actions a, .admin-actions button {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--pink-soft); cursor: pointer; font-size: 0.85rem;
}
.admin-actions img { width: 15px; filter: var(--icon-filter-soft); }

.admin-form { display: flex; flex-direction: column; gap: 16px; max-width: 520px; margin-top: 16px; }
.admin-form label { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.admin-form input, .admin-form textarea {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; color: var(--white); font-size: 0.95rem;
}
.admin-form input:focus, .admin-form textarea:focus { outline: none; border-color: var(--pink); }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 10px !important; }
.inline-form { max-width: 100%; }
.wallet-action-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.admin-parts-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-width: 640px; }
.admin-part-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.part-edit-form { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.part-index { color: var(--muted); font-size: 0.85rem; flex-shrink: 0; }
.part-edit-form input {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; color: var(--white); font-size: 0.85rem; min-width: 0;
}
.part-edit-form input[name="part_title"] { flex: 1; min-width: 120px; }
.part-edit-form input[name="aparat_url"] { flex: 2; min-width: 160px; }
.part-save-btn, .part-delete-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; color: var(--pink-soft); font-size: 0.8rem;
  padding: 8px 10px; border-radius: var(--radius-sm); flex-shrink: 0;
  transition: background var(--transition);
}
.part-save-btn:hover, .part-delete-btn:hover { background: var(--surface-hover); }
.part-save-btn img, .part-delete-btn img { width: 15px; filter: var(--icon-filter-soft); }

.hint-text { color: var(--muted); font-size: 0.85rem; margin-top: -8px; }
.badge-free-inline {
  margin-inline-start: auto;
  color: var(--muted); font-size: 0.8rem;
  background: var(--surface-hover); padding: 6px 14px; border-radius: 999px;
}

.admin-dialog {
  background: var(--surface); color: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 26px; width: 90%; max-width: 380px;
}
.admin-dialog::backdrop { background: rgba(0,0,0,0.6); }
.admin-dialog input {
  width: 100%; background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; color: var(--white); margin-top: 10px;
}
.dialog-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ==========================================================================
   Articles
   ========================================================================== */
.category-filter {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 30px;
}
.category-filter a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  transition: border-color var(--transition), color var(--transition);
}
.category-filter a img { width: 13px; filter: var(--icon-filter-soft); }
.category-filter a:hover, .category-filter a.active { border-color: var(--pink); color: var(--pink-soft); }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 20px 0 60px;
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.article-card:hover { transform: translateY(-6px); border-color: var(--pink); box-shadow: var(--shadow-glow); }
.article-cover { aspect-ratio: 16/10; overflow: hidden; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.article-card:hover .article-cover img { transform: scale(1.06); }
.article-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.article-body h3 { margin: 0; font-size: 1.05rem; }
.article-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.8rem; }
.article-meta img { width: 14px; filter: var(--icon-filter-soft); }

.article-detail { padding: 50px 20px; max-width: 780px; margin: 0 auto; }
.article-detail-cover { border-radius: var(--radius-lg); overflow: hidden; margin: 20px 0 30px; }
.article-detail-cover img { width: 100%; }
.article-detail h1 { margin-top: 0; }
.article-detail-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; margin-bottom: 30px; flex-wrap: wrap; }
.article-detail-meta img { width: 14px; filter: var(--icon-filter-soft); }
.category-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; font-size: 0.78rem;
}
.category-chip img { width: 12px; filter: var(--icon-filter-soft); }

.article-content { font-size: 1.02rem; color: var(--white); }
.article-content p { margin: 0 0 20px; color: var(--muted); }
.article-content h3 { margin: 30px 0 14px; color: var(--pink-soft); }
.article-content strong { color: var(--white); font-weight: 700; }
.article-content em { color: var(--pink-soft); font-style: italic; }

/* ادیتور ساده مقاله در پنل ادمین */
.editor-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 6px;
}
.editor-toolbar button {
  background: var(--surface-hover); border: 1px solid var(--border); color: var(--white);
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.82rem;
  transition: border-color var(--transition);
}
.editor-toolbar button:hover { border-color: var(--pink); }
.editor-hint { color: var(--muted); font-size: 0.78rem; }
.article-form textarea { resize: vertical; font-family: "Vazirmatn", sans-serif; line-height: 1.9; }
.current-cover-preview { width: 160px; border-radius: var(--radius-sm); margin-top: -8px; border: 1px solid var(--border); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-links-articles { margin-bottom: 4px; }
.footer-links-articles a { font-weight: 700; }

/* --- نوار مرتب‌سازی --- */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.sort-bar-admin { margin-bottom: 16px; }
.sort-label { color: var(--muted); font-size: 0.85rem; }
.sort-btn {
  position: relative;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  transition: color var(--transition), border-color var(--transition),
              background var(--transition), transform var(--transition);
}
.sort-btn:hover { color: var(--white); border-color: var(--pink); transform: translateY(-2px); }
.sort-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  border-color: transparent;
  color: var(--bg-0);
  box-shadow: 0 6px 18px rgba(255, 111, 181, 0.28);
}

/* ستون بازدید توی پنل ادمین */
.views-cell { font-variant-numeric: tabular-nums; color: var(--muted); }
.views-total { color: var(--pink-soft); font-weight: 700; }

.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-links a {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.85rem;
  transition: color var(--transition), transform var(--transition);
}
.footer-links a:hover { color: var(--pink-soft); transform: translateY(-2px); }
.footer-links-articles a img { transition: filter var(--transition); }
.footer-links-articles a:hover img { filter: var(--icon-filter); }
/* آیکن‌های فوتر مثل بقیه‌ی سایت با تم عوض می‌شن (سیاه در لایت، سفید در دارک) */
.footer-links img { width: 16px; filter: var(--icon-filter-soft); }

/* استثنا: لوگوی تلگرام و بله رنگ اختصاصی خودشون رو دارن (آبی و سبز)
   و نباید وارونه بشن، پس فیلتر روشون اعمال نمی‌شه */
.footer-links a[href*="t.me"] img,
.footer-links a[href*="ble.ir"] img { filter: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .course-detail { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; flex-direction: row; overflow-x: auto; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 74px; left: 0; right: 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 16px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .hero { padding: 50px 16px 30px; }
  .courses-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .auth-card { padding: 28px 22px; }
  .home-hero { padding: 60px 16px 40px; }
}


/* ==========================================================================
   پنل ادمین — آمار بازدید
   ========================================================================== */
.stats-clock {
  color: var(--muted);
  font-size: 0.85rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.stats-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  overflow: hidden;
  /* ظاهر شدن پله‌ای، مثل کارت‌های صفحه‌ی اصلی */
  opacity: 0;
  transform: translateY(20px);
  animation: statRise 0.6s cubic-bezier(.22,.7,.2,1) var(--stat-delay, 0s) both;
}
@keyframes statRise {
  to { opacity: 1; transform: translateY(0); }
}
.stats-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), #8a5cff, transparent);
}
.stats-card:hover { border-color: var(--pink); }

.stats-card-head { margin-bottom: 18px; }
.stats-card-head h2 { margin: 0 0 4px; font-size: 1.15rem; }
.stats-hint { color: var(--muted); font-size: 0.78rem; }

.stats-numbers {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
}
.stats-num {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  text-align: center;
}
.stats-num-main {
  background: linear-gradient(135deg, rgba(255,111,181,0.16), rgba(138,92,255,0.10));
}
.stats-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--pink-soft);
  font-variant-numeric: tabular-nums;
}
.stats-num-main .stats-value { color: var(--pink); }
.stats-label { font-size: 0.76rem; color: var(--muted); }

.stats-breakdown {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.stats-breakdown b { color: var(--white); font-weight: 700; }
.stats-bots { opacity: 0.65; }

.stats-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.stats-note p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.95;
}
.stats-note p:last-child { margin-bottom: 0; }
.stats-note b { color: var(--white); }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .stats-numbers { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .stats-card { animation: none; opacity: 1; transform: none; }
}


/* ==========================================================================
   ردیف‌های افقی نوشته‌ها توی صفحه‌ی اصلی
   ========================================================================== */
.row-section { margin-bottom: 54px; }

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.row-head h2 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}
.row-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  transition: color var(--transition), border-color var(--transition),
              transform var(--transition);
}
.row-more img { filter: var(--icon-filter-soft); transition: transform var(--transition); }
.row-more:hover { color: var(--white); border-color: var(--pink); transform: translateY(-2px); }
/* سایت راست‌چینه، پس فلش «بیشتر» باید به چپ حرکت کنه */
.row-more:hover img { transform: translateX(-4px); }

/* --- نوار اسکرول افقی --- */
.row-scroller {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--pink-deep) transparent;
  /* فضای اضافه پایین برای اسکرول‌بار، و کنارها برای سایه‌ی کارت‌ها */
  padding: 6px 4px 16px;
  margin: -6px -4px 0;
  scroll-padding-inline: 4px;
}
.row-scroller::-webkit-scrollbar { height: 7px; }
.row-scroller::-webkit-scrollbar-track { background: transparent; }
.row-scroller::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}
.row-scroller:hover::-webkit-scrollbar-thumb { background: var(--pink-deep); }
.row-scroller:focus-visible { outline: 2px solid var(--pink); outline-offset: 4px; border-radius: var(--radius-sm); }

/* --- کارت --- */
.row-card {
  flex: 0 0 260px;              /* عرض ثابت، چون توی نوار افقیه */
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition),
              box-shadow var(--transition);
}
.row-card:hover {
  transform: translateY(-6px);
  border-color: var(--pink);
  box-shadow: 0 16px 36px -18px rgba(255, 111, 181, 0.6);
}

.row-card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-hover);
}
.row-card-cover img,
.row-card-cover .course-cover-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(.22,.7,.2,1);
}
.row-card:hover .row-card-cover img { transform: scale(1.07); }

.row-card-body { padding: 16px 16px 18px; }
.row-card-body h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.7;
  /* عنوان بلند حداکثر دو خط، بقیه‌ش با سه نقطه */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.9;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 720px) {
  .row-section { margin-bottom: 40px; }
  .row-card { flex: 0 0 78%; }   /* لبه‌ی کارت بعدی پیداست تا معلوم شه اسکرول می‌شه */
  .row-more { padding: 8px 14px; font-size: 0.8rem; }
}
@media (max-width: 400px) {
  .row-card { flex: 0 0 84%; }
}


/* ==========================================================================
   عکس‌های داخل متن نوشته
   ========================================================================== */
.article-figure {
  margin: 28px 0;
}
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.article-figure figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.9;
}

/* وسط‌چین و نصف عرض */
.article-figure-small {
  max-width: 55%;
  margin-inline: auto;
}

/* شناور: متن دورش می‌پیچه */
.article-figure-right {
  float: right;
  max-width: 45%;
  margin: 8px 0 20px 26px;   /* فاصله از متنی که سمت چپشه */
}
.article-figure-left {
  float: left;
  max-width: 45%;
  margin: 8px 26px 20px 0;
}
/* تیتر بعدی نباید کنار عکس شناور گیر کنه */
.article-content h3 { clear: both; }
/* انتهای متن، شناورها بسته می‌شن تا از کادر بیرون نزنن */
.article-content::after { content: ""; display: table; clear: both; }

/* روی موبایل، پیچیدن متن دور عکس متن رو خفه می‌کنه */
@media (max-width: 600px) {
  .article-figure-right,
  .article-figure-left,
  .article-figure-small {
    float: none;
    max-width: 100%;
    margin-inline: 0;
    margin-block: 22px;
  }
}

/* ==========================================================================
   ویرایشگر نوشته: پیش‌نمایش، آپلود، گالری
   ========================================================================== */
.toolbar-image {
  border-color: var(--pink) !important;
  color: var(--pink-soft) !important;
}

.editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.editor-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.editor-pane textarea { width: 100%; resize: vertical; }

.pane-title {
  font-size: 0.85rem;
  color: var(--muted);
}
.preview-body {
  min-height: 320px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  font-size: 0.95rem;
}
.preview-empty { color: var(--muted); opacity: 0.6; }
.preview-body .article-figure { margin: 18px 0; }

/* پرده‌ی «اینجا رها کن» */
.drop-overlay {
  position: absolute;
  inset: 26px 0 0;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--pink);
  border-radius: var(--radius-sm);
  background: rgba(255, 111, 181, 0.12);
  backdrop-filter: blur(2px);
  color: var(--pink-soft);
  font-weight: 700;
  pointer-events: none;
  z-index: 2;
}
.drop-overlay.visible { display: flex; }

.upload-status {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.upload-status.success { border-color: #35c48f; color: #35c48f; }
.upload-status.error   { border-color: #ff6b6b; color: #ff6b6b; }
.upload-status.loading { border-color: var(--pink); color: var(--pink-soft); }

/* --- گالری --- */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 5, 14, 0.75);
  backdrop-filter: blur(4px);
}
.gallery-modal[hidden] { display: none; }
.gallery-box {
  width: min(880px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.gallery-head h3 { margin: 0; font-size: 1.05rem; }
.gallery-close {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
}
.gallery-close:hover { border-color: var(--pink); color: var(--white); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 18px 20px;
  overflow-y: auto;
}
.gallery-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 30px 0;
}
.gallery-item {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  transition: border-color var(--transition), transform var(--transition);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item:hover { border-color: var(--pink); transform: translateY(-3px); }

@media (max-width: 900px) {
  .editor-split { grid-template-columns: 1fr; }
  .preview-body { max-height: 400px; }
}
