/**
 * TINGLE DIGITAL - Animations Library
 * Biblioteca completa de animações CSS
 *
 * @version 1.0.0
 */

/* ============================================
 * FLOATING ANIMATIONS
 * Elementos flutuantes
 * ============================================ */

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(2deg);
  }
  50% {
    transform: translateY(-10px) rotate(-1deg);
  }
  75% {
    transform: translateY(-25px) rotate(1deg);
  }
}

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

@keyframes float-reverse {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(20px);
  }
}

/* Classes de floating */
.float {
  animation: float 6s ease-in-out infinite;
}

.float-slow {
  animation: float-slow 8s ease-in-out infinite;
}

.float-fast {
  animation: float 4s ease-in-out infinite;
}

.float-delay-1 { animation-delay: 0.5s; }
.float-delay-2 { animation-delay: 1s; }
.float-delay-3 { animation-delay: 1.5s; }
.float-delay-4 { animation-delay: 2s; }
.float-delay-5 { animation-delay: 2.5s; }

/* ============================================
 * PULSE ANIMATIONS
 * Pulsação e glow
 * ============================================ */

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

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
    filter: blur(20px);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
    filter: blur(30px);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

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

.pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* ============================================
 * GRADIENT ANIMATIONS
 * Movimento de gradientes
 * ============================================ */

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes gradient-rotate {
  0% {
    background-position: 0% 0%;
  }
  25% {
    background-position: 100% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  75% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

@keyframes aurora {
  0%, 100% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 50% 100%;
  }
  50% {
    background-position: 100% 50%;
  }
  75% {
    background-position: 50% 0%;
  }
}

.gradient-animated {
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}

.gradient-aurora {
  background: var(--gradient-aurora);
  background-size: 400% 400%;
  animation: aurora 15s ease infinite;
}

/* ============================================
 * BLOB MORPHING
 * Formas orgânicas animadas
 * ============================================ */

@keyframes blob-morph {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  50% {
    border-radius: 50% 60% 30% 60% / 30% 40% 70% 60%;
  }
  75% {
    border-radius: 60% 40% 60% 30% / 70% 50% 40% 60%;
  }
}

@keyframes blob-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  25% {
    transform: translate(30px, -50px) scale(1.1);
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
    border-radius: 50% 60% 30% 60% / 30% 40% 70% 60%;
  }
  75% {
    transform: translate(20px, 30px) scale(1.05);
    border-radius: 60% 40% 60% 30% / 70% 50% 40% 60%;
  }
}

.blob {
  animation: blob-morph 8s ease-in-out infinite;
}

.blob-float {
  animation: blob-float 15s ease-in-out infinite;
}

/* ============================================
 * WAVE ANIMATIONS
 * Ondas fluidas
 * ============================================ */

@keyframes wave-move {
  0% {
    transform: translateX(-90px);
  }
  100% {
    transform: translateX(85px);
  }
}

