/* ==========================================
   کرسر سفارشی سایت — دایره + نقطه مرکزی
   روی عناصر قابل کلیک: انیمیشن لودینگ (دایره کوچکتر در حال چرخش)
   ========================================== */
html.has-cursor-fx,
html.has-cursor-fx * {
  cursor: none !important;
}

#site-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transition: opacity .2s ease;
  will-change: transform;
}
body.cursor-active #site-cursor { opacity: 1; }

.cursor-ring {
  position: absolute;
  left: 0; top: 0;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border: 1.5px solid rgba(13, 27, 94, .55);
  border-radius: 50%;
  transition: width .25s ease, height .25s ease, margin .25s ease, border-color .25s ease, background-color .25s ease;
}
.cursor-dot {
  position: absolute;
  left: 0; top: 0;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #0d1b5e;
  box-shadow: 0 0 10px rgba(13, 27, 94, .4);
  transition: width .2s ease, height .2s ease, margin .2s ease, opacity .2s ease, background .2s ease;
}
.cursor-loader {
  position: absolute;
  left: 0; top: 0;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #0d1b5e;
  border-right-color: rgba(13, 27, 94, .45);
  opacity: 0;
  transition: opacity .2s ease;
  animation: cursorFxSpin .85s linear infinite;
}

/* روی زمینه‌های تیره: کرسر سفید می‌شود */
#site-cursor.on-dark-bg .cursor-ring {
  border-color: rgba(255, 255, 255, .65);
}
#site-cursor.on-dark-bg .cursor-dot {
  background: #fff;
  box-shadow: 0 0 10px rgba(87, 174, 255, .7);
}
#site-cursor.on-dark-bg .cursor-loader {
  border-top-color: #fff;
  border-right-color: rgba(255, 255, 255, .45);
}

/* حالت هاور روی عناصر قابل کلیک */
#site-cursor.is-hover .cursor-ring {
  width: 42px; height: 42px;
  margin: -21px 0 0 -21px;
  border-color: rgba(13, 27, 94, .7);
  background: rgba(13, 27, 94, .08);
}
#site-cursor.on-dark-bg.is-hover .cursor-ring {
  border-color: rgba(87, 174, 255, .85);
  background: rgba(87, 174, 255, .08);
}
#site-cursor.is-hover .cursor-dot { opacity: 0; }
#site-cursor.is-hover .cursor-loader { opacity: 1; }

@keyframes cursorFxSpin { to { transform: rotate(360deg); } }

@media (pointer: coarse) {
  html.has-cursor-fx, html.has-cursor-fx * { cursor: auto !important; }
  #site-cursor { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-loader { animation: none; }
}
