/* about-animations.css */

/* ===== KEYFRAMES PARA ANIMAÇÕES ===== */

/* Animação principal de entrada para o card */
@keyframes aboutCardReveal {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 
      0 20px 40px rgba(0, 0, 0, 0.12),
      0 0 0 1px rgba(255, 255, 255, 0.1);
  }
}

/* Animação para gradientes de fundo */
@keyframes gradientFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.15;
  }
  50% {
    transform: translate(0, -15px) scale(1.05);
    opacity: 0.2;
  }
}

/* Animação para formas de fundo */
@keyframes shapeMorph {
  0%, 100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    transform: rotate(0deg);
  }
  25% {
    border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
    transform: rotate(5deg);
  }
  50% {
    border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    transform: rotate(0deg);
  }
  75% {
    border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
    transform: rotate(-5deg);
  }
}

/* Animação para o padrão de pontos */
@keyframes dotsReveal {
  0% {
    opacity: 0;
    transform: scale(1.2);
  }
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
}

/* Animação para título e subtítulo */
@keyframes titleReveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Animação para texto de descrição */
@keyframes textSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animação para a imagem */
@keyframes imageReveal {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.8) rotateY(-15deg);
    filter: blur(8px);
  }
  40% {
    opacity: 0.8;
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateY(0deg);
    filter: blur(0);
  }
}

/* Animação para o brilho ao redor da imagem */
@keyframes glowPulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.95);
    filter: blur(15px);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
    filter: blur(20px);
  }
}

