/* ============================================================
   TechOneAI — animations.css
   تمام keyframeها و کلاس‌های انیمیشن ورود عناصر
   ============================================================ */

/* ---------- keyframeها ---------- */
@keyframes bgShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shine {
  0%   { left: -120%; }
  60%, 100% { left: 140%; }
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70%  { box-shadow: 0 0 0 8px transparent; opacity: 0.6; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-16px); }
}

@keyframes floatX {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(14px); }
}

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

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

@keyframes gradientMove {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes bounceX {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(8px); }
}

/* مکاننمای تایپ */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  background: var(--c-pink);
  margin-right: 4px;
  animation: blink 1s step-end infinite;
}

/* ---------- کلاس‌های ورود با اسکرول (reveal) ---------- */
/* ابتدا مخفی، با افزودن .in-visible فعال میشود */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="left"]  { transform: translateX(-50px); }
[data-reveal="right"] { transform: translateX(50px); }
[data-reveal="left"].is-visible,
[data-reveal="right"].is-visible { transform: translateX(0); }

[data-reveal="zoom"] { transform: scale(0.92); }
[data-reveal="zoom"].is-visible { transform: scale(1); }

/* ---------- کلاس‌های کمکی انیمیشن ---------- */
.float        { animation: floatY 5s ease-in-out infinite; }
.float-slow   { animation: floatY 8s ease-in-out infinite; }
.spin-slow    { animation: spinSlow 28s linear infinite; }

/* متن گرادیانی متحرک */
.text-gradient-anim {
  background: linear-gradient(90deg, #a5b4fc, #f0abfc, #fbcfe8, #a5b4fc);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientMove 6s linear infinite;
}

/* لایه ذرات canvas */
#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* دکمه‌های شناور سمت چپ/راست */
.fab {
  position: fixed;
  bottom: 24px;
  z-index: 900;
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--grad-primary);
  box-shadow: var(--glow-indigo);
  color: #fff;
  font-size: 1.3rem;
  transition: transform var(--t);
}
.fab:hover { transform: scale(1.1) translateY(-3px); }

/* اسپینر بارگذاری */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinSlow 0.7s linear infinite;
}

/* نوار پیشرفت چت (typing) */
.typing-dots span {
  display: inline-block;
  width: 8px; height: 8px;
  margin: 0 2px;
  border-radius: 50%;
  background: var(--c-violet);
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* حلقه چرخان تزئینی */
.ring-orbit {
  position: absolute;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}
.ring-orbit::after {
  content: '';
  position: absolute;
  top: -5px; left: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c-pink);
  box-shadow: 0 0 14px var(--c-pink);
}
