/**
 * LIVA LIFESTYLE - Enhanced Animations & Transitions
 * Smooth hover effects, micro-interactions, and page transitions
 */

/* Enhanced Button Animations */
.btn {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--liva-primary) 0%, var(--liva-primary-dark) 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px rgba(179, 0, 0, 0.3);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
}

/* Card Hover Effects */
.card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(179, 0, 0, 0.05) 0%, rgba(179, 0, 0, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Product Card Specific Animations */
.product-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.product-card .product-image {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image {
  transform: scale(1.1);
}

.product-card .product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(179, 0, 0, 0.8) 0%, rgba(179, 0, 0, 0.6) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-card .product-actions {
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.product-card:hover .product-actions {
  transform: translateY(0);
  opacity: 1;
}

/* Navigation Animations */
.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--liva-primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Form Input Animations */
.form-input {
  transition: all 0.3s ease;
  position: relative;
}

.form-input:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 4px rgba(179, 0, 0, 0.1);
}

.form-input.error {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Loading Animations */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(179, 0, 0, 0.1);
  border-left: 4px solid var(--liva-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--liva-primary);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Page Transition Animations */
.page-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-exit {
  opacity: 1;
  transform: translateY(0);
}

.page-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Stagger Animation for Lists */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: staggerIn 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Animations */
.modal-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
}

.modal-content {
  transform: scale(0.9) translateY(-50px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Toast Notifications */
.toast {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: linear-gradient(135deg, var(--liva-success) 0%, #059669 100%);
}

.toast.error {
  background: linear-gradient(135deg, var(--liva-error) 0%, #DC2626 100%);
}

.toast.warning {
  background: linear-gradient(135deg, var(--liva-warning) 0%, #D97706 100%);
}

.toast.info {
  background: linear-gradient(135deg, var(--liva-info) 0%, #2563EB 100%);
}

/* Floating Action Button - REMOVED to prevent conflict with WhatsApp button */
/* .fab class removed - using .whatsapp-float instead */

/* Pulse Animation for Important Elements */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Bounce Animation for CTAs */
.bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

/* Slide Animations */
.slide-in-left {
  transform: translateX(-100%);
  animation: slideInLeft 0.5s ease forwards;
}

.slide-in-right {
  transform: translateX(100%);
  animation: slideInRight 0.5s ease forwards;
}

.slide-in-up {
  transform: translateY(100%);
  animation: slideInUp 0.5s ease forwards;
}

.slide-in-down {
  transform: translateY(-100%);
  animation: slideInDown 0.5s ease forwards;
}

@keyframes slideInLeft {
  to { transform: translateX(0); }
}

@keyframes slideInRight {
  to { transform: translateX(0); }
}

@keyframes slideInUp {
  to { transform: translateY(0); }
}

@keyframes slideInDown {
  to { transform: translateY(0); }
}

/* Fade Animations */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in-down {
  opacity: 0;
  transform: translateY(-30px);
  animation: fadeInDown 0.6s ease forwards;
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  animation: fadeInLeft 0.6s ease forwards;
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  animation: fadeInRight 0.6s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale Animations */
.scale-in {
  transform: scale(0);
  animation: scaleIn 0.4s ease forwards;
}

.scale-in-center {
  transform: scale(0);
  animation: scaleInCenter 0.4s ease forwards;
}

@keyframes scaleIn {
  to { transform: scale(1); }
}

@keyframes scaleInCenter {
  to { transform: scale(1); }
}

/* Rotate Animations */
.rotate-in {
  transform: rotate(-180deg);
  animation: rotateIn 0.6s ease forwards;
}

@keyframes rotateIn {
  to { transform: rotate(0deg); }
}

/* Hover Effects for Interactive Elements */
.hover-lift {
  transition: transform 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(179, 0, 0, 0.3);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .btn:hover {
    transform: none;
  }
  
  .card:hover {
    transform: none;
  }
  
  .product-card:hover .product-image {
    transform: none;
  }
  
  /* .fab removed - using .whatsapp-float instead */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
