/**
 * Animations CSS
 * Well+Therme - Premium animations and effects
 */

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

/* Base reveal state */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0, 0, 0.2, 1), 
              transform 0.8s cubic-bezier(0, 0, 0.2, 1);
}

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

/* Reveal variants */
.reveal--left {
  transform: translateX(-50px);
}

.reveal--left.revealed {
  transform: translateX(0);
}

.reveal--right {
  transform: translateX(50px);
}

.reveal--right.revealed {
  transform: translateX(0);
}

.reveal--scale {
  transform: scale(0.95);
}

.reveal--scale.revealed {
  transform: scale(1);
}

/* ============================================
   STAGGER ANIMATIONS
   ============================================ */

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

.stagger-children.revealed > * {
  animation: fadeInUp 0.6s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.stagger-children.revealed > *:nth-child(1) { animation-delay: 0s; }
.stagger-children.revealed > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children.revealed > *:nth-child(3) { animation-delay: 0.2s; }
.stagger-children.revealed > *:nth-child(4) { animation-delay: 0.3s; }
.stagger-children.revealed > *:nth-child(5) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   HERO-SPECIFIC ANIMATIONS
   ============================================ */

/* Gradient mesh shift for hero background */
@keyframes gradientShift {
  0%, 100% {
    opacity: 0.9;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Corner dot pulse animation */
@keyframes cornerDotPulse {
  0%, 100% {
    opacity: 0.15;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.5);
  }
}

/* Orbit ring rotation */
@keyframes orbitRotate {
  from { 
    transform: translate(-50%, -50%) rotate(0deg); 
  }
  to { 
    transform: translate(-50%, -50%) rotate(360deg); 
  }
}

/* Orbit ring pulse effect */
@keyframes orbitPulse {
  0%, 100% {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.1);
  }
  50% {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.15);
  }
}

/* Background orb floating */
@keyframes orbFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -20px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 10px) scale(0.95);
  }
}

/* Floating card animation - vertical only */
@keyframes floatCard {
  0%, 100% {
    transform: translateY(-5px);
  }
  50% {
    transform: translateY(5px);
  }
}

/* Product subtle float */
@keyframes subtleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ============================================
   CARD ENHANCEMENTS
   ============================================ */

/* Product card premium hover */
.card--product {
  position: relative;
  overflow: visible !important;
}

.card--product::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--brand-bright) 0%, var(--brand-accent) 100%);
  border-radius: calc(var(--radius-2xl) + 2px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s var(--ease-out);
}

.card--product:hover::before {
  opacity: 1;
}

.card--product::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-2xl);
  box-shadow: 0 20px 40px rgba(27, 77, 62, 0.15);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  z-index: -1;
}

.card--product:hover::after {
  opacity: 1;
}

/* Card image enhancement */
.card__image-wrapper {
  position: relative;
  overflow: hidden;
}

.card__image-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(255,255,255,0.3) 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  z-index: 1;
}

.card--product:hover .card__image-wrapper::before {
  opacity: 1;
}

/* Card content slide up on hover */
.card__content {
  transition: transform 0.3s var(--ease-out);
}

.card--product:hover .card__content {
  transform: translateY(-4px);
}

/* ============================================
   TESTIMONIAL ENHANCEMENTS
   ============================================ */

.testimonial {
  position: relative;
  transition: all 0.4s var(--ease-out);
}

.testimonial:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.testimonial::before {
  content: '"';
  position: absolute;
  top: var(--space-4);
  right: var(--space-5);
  font-family: var(--font-heading);
  font-size: 80px;
  color: var(--brand-bright);
  opacity: 0.1;
  line-height: 1;
  transition: all 0.4s var(--ease-out);
}

.testimonial:hover::before {
  opacity: 0.3;
  transform: scale(1.1) rotate(-5deg);
}

/* Quote text enhancement */
.testimonial__quote {
  transition: color 0.3s var(--ease-out);
}

.testimonial:hover .testimonial__quote {
  color: var(--text-primary);
}

/* Avatar glow on hover */
.testimonial__avatar {
  transition: all 0.4s var(--ease-out);
}

.testimonial:hover .testimonial__avatar {
  box-shadow: 0 0 0 4px var(--brand-accent-soft);
  transform: scale(1.05);
}

/* ============================================
   PILLAR ENHANCEMENTS
   ============================================ */

.pillar {
  position: relative;
  transition: all 0.4s var(--ease-out);
}

.pillar:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.pillar__number {
  transition: all 0.4s var(--ease-out);
}

.pillar:hover .pillar__number {
  opacity: 0.5;
  transform: scale(1.1);
}

