/* ========================================
   ORGANIC HOME SOLUTIONS - Animations
   ======================================== */

/* -------------------- Keyframe Animations -------------------- */

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

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Bounce */
@keyframes bounce {
  0%, 20%, 53%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translateY(0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translateY(-20px);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translateY(-10px);
  }
  90% {
    transform: translateY(-4px);
  }
}

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

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

/* Float Horizontal */
@keyframes floatHorizontal {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(10px);
  }
}

/* Rotate */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Shake */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Ripple */
@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

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

/* Blob Animation */
@keyframes blob {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
}

/* -------------------- Animation Classes -------------------- */

.animate-fadeIn {
  animation: fadeIn 0.6s ease forwards;
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeInDown {
  animation: fadeInDown 0.6s ease forwards;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.6s ease forwards;
}

.animate-fadeInRight {
  animation: fadeInRight 0.6s ease forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.5s ease forwards;
}

.animate-bounce {
  animation: bounce 1s ease;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-rotate {
  animation: rotate 10s linear infinite;
}

/* -------------------- Delay Classes -------------------- */

.delay-100 {
  animation-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
}

.delay-400 {
  animation-delay: 400ms;
}

.delay-500 {
  animation-delay: 500ms;
}

.delay-600 {
  animation-delay: 600ms;
}

.delay-700 {
  animation-delay: 700ms;
}

.delay-800 {
  animation-delay: 800ms;
}

/* -------------------- Hover Animations -------------------- */

/* Card Hover Effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Scale on Hover */
.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Glow on Hover */
.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(37, 211, 102, 0.5);
}

/* Image Zoom on Hover */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.5s ease;
}

.img-zoom:hover img {
  transform: scale(1.1);
}

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

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:hover::after {
  width: 300px;
  height: 300px;
}

/* Link Underline Animation */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-green);
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}

/* -------------------- Scroll Animations -------------------- */

/* Reveal on Scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Reveal Left */
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

/* Reveal Right */
.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* -------------------- Counter Animation -------------------- */

.counter-animate {
  display: inline-block;
}

/* -------------------- Loading Animations -------------------- */

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--light-green);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

/* Dots Loading */
.dots-loading {
  display: flex;
  gap: 5px;
}

.dots-loading span {
  width: 10px;
  height: 10px;
  background: var(--primary-green);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite;
}

.dots-loading span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots-loading span:nth-child(3) {
  animation-delay: 0.4s;
}

/* -------------------- Parallax Effects -------------------- */

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

/* -------------------- Text Animations -------------------- */

/* Typing Effect (for headings) */
.typing-effect {
  overflow: hidden;
  border-right: 3px solid var(--primary-green);
  white-space: nowrap;
  animation: typing 3s steps(40) 1s forwards, blink 0.75s step-end infinite;
}

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

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* Gradient Text Animation */
.gradient-text-animate {
  background: linear-gradient(90deg, var(--primary-green), var(--primary-teal), var(--primary-green));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s linear infinite;
}

/* -------------------- Icon Animations -------------------- */

/* Bounce on Hover */
.icon-bounce:hover {
  animation: bounce 0.6s ease;
}

/* Rotate on Hover */
.icon-rotate:hover {
  animation: rotate 0.5s ease;
}

/* Shake on Hover */
.icon-shake:hover {
  animation: shake 0.5s ease;
}

/* Pulse Circle */
.pulse-circle {
  position: relative;
}

.pulse-circle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: var(--primary-green);
  border-radius: 50%;
  opacity: 0.3;
  animation: ripple 1.5s infinite;
}

/* -------------------- Card Flip Animation -------------------- */

.flip-card {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* -------------------- Stagger Children Animation -------------------- */

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-children.active > *:nth-child(1) { animation: fadeInUp 0.5s ease 0.1s forwards; }
.stagger-children.active > *:nth-child(2) { animation: fadeInUp 0.5s ease 0.2s forwards; }
.stagger-children.active > *:nth-child(3) { animation: fadeInUp 0.5s ease 0.3s forwards; }
.stagger-children.active > *:nth-child(4) { animation: fadeInUp 0.5s ease 0.4s forwards; }
.stagger-children.active > *:nth-child(5) { animation: fadeInUp 0.5s ease 0.5s forwards; }
.stagger-children.active > *:nth-child(6) { animation: fadeInUp 0.5s ease 0.6s forwards; }

/* -------------------- WhatsApp Button Animation -------------------- */

.floating-btn.whatsapp {
  animation: pulse 2s infinite;
}

.floating-btn.whatsapp:hover {
  animation: none;
  transform: scale(1.1);
}

/* -------------------- Smooth Scroll Indicator -------------------- */

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 50px;
  border: 2px solid var(--primary-green);
  border-radius: 25px;
  opacity: 0.6;
}

.scroll-indicator::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--primary-green);
  border-radius: 50%;
  animation: scrollDown 2s infinite;
}

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

/* -------------------- Reduce Motion -------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