/* Animação para cada letra do gradiente */
@keyframes letterFadeInAbout {
  0% {
    background-color: transparent;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    filter: blur(5px);
  }
  100% {
    background-color: linear-gradient(135deg, #fc6dab 0%, #ffb66d 100%);
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Animação para item de métrica */
@keyframes metricReveal {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animação para ícones de métrica */
@keyframes iconPop {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(10deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Animação para contador de valor */
@keyframes counterReveal {
  0% {
    opacity: 0;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animação para linhas de conexão */
@keyframes lineGrow {
  0% {
    width: 0;
    opacity: 0;
  }
  100% {
    width: 100%;
    opacity: 0.8;
  }
}

/* ===== APLICAÇÃO DE ANIMAÇÕES ===== */

/* Container principal com estado inicial */
.about {
  perspective: 1000px;
  overflow: hidden;
}
/* Classe aplicada por JS quando a seção fica visível */
.about.animate-in .about-card {
  animation: aboutCardReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Estado inicial do cartão */
.about-card {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transform-style: preserve-3d;
}

/* Elementos de fundo */
.bg-gradient {
  opacity: 0;
  transition: opacity 1s ease;
}

.about.animate-in .bg-gradient {
  opacity: 1;
}

.bg-shape {
  opacity: 0;
  transition: opacity 1s ease, transform 1s ease;
}

.about.animate-in .bg-shape {
  opacity: 0.15;
  animation: shapeMorph 20s ease-in-out infinite;
}

.about.animate-in .shape-1 {
  animation-delay: 0.2s;
}

.about.animate-in .shape-2 {
  animation-delay: 0.5s;
}

.about.animate-in .shape-3 {
  animation-delay: 0.8s;
}

.bg-dots-pattern {
  opacity: 0;
  transform: scale(1.2);
}

.about.animate-in .bg-dots-pattern {
  animation: dotsReveal 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

.about.animate-in .about-subtitle {
  animation: titleReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
}

.about.animate-in .about-heading {
  animation: titleReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.0s forwards;
}

/* Revelação de letra por letra para o texto do gradiente */
.gradient-text-about .gradient-letter {
  display: inline-block;
  opacity: 0;
  background: inherit;
  background-clip: text;
  -webkit-background-clip: text;
  /* color: transparent; */
}

.about.animate-in .gradient-text-about .gradient-letter {
  animation: letterFadeInAbout 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Blocos de descrição */
.about-description-wrapper {
  opacity: 0;
  transform: translateX(-30px);
}

.about.animate-in .about-description-wrapper:nth-child(3) {
  animation: textSlideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.4s forwards;
}

.about.animate-in .about-description-wrapper:nth-child(4) {
  animation: textSlideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.7s forwards;
}

/* Ícones de descrição */
.description-icon {
  opacity: 0;
  transform: scale(0) rotate(-45deg);
}

.about.animate-in .about-description-wrapper:nth-child(3) .description-icon {
  animation: iconPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.5s forwards;
}

.about.animate-in .about-description-wrapper:nth-child(4) .description-icon {
  animation: iconPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s forwards;
}

/* Container da imagem */
.about-image-container {
  opacity: 0;
  transform: translateY(40px) scale(0.8) rotateY(-15deg);
  transform-style: preserve-3d;
}

.about.animate-in .about-image-container {
  animation: imageReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) 1.2s forwards;
}

/* Estatísticas */
.about-metrics {
  position: relative;
}

/* Linha de separação com animação de crescimento */
.about-metrics::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  height: 1px;
  width: 0;
  background: linear-gradient(to right, 
    rgba(255, 255, 255, 0.1), 
    rgba(255, 255, 255, 0.2), 
    rgba(255, 255, 255, 0.1));
  opacity: 0;
}

.about.animate-in .about-metrics::before {
  animation: lineGrow 0.8s cubic-bezier(0.22, 1, 0.36, 1) 2.0s forwards;
}

/* Itens de métrica */
.metric-item {
  opacity: 0;
  transform: translateY(30px);
}

.about.animate-in .metric-item:nth-child(1) {
  animation: metricReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 2.2s forwards;
}

.about.animate-in .metric-item:nth-child(2) {
  animation: metricReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 2.4s forwards;
}

.about.animate-in .metric-item:nth-child(3) {
  animation: metricReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 2.6s forwards;
}

/* Ícones de métricas */
.metric-icon {
  opacity: 0;
  transform: scale(0) rotate(-45deg);
}

.about.animate-in .metric-item:nth-child(1) .metric-icon {
  animation: iconPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 2.3s forwards;
}

.about.animate-in .metric-item:nth-child(2) .metric-icon {
  animation: iconPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 2.5s forwards;
}

.about.animate-in .metric-item:nth-child(3) .metric-icon {
  animation: iconPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 2.7s forwards;
}

.about.animate-in .metric-item:nth-child(1) .metric-value-about {
  animation: counterReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 2.4s forwards;
}

.about.animate-in .metric-item:nth-child(2) .metric-value-about {
  animation: counterReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 2.6s forwards;
}

.about.animate-in .metric-item:nth-child(3) .metric-value-about {
  animation: counterReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 2.8s forwards;
}

/* Brilho da imagem */
.about-image-wrapper::after {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at center, rgba(84, 82, 254, 0.4) 0%, transparent 70%);
  border-radius: 20px;
  opacity: 0;
  z-index: -1;
  filter: blur(15px);
}

.about.animate-in .about-image-wrapper::after {
  opacity: 0.4;
  animation: glowPulse 4s ease-in-out infinite;
}

/* Conexão visual com a seção anterior */
.about-connection {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 80px;
  background: linear-gradient(to bottom, var(--primary), transparent);
  transform: translateX(-50%);
  opacity: 0;
}

.about.animate-in .about-connection {
  animation: aboutFadeIn 1s ease 0.3s forwards;
}

@keyframes aboutFadeIn {
  0% { opacity: 0; }
  100% { opacity: 0.5; }
}

/* Efeitos parallax em camadas */
.about.animate-in.parallax-active .shape-1 {
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.about.animate-in.parallax-active .shape-2 {
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.about.animate-in.parallax-active .shape-3 {
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Responsividade */
@media (max-width: 991px) {
  .about.animate-in .about-image-container {
    animation-delay: 0.5s;
  }
  
  .about.animate-in .about-description-wrapper:nth-child(3) {
    animation-delay: 1s;
  }
  
  .about.animate-in .about-description-wrapper:nth-child(4) {
    animation-delay: 1.3s;
  }
  
  .about.animate-in .metric-item:nth-child(1) {
    animation-delay: 1.5s;
  }
  
  .about.animate-in .metric-item:nth-child(2) {
    animation-delay: 1.7s;
  }
  
  .about.animate-in .metric-item:nth-child(3) {
    animation-delay: 1.9s;
  }
}

/* Preferência por movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .about-card,
  .bg-gradient,
  .bg-shape,
  .bg-dots-pattern,
  .about-subtitle,
  .about-heading,
  .gradient-text-about .gradient-letter,
  .about-description-wrapper,
  .description-icon,
  .about-image-container,
  .metric-item,
  .metric-icon,
  .metric-value-about,
  .about-metrics::before,
  .about-image-wrapper::after,
  .about-connection {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}