/* ============================================
   QURAN ACADEMY - ANIMATIONS
   ============================================ */

/* ---------- Fade In Up ---------- */
[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-up"].animated {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Fade In Down ---------- */
[data-animate="fade-down"] {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-down"].animated {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Fade In Left ---------- */
[data-animate="fade-left"] {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-left"].animated {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- Fade In Right ---------- */
[data-animate="fade-right"] {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-right"].animated {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- Scale In ---------- */
[data-animate="scale-in"] {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="scale-in"].animated {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Staggered Children ---------- */
[data-animate="stagger"] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-animate="stagger"].animated > *:nth-child(1) { transition-delay: 0.05s; }
[data-animate="stagger"].animated > *:nth-child(2) { transition-delay: 0.1s; }
[data-animate="stagger"].animated > *:nth-child(3) { transition-delay: 0.15s; }
[data-animate="stagger"].animated > *:nth-child(4) { transition-delay: 0.2s; }
[data-animate="stagger"].animated > *:nth-child(5) { transition-delay: 0.25s; }
[data-animate="stagger"].animated > *:nth-child(6) { transition-delay: 0.3s; }
[data-animate="stagger"].animated > *:nth-child(7) { transition-delay: 0.35s; }
[data-animate="stagger"].animated > *:nth-child(8) { transition-delay: 0.4s; }

[data-animate="stagger"].animated > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Typing Animation ---------- */
.typing-text {
  display: inline-block;
  overflow: hidden;
  border-right: 2px solid var(--secondary);
  white-space: nowrap;
  animation: typing 3s steps(40) forwards, blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--secondary); }
}

/* ---------- Pulse ---------- */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* ---------- Glow ---------- */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(11,110,79,0.3); }
  50% { box-shadow: 0 0 20px rgba(11,110,79,0.5); }
}

.glow-animation {
  animation: glow 2s ease-in-out infinite;
}

/* ---------- Slide In From Bottom ---------- */
@keyframes slideInBottom {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-bottom {
  animation: slideInBottom 0.5s ease forwards;
}

/* ---------- Rotate In ---------- */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-200deg);
  }
  to {
    opacity: 1;
    transform: rotate(0);
  }
}

/* ---------- Counter Animation ---------- */
.counter-animate {
  transition: all 0.3s ease;
}

/* ---------- Shimmer ---------- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg) 25%,
    var(--border) 50%,
    var(--bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ---------- Ripple Effect ---------- */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  transform: scale(0);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.ripple:active::after {
  transform: scale(2);
  opacity: 1;
  transition: 0s;
}

/* ---------- Parallax ---------- */
.parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* ---------- Image Reveal ---------- */
.img-reveal {
  position: relative;
  overflow: hidden;
}

.img-reveal img {
  transition: transform 0.6s ease;
}

.img-reveal:hover img {
  transform: scale(1.08);
}

.img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  transform-origin: right;
  transform: scaleX(0);
  transition: transform 0.6s ease;
}

.img-reveal:hover::after {
  transform: scaleX(0);
  transform-origin: left;
}
