/* ================================================
   AHLAME UGC PORTFOLIO — Animations
   ================================================ */

/* ================================================
   REVEAL ANIMATIONS (Triggered by Intersection Observer)
   ================================================ */

/* --- Base: all revealable elements start hidden --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-expo), transform 0.8s var(--ease-expo);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Direction Variants --- */
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s var(--ease-expo), transform 0.8s var(--ease-expo);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s var(--ease-expo), transform 0.8s var(--ease-expo);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s var(--ease-expo), transform 0.8s var(--ease-expo);
}

.reveal-left.reveal--visible,
.reveal-right.reveal--visible,
.reveal-scale.reveal--visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* --- Staggered Reveal (children) --- */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-expo), transform 0.6s var(--ease-expo);
}

.stagger-children.reveal--visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.reveal--visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children.reveal--visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children.reveal--visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children.reveal--visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children.reveal--visible > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-children.reveal--visible > *:nth-child(7) { transition-delay: 0.47s; }
.stagger-children.reveal--visible > *:nth-child(8) { transition-delay: 0.54s; }

.stagger-children.reveal--visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================
   KEYFRAME ANIMATIONS
   ================================================ */

/* --- Float (subtle up-down) --- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.anim-float {
  animation: float 4s ease-in-out infinite;
}

/* --- Pulse Glow --- */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(232, 168, 124, 0.1); }
  50% { box-shadow: 0 0 40px rgba(232, 168, 124, 0.25); }
}

.anim-pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* --- Rotate Slow --- */
@keyframes rotateSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.anim-rotate {
  animation: rotateSlow 20s linear infinite;
}

/* --- Typewriter Effect --- */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blinkCaret {
  0%, 100% { border-color: var(--color-primary); }
  50% { border-color: transparent; }
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--color-primary);
  display: inline-block;
  animation:
    typewriter 3s steps(40) 1s forwards,
    blinkCaret 0.75s step-end infinite;
  width: 0;
}

/* --- Gradient Shift (background animation) --- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.anim-gradient {
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}

/* --- Shimmer (loading / highlight) --- */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.anim-shimmer {
  position: relative;
  overflow: hidden;
}

.anim-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(232, 168, 124, 0.08),
    transparent
  );
  animation: shimmer 3s ease-in-out infinite;
}

/* --- Scale Bounce In --- */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

.anim-bounce-in {
  animation: bounceIn 0.8s var(--ease-bounce);
}

/* --- Slide In From Bottom --- */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(80px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Fade In --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.anim-fade-in {
  animation: fadeIn 1s var(--ease-smooth);
}

/* --- Particle Float (for hero background) --- */
@keyframes particleFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  25% { transform: translate(30px, -50px) scale(1.2); opacity: 0.6; }
  50% { transform: translate(-20px, -100px) scale(0.8); opacity: 0.4; }
  75% { transform: translate(40px, -60px) scale(1.1); opacity: 0.5; }
}

@keyframes particleFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.2; }
  33% { transform: translate(-40px, -80px) scale(1.3); opacity: 0.5; }
  66% { transform: translate(20px, -120px) scale(0.7); opacity: 0.3; }
}

@keyframes particleFloat3 {
  0%, 100% { transform: translate(0, 0); opacity: 0.4; }
  50% { transform: translate(60px, -90px); opacity: 0.7; }
}

/* ================================================
   HERO-SPECIFIC ANIMATIONS
   ================================================ */

/* --- Hero text lines stagger --- */
.hero__line {
  opacity: 0;
  transform: translateY(60px);
  animation: slideInUp 1s var(--ease-expo) forwards;
}

.hero__line:nth-child(1) { animation-delay: 0.5s; }
.hero__line:nth-child(2) { animation-delay: 0.7s; }
.hero__line:nth-child(3) { animation-delay: 0.9s; }

/* --- Scroll Indicator --- */
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: 0.5; }
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: scrollBounce 2s ease-in-out infinite;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

.scroll-indicator__mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--text-muted);
  border-radius: 12px;
  position: relative;
}

.scroll-indicator__wheel {
  width: 4px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
  0% { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* ================================================
   COUNTER ANIMATION
   ================================================ */
.counter {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================
   IMAGE REVEAL EFFECT
   ================================================ */
.image-reveal {
  position: relative;
  overflow: hidden;
}

.image-reveal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  z-index: 2;
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 1s var(--ease-expo);
}

.image-reveal.reveal--visible::before {
  transform: scaleX(0);
  transform-origin: left;
}

/* ================================================
   HOVER EFFECTS FOR GALLERY
   ================================================ */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.gallery-item__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-expo);
}

.gallery-item:hover .gallery-item__media {
  transform: scale(1.08);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 10, 15, 0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-md);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

/* ================================================
   PHONE MOCKUP (for Reels)
   ================================================ */
.phone-mockup {
  width: 280px;
  height: 560px;
  background: #1a1a1a;
  border-radius: 36px;
  border: 3px solid #2a2a2a;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 2px rgba(232, 168, 124, 0.1),
    var(--shadow-lg);
}

.phone-mockup__notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 28px;
  background: #1a1a1a;
  border-radius: 0 0 16px 16px;
  z-index: 3;
}

.phone-mockup__screen {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================================================
   MAGNETIC BUTTON EFFECT (JS-enhanced)
   ================================================ */
.magnetic-btn {
  transition: transform 0.3s var(--ease-smooth);
}

/* ================================================
   PARTICLES BACKGROUND
   ================================================ */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  opacity: 0;
}

.particle:nth-child(odd) {
  animation: particleFloat1 8s ease-in-out infinite;
}

.particle:nth-child(even) {
  animation: particleFloat2 10s ease-in-out infinite;
}

.particle:nth-child(3n) {
  animation: particleFloat3 12s ease-in-out infinite;
  width: 3px;
  height: 3px;
}

/* ================================================
   VIDEO CAROUSEL SPECIFIC
   ================================================ */
.carousel-slide {
  transition: transform 0.7s var(--ease-expo), opacity 0.7s var(--ease-expo);
}

.carousel-slide--active {
  transform: scale(1);
  opacity: 1;
}

.carousel-slide--prev,
.carousel-slide--next {
  transform: scale(0.85);
  opacity: 0.4;
}
