/**
 * Animations CSS - Infinity Construtora
 *
 * Transições, hover effects e animações AOS
 * Baseado na análise técnica da Grand Construtora
 */

/* ============================================
   ANIMAÇÕES GERAIS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

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

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

/* ============================================
   HOVER EFFECTS (Da análise Grand)
   ============================================ */

.hover-lift {
  transition: var(--transition-transform);
}

.hover-lift:hover {
  transform: translateY(-8px);
}

.hover-scale {
  transition: var(--transition-transform);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-brightness {
  transition: filter 0.3s ease;
}

.hover-brightness:hover {
  filter: brightness(1.1);
}

.hover-shadow {
  transition: var(--transition-shadow);
}

.hover-shadow:hover {
  box-shadow: var(--shadow-xl);
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.loading-skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-lightest) 0%,
    var(--gray-lighter) 50%,
    var(--gray-lightest) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--border-radius-sm);
}

.loading-dots {
  display: inline-flex;
  gap: 0.5rem;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--infinity-gold);
  border-radius: 50%;
  animation: pulse 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;
}

/* ============================================
   PARALLAX EFFECT
   ============================================ */

.parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@media (max-width: 768px) {
  .parallax {
    background-attachment: scroll;
  }
}

/* ============================================
   SMOOTH REVEAL ON SCROLL
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============================================
   FADE TRANSITIONS
   ============================================ */

.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-in-out;
}

.fade-in-down {
  animation: fadeInDown 0.6s ease-in-out;
}

.fade-in-left {
  animation: fadeInLeft 0.6s ease-in-out;
}

.fade-in-right {
  animation: fadeInRight 0.6s ease-in-out;
}

.scale-in {
  animation: scaleIn 0.6s ease-in-out;
}

/* ============================================
   CONFIGURAÇÃO AOS (Da análise Grand)
   ============================================ */

[data-aos] {
  pointer-events: auto;
}

[data-aos][data-aos][data-aos-duration="400"] {
  transition-duration: 400ms;
}

[data-aos][data-aos][data-aos-duration="600"] {
  transition-duration: 600ms;
}

[data-aos][data-aos][data-aos-duration="800"] {
  transition-duration: 800ms;
}

[data-aos][data-aos][data-aos-duration="1000"] {
  transition-duration: 1000ms;
}

[data-aos][data-aos][data-aos-duration="1200"] {
  transition-duration: 1200ms;
}

[data-aos][data-aos][data-aos-easing="ease"] {
  transition-timing-function: ease;
}

[data-aos][data-aos][data-aos-easing="ease-in-out"] {
  transition-timing-function: ease-in-out;
}

[data-aos][data-aos][data-aos-easing="ease-in"] {
  transition-timing-function: ease-in;
}

[data-aos][data-aos][data-aos-easing="ease-out"] {
  transition-timing-function: ease-out;
}

/* ============================================
   TRANSIÇÕES DE PÁGINA
   ============================================ */

.page-transition {
  animation: fadeInUp 0.5s ease-in-out;
}

/* ============================================
   COUNTER ANIMATION (números crescentes)
   ============================================ */

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

.counter {
  animation: countUp 0.8s ease-out;
}

/* ============================================
   IMAGE ZOOM ON HOVER (Da análise Grand)
   ============================================ */

.image-zoom-container {
  overflow: hidden;
  border-radius: var(--border-radius-md);
}

.image-zoom {
  transition: transform 0.5s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-zoom-container:hover .image-zoom {
  transform: scale(1.1);
}

/* ============================================
   UNDERLINE ANIMATION
   ============================================ */

.underline-animate {
  position: relative;
  display: inline-block;
}

.underline-animate::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--infinity-gold);
  transition: width 0.3s ease;
}

.underline-animate:hover::after {
  width: 100%;
}

/* ============================================
   GRADIENT TEXT ANIMATION
   ============================================ */

.gradient-text {
  background: var(--gold-gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

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

/* ============================================
   BOUNCE ANIMATION
   ============================================ */

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

.bounce {
  animation: bounce 2s infinite;
}

/* ============================================
   FLIP CARD
   ============================================ */

.flip-card {
  perspective: 1000px;
  width: 100%;
  height: 100%;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  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(--border-radius-md);
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* ============================================
   STAGGER ANIMATION (para listas)
   ============================================ */

.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 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; }

/* ============================================
   FLOATING ANIMATION
   ============================================ */

@keyframes floating {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

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

/* ============================================
   GLOWING EFFECT
   ============================================ */

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--infinity-gold),
                0 0 10px var(--infinity-gold);
  }
  50% {
    box-shadow: 0 0 10px var(--infinity-gold),
                0 0 20px var(--infinity-gold),
                0 0 30px var(--infinity-gold);
  }
}

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

/* ============================================
   REDUCE MOTION (Acessibilidade)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
