/* Hartono Motor - Animation Styles */

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

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

/* Slide Up Animation */
@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out forwards;
}

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

.animate-slide-left {
  animation: slideInLeft 0.5s ease-out forwards;
}

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

.animate-slide-right {
  animation: slideInRight 0.5s ease-out forwards;
}

/* Scale Up Animation */
@keyframes scaleUp {
  from { 
    opacity: 0;
    transform: scale(0.95);
  }
  to { 
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-up {
  animation: scaleUp 0.4s ease-out forwards;
}

/* Subtle Pulse Animation */
@keyframes subtlePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

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

/* Staggered Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

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

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

.hover-scale {
  transition: transform 0.3s ease;
}

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

/* Button Animations */
.btn-animate {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-animate:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn-animate:hover:after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

/* Scroll Animations - These will be triggered by JavaScript */
.reveal {
  opacity: 1;
  transition: all 0.8s ease;
}

.js-enabled .reveal {
  opacity: 0;
}

.js-enabled .reveal.active {
  opacity: 1;
}

.reveal-left,
.reveal-right,
.reveal-up {
  opacity: 1;
  transform: none;
  transition: all 0.8s ease;
}

.js-enabled .reveal-left {
  opacity: 0;
  transform: translateX(-30px);
}

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

.js-enabled .reveal-right {
  opacity: 0;
  transform: translateX(30px);
}

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

.js-enabled .reveal-up {
  opacity: 0;
  transform: translateY(30px);
}

.js-enabled .reveal-up.active {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth Page Transitions */
.page-transition {
  position: relative;
}

.page-transition::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.page-transition.transitioning::before {
  opacity: 1;
}

/* Loading Animation */
.loading-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #dc2626; /* Red-600 */
  animation: spin 1s ease-in-out infinite;
}

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

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

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

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

/* Text Reveal Animation */
.text-reveal {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  animation: textReveal 0.5s forwards;
}

@keyframes textReveal {
  to { transform: translateY(0); }
}

/* Staggered Text Animation */
.stagger-text span {
  opacity: 0;
  display: inline-block;
  animation: fadeInStagger 0.3s ease forwards;
}

@keyframes fadeInStagger {
  to { opacity: 1; }
}

/* For accessibility - respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
