/* ==========================================================================
   ANIMATIONS PREMIUM - Sistema de Animações Avançadas
   Inspirado no n8n.io com foco em performance e conversão
   ========================================================================== */

/* Lightning Bolt Animations */
.lightning-bolt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightning-svg {
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.7));
}

.lightning-inner {
  fill: #FF6B35;
  animation: lightning-core 2s ease-in-out infinite;
}

.lightning-outer {
  fill: rgba(255, 107, 53, 0.3);
  animation: lightning-aura 2s ease-in-out infinite 0.1s;
}

.lightning-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.4), transparent 70%);
  border-radius: 50%;
  animation: lightning-pulse 1.5s ease-in-out infinite;
  z-index: 1;
}

@keyframes lightning-core {
  0%, 100% { 
    fill: #FF6B35;
    filter: brightness(1);
  }
  25% { 
    fill: #FF3366;
    filter: brightness(1.3);
  }
  50% { 
    fill: #FF6B35;
    filter: brightness(1.5);
  }
  75% { 
    fill: #FFA500;
    filter: brightness(1.2);
  }
}

@keyframes lightning-aura {
  0%, 100% { 
    opacity: 0.3;
    transform: scale(1);
  }
  50% { 
    opacity: 0.6;
    transform: scale(1.2);
  }
}

@keyframes lightning-pulse {
  0%, 100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.5);
  }
}

/* Particle System */
.particle-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-orange);
  animation: particle-float 8s linear infinite;
  opacity: 0;
}

.particle.small {
  width: 2px;
  height: 2px;
  background: var(--accent-blue);
}

.particle.medium {
  width: 3px;
  height: 3px;
  background: var(--accent-purple);
}

.particle.large {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
}

@keyframes particle-float {
  0% {
    opacity: 0;
    transform: translateY(100vh) translateX(0) scale(0);
  }
  10% {
    opacity: 1;
    transform: translateY(90vh) translateX(10px) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateY(50vh) translateX(-20px) scale(1.2);
  }
  90% {
    opacity: 0.3;
    transform: translateY(10vh) translateX(30px) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) translateX(0) scale(0);
  }
}

/* Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

.reveal-rotate {
  opacity: 0;
  transform: rotate(-10deg) scale(0.8);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-rotate.revealed {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Stagger Animations */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* Magnetic Effect */
.magnetic {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.magnetic:hover {
  transform: scale(1.05);
}

/* Workflow Animation */
.workflow-step {
  opacity: 0.6;
  transform: scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.workflow-step.active {
  opacity: 1;
  transform: scale(1);
  border-color: var(--accent-orange);
  box-shadow: var(--glow-orange);
}

.workflow-step.animated {
  animation: workflow-pulse 2s ease-in-out;
}

@keyframes workflow-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 107, 53, 0);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
  }
}

.workflow-connector {
  position: relative;
}

.progress-line {
  position: absolute;
  top: 50%;
  left: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
  width: 0;
  transition: width 1s ease-in-out;
  transform: translateY(-50%);
}

.progress-line.animate {
  width: 100%;
}

.progress-dot {
  position: absolute;
  top: 50%;
  right: -6px;
  width: 12px;
  height: 12px;
  background: var(--accent-orange);
  border-radius: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform 0.3s ease-in-out;
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.progress-dot.show {
  transform: translateY(-50%) scale(1);
}

/* Morphing Shapes */
.morphing-shape {
  position: absolute;
  width: 100px;
  height: 100px;
  background: var(--accent-gradient);
  border-radius: 50%;
  opacity: 0.1;
  animation: morphing 8s ease-in-out infinite;
}

.morphing-shape.shape-1 {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.morphing-shape.shape-2 {
  top: 70%;
  right: 20%;
  animation-delay: 2s;
}

.morphing-shape.shape-3 {
  bottom: 20%;
  left: 60%;
  animation-delay: 4s;
}

@keyframes morphing {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    border-radius: 50%;
  }
  25% {
    transform: scale(1.2) rotate(90deg);
    border-radius: 25%;
  }
  50% {
    transform: scale(0.8) rotate(180deg);
    border-radius: 10px;
  }
  75% {
    transform: scale(1.1) rotate(270deg);
    border-radius: 30px;
  }
}

/* Typing Animation */
.typing-text {
  border-right: 2px solid var(--accent-orange);
  animation: typing-cursor 1s infinite;
}

@keyframes typing-cursor {
  0%, 50% { border-color: var(--accent-orange); }
  51%, 100% { border-color: transparent; }
}

.typing-container .char {
  opacity: 0;
  animation: type-char 0.1s ease-in-out forwards;
}

@keyframes type-char {
  to { opacity: 1; }
}

/* Hover Glow Effects */
.glow-hover {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-hover::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--accent-gradient);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  z-index: -1;
  filter: blur(10px);
}

.glow-hover:hover::before {
  opacity: 0.3;
}

/* Loading Animations */
.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
  animation: loading-bounce 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes loading-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Progress Ring */
.progress-ring {
  width: 120px;
  height: 120px;
}

