/* ============================================================
   AppSaze — assets/css/animations.css
   انیمیشن‌ها و Micro-interactions
   ============================================================ */

/* ── Hero Blob Animations ────────────────────────────────────── */
@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25%       { transform: translate(30px, -40px) scale(1.05) rotate(5deg); }
  50%       { transform: translate(-20px, 20px) scale(0.97) rotate(-3deg); }
  75%       { transform: translate(15px, 30px) scale(1.03) rotate(2deg); }
}

@keyframes blob-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%       { transform: translate(-30px, 20px) scale(1.06) rotate(-4deg); }
  66%       { transform: translate(20px, -30px) scale(0.96) rotate(6deg); }
}

@keyframes blob-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(-15px, -20px) scale(1.04); }
}

.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  pointer-events: none;
}
.hero__blob--1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.7) 0%, rgba(139,92,246,0.1) 70%, transparent 100%);
  top: -200px;
  right: -100px;
  animation: blob-float 18s ease-in-out infinite;
}
.hero__blob--2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6,182,212,0.6) 0%, rgba(6,182,212,0.1) 70%, transparent 100%);
  bottom: -100px;
  left: -100px;
  animation: blob-float-2 22s ease-in-out infinite;
}
.hero__blob--3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(139,92,246,0.4) 0%, transparent 70%);
  top: 40%;
  left: 40%;
  animation: blob-float-3 16s ease-in-out infinite;
}

/* ── Gradient Mesh Background ────────────────────────────────── */
@keyframes mesh-shift {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

.hero__mesh {
  position: absolute;
  inset: 0;
  background: conic-gradient(
    from 225deg at 60% 30%,
    rgba(139,92,246,0.12) 0deg,
    rgba(6,182,212,0.08) 90deg,
    rgba(139,92,246,0.04) 180deg,
    transparent 270deg
  );
  background-size: 200% 200%;
  animation: mesh-shift 30s ease infinite;
}

/* ── Gradient Text Animation ─────────────────────────────────── */
@keyframes gradient-text-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.text-gradient {
  background: linear-gradient(135deg, #A78BFA, #22D3EE, #A78BFA);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
          background-clip: text;
  animation: gradient-text-shift 5s ease infinite;
}

/* ── Fade In Animations ──────────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-right {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fade-in-left {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Scroll Reveal Classes ───────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-reveal="up"]    { transform: translateY(40px); }
[data-reveal="down"]  { transform: translateY(-24px); }
[data-reveal="right"] { transform: translateX(-40px); }
[data-reveal="left"]  { transform: translateX(40px); }
[data-reveal="scale"] { transform: scale(0.9); }
[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

/* Stagger delays */
[data-reveal-delay="100"] { transition-delay: 100ms; }
[data-reveal-delay="200"] { transition-delay: 200ms; }
[data-reveal-delay="300"] { transition-delay: 300ms; }
[data-reveal-delay="400"] { transition-delay: 400ms; }
[data-reveal-delay="500"] { transition-delay: 500ms; }
[data-reveal-delay="600"] { transition-delay: 600ms; }

/* ── Glow Pulse ──────────────────────────────────────────────── */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px var(--accent-primary-glow); }
  50%       { box-shadow: 0 0 40px var(--accent-primary-glow), 0 0 80px rgba(139,92,246,0.15); }
}
.glow-pulse {
  animation: glow-pulse 3s ease-in-out infinite;
}

/* ── Shimmer Loading ─────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Spin ────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* ── Counter Number Up ───────────────────────────────────────── */
.counter {
  font-variant-numeric: tabular-nums;
  transition: all var(--transition-base);
}

/* ── Hover Lift ──────────────────────────────────────────────── */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* ── Portfolio Card Overlay ──────────────────────────────────── */
.portfolio-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,8,14,0.95) 0%, rgba(8,8,14,0.6) 50%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-slow);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-4);
  border-radius: inherit;
}
.portfolio-card:hover .portfolio-card__overlay {
  opacity: 1;
}
.portfolio-card__overlay-content {
  transform: translateY(16px);
  transition: transform var(--transition-slow);
}
.portfolio-card:hover .portfolio-card__overlay-content {
  transform: translateY(0);
}

/* ── Testimonial Slider ──────────────────────────────────────── */
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-out-left {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-60px); }
}

/* ── Page Transition ─────────────────────────────────────────── */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content {
  animation: page-enter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Cursor Glow ──────────────────────────────────────────── */
.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.05) 0%, transparent 65%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: -1; /* Behind all content — was 0 which blocked hover states */
  transition: opacity 0.6s ease;
  will-change: left, top;
}

/* ── Process Timeline ────────────────────────────────────────── */
@keyframes line-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.process__line-fill {
  transform-origin: right;
  animation: line-grow 1s ease forwards;
  animation-play-state: paused;
}
.process__line-fill.animated {
  animation-play-state: running;
}

/* ── Star Rating ─────────────────────────────────────────────── */
.star--filled { color: #FBBF24; }
.star--empty  { color: var(--text-muted); }

/* ── Reduced Motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