@keyframes wave-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ============================================
 * ENTRANCE ANIMATIONS
 * Animações de entrada
 * ============================================ */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-in-right {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scale-in-bounce {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes blur-in {
  from {
    opacity: 0;
    filter: blur(20px);
    transform: scale(1.1);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

@keyframes flip-in-x {
  from {
    opacity: 0;
    transform: perspective(1000px) rotateX(-90deg);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) rotateX(0);
  }
}

@keyframes flip-in-y {
  from {
    opacity: 0;
    transform: perspective(1000px) rotateY(-90deg);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) rotateY(0);
  }
}

@keyframes slide-up-reveal {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes slide-left-reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* Classes de entrada */
.animate-fade-in {
  animation: fade-in var(--duration-normal) var(--ease-out) forwards;
}

.animate-fade-in-up {
  animation: fade-in-up var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-down {
  animation: fade-in-down var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-left {
  animation: fade-in-left var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-right {
  animation: fade-in-right var(--duration-slow) var(--ease-out) forwards;
}

.animate-scale-in {
  animation: scale-in var(--duration-normal) var(--ease-bounce) forwards;
}

.animate-blur-in {
  animation: blur-in var(--duration-slow) var(--ease-out) forwards;
}

.animate-flip-in-x {
  animation: flip-in-x var(--duration-slow) var(--ease-out) forwards;
}

.animate-flip-in-y {
  animation: flip-in-y var(--duration-slow) var(--ease-out) forwards;
}

/* ============================================
 * SPLIT TEXT ANIMATIONS
 * Para texto caractere por caractere
 * ============================================ */

@keyframes char-reveal {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes char-reveal-blur {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes char-bounce {
  0% {
    opacity: 0;
    transform: translateY(-50px) scale(0.5);
  }
  60% {
    transform: translateY(10px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.split-text .char {
  display: inline-block;
  opacity: 0;
}

.split-text.animate .char {
  animation: char-reveal 0.5s var(--ease-out) forwards;
  animation-delay: calc(var(--char-index, 0) * 0.03s);
}

.split-text.animate-blur .char {
  animation: char-reveal-blur 0.6s var(--ease-out) forwards;
  animation-delay: calc(var(--char-index, 0) * 0.04s);
}

/* ============================================
 * TYPING EFFECT
 * Efeito de digitação
 * ============================================ */

@keyframes blink-cursor {
  0%, 100% {
    border-color: var(--tingle-purple);
  }
  50% {
    border-color: transparent;
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typed-text {
  display: inline-block;
  border-right: 3px solid var(--tingle-purple);
  padding-right: 5px;
  animation: blink-cursor 0.7s infinite;
  white-space: nowrap;
  overflow: hidden;
}

/* ============================================
 * HOVER ANIMATIONS
 * Efeitos de hover
 * ============================================ */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1); }
  50% { transform: scale(1); }
  75% { transform: scale(1.1); }
}

.hover-shake:hover {
  animation: shake 0.5s ease;
}

.hover-wiggle:hover {
  animation: wiggle 0.3s ease;
}

.hover-heartbeat:hover {
  animation: heartbeat 0.6s ease;
}

/* ============================================
 * SCROLL INDICATOR
 * Indicador de scroll
 * ============================================ */

@keyframes scroll-indicator {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes scroll-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

.scroll-indicator {
  animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-indicator-fade {
  animation: scroll-indicator 2s ease-in-out infinite;
}

/* ============================================
 * RIPPLE EFFECT
 * Efeito de ondulação no clique
 * ============================================ */

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

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

/* ============================================
 * SHINE EFFECT
 * Brilho deslizante
 * ============================================ */

@keyframes shine {
  0% {
    transform: translateX(-100%) skewX(-15deg);
  }
  100% {
    transform: translateX(200%) skewX(-15deg);
  }
}

.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: translateX(-100%) skewX(-15deg);
}

.shine-effect:hover::after {
  animation: shine 0.75s ease;
}

/* ============================================
 * ROTATION ANIMATIONS
 * Rotações contínuas
 * ============================================ */

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

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

.spin-slow {
  animation: spin-slow 8s linear infinite;
}

/* ============================================
 * ORBIT ANIMATION
 * Movimento orbital
 * ============================================ */

@keyframes orbit {
  0% {
    transform: rotate(0deg) translateX(100px) rotate(0deg);
  }
  100% {
    transform: rotate(360deg) translateX(100px) rotate(-360deg);
  }
}

.orbit {
  animation: orbit 20s linear infinite;
}

.orbit-slow {
  animation: orbit 30s linear infinite;
}

.orbit-reverse {
  animation: orbit 20s linear infinite reverse;
}

/* ============================================
 * COUNTER ANIMATION
 * Para números que incrementam
 * ============================================ */

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

.counter-animate {
  animation: count-up 0.5s var(--ease-out) forwards;
}

/* ============================================
 * LOADING ANIMATIONS
 * Indicadores de carregamento
 * ============================================ */

@keyframes loading-dots {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes loading-bar {
  0% {
    transform: scaleX(0);
    transform-origin: left;
  }
  50% {
    transform: scaleX(1);
    transform-origin: left;
  }
  50.1% {
    transform-origin: right;
  }
  100% {
    transform: scaleX(0);
    transform-origin: right;
  }
}

.loading-dots span {
  animation: loading-dots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

/* ============================================
 * UTILITY CLASSES
 * Para controle de animações
 * ============================================ */

.animation-paused {
  animation-play-state: paused !important;
}

.animation-running {
  animation-play-state: running !important;
}

/* Delays utilitários */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-700 { animation-delay: 700ms; }
.delay-1000 { animation-delay: 1000ms; }

/* Durações utilitárias */
.duration-fast { animation-duration: var(--duration-fast); }
.duration-normal { animation-duration: var(--duration-normal); }
.duration-slow { animation-duration: var(--duration-slow); }
.duration-slower { animation-duration: var(--duration-slower); }

/* Will-change para performance */
.will-animate {
  will-change: transform, opacity;
}

.will-animate-transform {
  will-change: transform;
}

/* GPU acceleration */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
}