.progress-ring-circle {
  stroke: var(--glass-border);
  stroke-width: 4;
  fill: transparent;
  r: 54;
  cx: 60;
  cy: 60;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 2s ease-in-out;
}

.progress-ring-active .progress-ring-circle {
  stroke: var(--accent-orange);
  stroke-dashoffset: 0;
}

.progress-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--accent-orange);
}

/* 3D Card Flip */
.flip-card {
  perspective: 1000px;
  height: 300px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
}

.flip-card-front {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.flip-card-back {
  background: var(--accent-gradient);
  color: white;
  transform: rotateY(180deg);
}

/* Gradient Text Animation */
.gradient-text {
  background: linear-gradient(
    45deg,
    var(--accent-orange),
    var(--accent-red),
    var(--accent-purple),
    var(--accent-blue),
    var(--accent-green)
  );
  background-size: 400% 400%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-flow 4s ease-in-out infinite;
}

@keyframes gradient-flow {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 50%; }
  50% { background-position: 200% 50%; }
  75% { background-position: 300% 50%; }
}

/* Parallax Layers */
.parallax-container {
  position: relative;
  overflow: hidden;
}

.parallax-layer {
  position: absolute;
  inset: 0;
}

.parallax-layer-1 {
  transform: translateZ(0) scale(1);
}

.parallax-layer-2 {
  transform: translateZ(-1px) scale(2);
}

.parallax-layer-3 {
  transform: translateZ(-2px) scale(3);
}

/* Breath Animation */
.breathing {
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Shake Animation */
.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Bounce In */
.bounce-in {
  animation: bounce-in 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide In Directions */
.slide-in-top {
  animation: slide-in-top 0.8s ease-out;
}

.slide-in-bottom {
  animation: slide-in-bottom 0.8s ease-out;
}

.slide-in-left {
  animation: slide-in-left 0.8s ease-out;
}

.slide-in-right {
  animation: slide-in-right 0.8s ease-out;
}

@keyframes slide-in-top {
  from {
    opacity: 0;
    transform: translateY(-100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-bottom {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Rotation Animations */
.rotate-360 {
  animation: rotate-360 2s linear infinite;
}

@keyframes rotate-360 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotate-y {
  animation: rotate-y 3s ease-in-out infinite;
}

@keyframes rotate-y {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

/* Glitch Effect */
.glitch {
  position: relative;
  color: var(--text-primary);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch-1 2s infinite linear alternate-reverse;
  color: var(--accent-red);
  z-index: -1;
}

.glitch::after {
  animation: glitch-2 2s infinite linear alternate-reverse;
  color: var(--accent-blue);
  z-index: -2;
}

@keyframes glitch-1 {
  0% {
    clip: rect(42px, 9999px, 44px, 0);
    transform: skew(0.5deg);
  }
  5% {
    clip: rect(12px, 9999px, 59px, 0);
    transform: skew(0.4deg);
  }
  10% {
    clip: rect(25px, 9999px, 30px, 0);
    transform: skew(0.1deg);
  }
  /* ... continue pattern ... */
  100% {
    clip: rect(86px, 9999px, 31px, 0);
    transform: skew(0.5deg);
  }
}

@keyframes glitch-2 {
  0% {
    clip: rect(65px, 9999px, 119px, 0);
    transform: skew(0.8deg);
  }
  5% {
    clip: rect(79px, 9999px, 19px, 0);
    transform: skew(0.2deg);
  }
  10% {
    clip: rect(68px, 9999px, 11px, 0);
    transform: skew(0.6deg);
  }
  /* ... continue pattern ... */
  100% {
    clip: rect(69px, 9999px, 66px, 0);
    transform: skew(0.3deg);
  }
}

/* Infinite Scroll */
.infinite-scroll {
  overflow: hidden;
  white-space: nowrap;
}

.scroll-content {
  display: inline-block;
  animation: scroll-infinite 20s linear infinite;
}

@keyframes scroll-infinite {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Neon Glow */
.neon-glow {
  color: var(--accent-orange);
  text-shadow: 
    0 0 5px var(--accent-orange),
    0 0 10px var(--accent-orange),
    0 0 15px var(--accent-orange),
    0 0 20px var(--accent-orange);
  animation: neon-flicker 2s infinite alternate;
}

@keyframes neon-flicker {
  0%, 100% {
    text-shadow: 
      0 0 5px var(--accent-orange),
      0 0 10px var(--accent-orange),
      0 0 15px var(--accent-orange),
      0 0 20px var(--accent-orange);
  }
  50% {
    text-shadow: 
      0 0 2px var(--accent-orange),
      0 0 5px var(--accent-orange),
      0 0 8px var(--accent-orange),
      0 0 12px var(--accent-orange);
  }
}

/* Performance Optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform, opacity;
}

.smooth-animation {
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .lightning-bolt,
  .particle,
  .morphing-shape,
  .breathing,
  .rotate-360,
  .rotate-y,
  .infinite-scroll .scroll-content,
  .neon-glow {
    animation: none !important;
  }
  
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-rotate,
  .stagger-item {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
