/* Animation styles for Mcket Website */

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(40px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes slideInLeft {
  from { 
    opacity: 0; 
    transform: translateX(-50px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

@keyframes slideInRight {
  from { 
    opacity: 0; 
    transform: translateX(50px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

@keyframes scaleIn {
  from { 
    opacity: 0; 
    transform: scale(0.8); 
  }
  to { 
    opacity: 1; 
    transform: scale(1); 
  }
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
  }
  50% { 
    transform: scale(1.05); 
  }
}

@keyframes bounce {
  0%, 100% { 
    transform: translateY(0); 
  }
  50% { 
    transform: translateY(-10px); 
  }
}

@keyframes float {
  0%, 100% { 
    transform: translateY(0px); 
  }
  50% { 
    transform: translateY(-20px); 
  }
}

@keyframes spin {
  from { 
    transform: rotate(0deg); 
  }
  to { 
    transform: rotate(360deg); 
  }
}

@keyframes shimmer {
  0% { 
    background-position: -1000px 0; 
  }
  100% { 
    background-position: 1000px 0; 
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Image-specific animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.slide-in-left {
  animation: slideInLeft 0.6s ease forwards;
}

.slide-in-right {
  animation: slideInRight 0.6s ease forwards;
}

.scale-in {
  animation: scaleIn 0.5s ease forwards;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.bounce {
  animation: bounce 2s ease-in-out infinite;
}

.float {
  animation: float 3s ease-in-out infinite;
}

.spin {
  animation: spin 2s linear infinite;
}

.zoom-in {
  animation: zoomIn 0.5s ease forwards;
}

/* Image animation classes */
.fade-in-scale {
  animation: fadeInScale 0.8s ease forwards;
}

.float-slow {
  animation: floatSlow 4s ease-in-out infinite;
}

.slide-in-bottom {
  animation: slideInFromBottom 0.8s ease forwards;
}

.rotate-in {
  animation: rotateIn 0.8s ease forwards;
}

/* Scroll Animation Base */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
}

/* Delay Classes */
.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; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Stagger Animation for Lists */
.stagger-animation > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }

/* Hero Slide Animations */
.hero-slide {
  opacity: 0;
  transition: opacity 1s ease, transform 0.8s ease;
  transform: scale(1.1);
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

/* FAQ Accordion Animations */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

/* FAQ specific animations */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateX(5px);
}

.faq-question {
    transition: all 0.3s ease;
}

.faq-question:hover {
    background-color: var(--primary-container-color) !important;
}

.faq-toggle i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.faq-item.active .faq-toggle i {
    transform: rotate(45deg);
    color: var(--on-primary-color);
}

.faq-item.active .faq-question {
    background-color: var(--primary-color) !important;
}

.faq-item.active .faq-question h3 {
    color: var(--on-primary-color);
}

/* Contact Support Card Animation */
.contact-support {
    transition: all 0.3s ease;
}

.contact-support:hover {
    box-shadow: 0 15px 40px rgba(0, 128, 179, 0.2);
    transform: translateY(-5px);
}

/* Smooth category appearance */
.faq-category {
    position: relative;
    padding-left: 15px;
}

.faq-category::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 30px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

/* Stagger FAQ items within each category */
.faq-container {
    position: relative;
}

/* Add entrance animation for FAQ items */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Button Hover Effects */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Card Hover Effects */
.feature-item,
.benefit-item,
.difference-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover,
.benefit-item:hover,
.difference-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 128, 179, 0.15);
}

/* Icon Animations */
.feature-icon,
.benefit-icon {
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.feature-item:hover .feature-icon,
.benefit-item:hover .benefit-icon {
  transform: scale(1.1) rotate(5deg);
  background-color: var(--primary-color);
}

.feature-item:hover .feature-icon i,
.benefit-item:hover .benefit-icon i {
  color: white;
}

/* Slider Dot Animation */
.slider-dot {
  transition: all 0.3s ease;
  cursor: pointer;
}

.slider-dot:hover {
  transform: scale(1.2);
}

.slider-dot.active {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Back to Top Button */
.back-to-top {
  transition: opacity 0.3s ease, transform 0.3s ease, bottom 0.3s ease;
}

.back-to-top.show {
  animation: fadeInUp 0.5s ease forwards;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 128, 179, 0.3);
}

/* Loading Shimmer Effect */
.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 20%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0)
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Image loading shimmer effect */
.image-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 20px;
    pointer-events: none;
}

/* Image loading state */
img.loading {
    opacity: 0.3;
    filter: blur(5px);
    transition: opacity 0.5s ease, filter 0.5s ease;
}

img.loaded {
    opacity: 1;
    filter: blur(0);
}

/* Responsive adjustments for animations */
@media (max-width: 768px) {
    .float-slow {
        animation: floatSlow 6s ease-in-out infinite;
    }
    
    .app-screenshot img:hover,
    .errander-images img:hover {
        transform: scale(1.02);
    }
    
    /* Disable parallax on mobile for performance */
    .parallax-image {
        transform: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .float-slow,
    .parallax-image {
        animation: none !important;
        transform: none !important;
    }
}

/* Arrow button animations */
@keyframes arrowPulse {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.05);
    }
}

.slider-arrow {
    animation: arrowPulse 2s ease-in-out infinite;
}

.slider-arrow:hover {
    animation: none;
}

/* Slide transition effects */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px) scale(1.05);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100px) scale(1.05);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}
