/**
 * Livora V4 - Animation Effects
 * Smooth animations for interactive components
 */

/* ========== Fade Animations ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.lv-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.lv-fade-out {
  animation: fadeOut 0.4s ease-out;
}

/* ========== Slide Animations ========== */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lv-slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

.lv-slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

.lv-slide-up {
  animation: slideUp 0.5s ease-out;
}

/* ========== Pulse Animation ========== */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes pulseSlow {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.lv-pulse {
  animation: pulse 2s infinite;
}

.lv-pulse-slow {
  animation: pulseSlow 3s infinite;
}

/* ========== Bounce Animation ========== */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.lv-bounce {
  animation: bounce 1s;
}

/* ========== Shake Animation ========== */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.lv-shake {
  animation: shake 0.5s;
}

/* ========== Rotate Animation ========== */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.lv-rotate {
  animation: rotate 2s linear infinite;
}

.lv-rotate-once {
  animation: rotate 0.5s ease-out;
}

/* ========== Loading Spinner ========== */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.lv-spinner {
  border: 3px solid var(--lv-cream);
  border-top: 3px solid var(--lv-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

.lv-spinner-small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.lv-spinner-large {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

/* ========== Progress Bar Animation ========== */
@keyframes progressBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.lv-progress-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--lv-primary), var(--lv-secondary));
  animation: progressBar 2s ease-out;
}

/* ========== Scale Animation ========== */
@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scaleOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.8);
    opacity: 0;
  }
}

.lv-scale-in {
  animation: scaleIn 0.3s ease-out;
}

.lv-scale-out {
  animation: scaleOut 0.3s ease-out;
}

/* ========== Hover Effects ========== */
.lv-hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lv-hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(72, 56, 36, 0.15);
}

.lv-hover-glow {
  transition: box-shadow 0.3s ease;
}

.lv-hover-glow:hover {
  box-shadow: 0 0 20px rgba(212, 160, 131, 0.5);
}

/* ========== Stagger Animation (for lists) ========== */
.lv-stagger-item {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}

.lv-stagger-item:nth-child(1) { animation-delay: 0.1s; }
.lv-stagger-item:nth-child(2) { animation-delay: 0.2s; }
.lv-stagger-item:nth-child(3) { animation-delay: 0.3s; }
.lv-stagger-item:nth-child(4) { animation-delay: 0.4s; }
.lv-stagger-item:nth-child(5) { animation-delay: 0.5s; }
.lv-stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ========== Countdown Animation ========== */
@keyframes countdownPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.lv-countdown-digit {
  display: inline-block;
  padding: 8px 12px;
  background-color: var(--lv-white);
  border-radius: var(--lv-radius-sm);
  font-weight: 700;
  color: var(--lv-primary);
  min-width: 50px;
  text-align: center;
}

.lv-countdown-digit.active {
  animation: countdownPulse 0.5s;
}

/* ========== Notification Animation ========== */
@keyframes slideInNotification {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutNotification {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.lv-notification-enter {
  animation: slideInNotification 0.4s ease-out;
}

.lv-notification-exit {
  animation: slideOutNotification 0.3s ease-out;
}

/* ========== Smooth Transitions ========== */
.lv-transition-all {
  transition: all 0.3s ease;
}

.lv-transition-fast {
  transition: all 0.15s ease;
}

.lv-transition-slow {
  transition: all 0.5s ease;
}

/* ========== Enhanced Page Animations ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.livora-title-animated {
  animation: fadeInUp 1s ease-out;
}

.livora-subtitle-animated {
  animation: fadeInUp 1s ease-out 0.2s both;
}

.livora-content-animated {
  animation: fadeInUp 1s ease-out 0.4s both;
}

.livora-stats-animated {
  animation: fadeInUp 1s ease-out 0.6s both;
}

/* ========== Smooth Scroll Animations ========== */
.livora-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.livora-section.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Hero Overlay Animation ========== */
.livora-hero-with-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(212, 160, 131, 0.8) 0%, rgba(200, 161, 101, 0.6) 100%);
  z-index: 0;
}

.livora-hero-with-overlay > * {
  position: relative;
  z-index: 1;
}

/* ========== Staggered List Animation ========== */
.livora-benefits-list li,
.livora-badges-list .livora-badge {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.livora-benefits-list li:nth-child(1),
.livora-badges-list .livora-badge:nth-child(1) {
  animation-delay: 0.1s;
}

.livora-benefits-list li:nth-child(2),
.livora-badges-list .livora-badge:nth-child(2) {
  animation-delay: 0.2s;
}

.livora-benefits-list li:nth-child(3),
.livora-badges-list .livora-badge:nth-child(3) {
  animation-delay: 0.3s;
}

.livora-benefits-list li:nth-child(4),
.livora-badges-list .livora-badge:nth-child(4) {
  animation-delay: 0.4s;
}

.livora-benefits-list li:nth-child(5),
.livora-badges-list .livora-badge:nth-child(5) {
  animation-delay: 0.5s;
}

/* ========== Card Hover Effects ========== */
.livora-category-card,
.livora-stat-item,
.livora-stage-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.livora-category-card:hover,
.livora-stat-item:hover,
.livora-stage-item:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 12px 30px rgba(72, 56, 36, 0.2);
}

/* ========== Button Pulse on Hover ========== */
.livora-btn {
  position: relative;
  overflow: hidden;
}

.livora-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.livora-btn:hover::before {
  width: 300px;
  height: 300px;
}

/* ========== Loading States ========== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.livora-loading-shimmer {
  animation: shimmer 2s infinite;
  background: linear-gradient(to right, #f0f0f0 0%, #e0e0e0 20%, #f0f0f0 40%, #f0f0f0 100%);
  background-size: 1000px 100%;
}

/* ========== Reduce Motion (Accessibility) ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .livora-section {
    opacity: 1;
    transform: none;
  }
}