.pillar__check {
  transition: all 0.3s var(--ease-out);
}

.pillar:hover .pillar__check {
  background: var(--brand-bright);
  transform: scale(1.2);
}

/* ============================================
   TRUST BADGE ENHANCEMENTS
   ============================================ */

.trust-badge {
  transition: all 0.3s var(--ease-out);
}

.trust-badge:hover {
  transform: translateY(-4px);
}

.trust-badge__icon {
  transition: all 0.3s var(--ease-out);
}

.trust-badge:hover .trust-badge__icon {
  transform: scale(1.1);
  color: var(--brand-bright);
}

/* ============================================
   CTA SECTION ENHANCEMENTS
   ============================================ */

.cta {
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.cta__container {
  position: relative;
  z-index: 1;
}

/* ============================================
   NAVIGATION SCROLL EFFECTS
   ============================================ */

.nav {
  transition: all 0.3s var(--ease-out);
}

.nav--scrolled {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
}

.nav--scrolled .nav__logo,
.nav--scrolled .nav__link {
  color: var(--text-primary) !important;
}

/* ============================================
   FLOATING ELEMENT ANIMATIONS - Enhanced
   ============================================ */

.hero__floating--1 {
  animation: floatCard 4s ease-in-out infinite;
  animation-delay: 0s;
}

.hero__floating--2 {
  animation: floatCard 4s ease-in-out infinite;
  animation-delay: 2s;
}

/* New floating card animation - translateY only */
@keyframes floatCard {
  0%, 100% {
    transform: translateY(-5px);
  }
  50% {
    transform: translateY(5px);
  }
}

/* Legacy float animation kept for backward compatibility */
@keyframes float-1 {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-15px) translateX(5px);
  }
  50% {
    transform: translateY(-5px) translateX(-5px);
  }
  75% {
    transform: translateY(-20px) translateX(0);
  }
}

@keyframes float-2 {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  33% {
    transform: translateY(-10px) translateX(-8px);
  }
  66% {
    transform: translateY(-20px) translateX(5px);
  }
}

/* ============================================
   GRADIENT MESH SHIFT ANIMATION
   ============================================ */

@keyframes gradientShift {
  0%, 100% {
    opacity: 0.9;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* ============================================
   CORNER DOT PULSE ANIMATION
   ============================================ */

@keyframes cornerDotPulse {
  0%, 100% {
    opacity: 0.15;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.5);
  }
}

/* ============================================
   ORBIT RING ANIMATIONS
   ============================================ */

@keyframes orbitPulse {
  0%, 100% {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.1);
  }
  50% {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.15);
  }
}

@keyframes orbitRotate {
  from { 
    transform: translate(-50%, -50%) rotate(0deg); 
  }
  to { 
    transform: translate(-50%, -50%) rotate(360deg); 
  }
}

/* ============================================
   BACKGROUND ORB FLOAT ANIMATION
   ============================================ */

@keyframes orbFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -20px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 10px) scale(0.95);
  }
}

/* ============================================
   BUTTON MICRO-ANIMATIONS
   ============================================ */

.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease-out);
}

.btn:hover::after {
  transform: translateX(100%);
}

/* Button ripple effect */
.btn:active {
  transform: scale(0.98);
}

/* ============================================
   STAT NUMBER ANIMATION
   ============================================ */

.stat-item__number,
.hero__stat-number {
  transition: all 0.3s var(--ease-out);
}

.stat-item:hover .stat-item__number,
.hero__stat:hover .hero__stat-number {
  transform: scale(1.1);
  color: var(--brand-accent);
}

/* ============================================
   IMAGE HOVER EFFECTS
   ============================================ */

/* Product image shine effect */
.card__image-wrapper::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  transform: rotate(30deg) translateX(-100%);
  transition: transform 0.8s var(--ease-out);
  z-index: 2;
  pointer-events: none;
}

.card--product:hover .card__image-wrapper::after {
  transform: rotate(30deg) translateX(100%);
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--neutral-100) 0%,
    var(--neutral-200) 50%,
    var(--neutral-100) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  .reveal,
  .stagger-children > *,
  .hero__floating--1,
  .hero__floating--2,
  .cta::before {
    animation: none !important;
    transition: opacity 0.3s ease !important;
  }
}

/* ============================================
   FOCUS STATES ENHANCEMENT
   ============================================ */

:focus-visible {
  outline: 3px solid var(--brand-bright);
  outline-offset: 4px;
  transition: outline-offset 0.15s var(--ease-out);
}

/* ============================================
   SCROLLBAR ENHANCEMENT
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-bright);
}
