/**
 * ANIMAÇÕES VANILLA CSS
 * Sem dependência de bibliotecas externas
 * Compatível com todos os navegadores modernos
 */

/* ===================================
   CARROSSEL MANUAL (CSS + JS)
   =================================== */
.carousel-container {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.carousel-wrapper {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  padding: 0 10px;
}

/* Responsivo - múltiplos slides */
@media (min-width: 640px) {
  .carousel-slide-2 { flex: 0 0 50%; }
}

@media (min-width: 1024px) {
  .carousel-slide-3 { flex: 0 0 33.333%; }
}

/* Navegação do Carrossel */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  border: 2px solid #ec7424;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: #ec7424;
  box-shadow: 0 4px 20px rgba(236, 116, 36, 0.4);
  transition: all 0.3s ease;
  z-index: 20;
}

.carousel-nav:hover {
  background: #ec7424;
  color: white;
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 6px 25px rgba(236, 116, 36, 0.6);
}

.carousel-nav-prev { left: 10px; }
.carousel-nav-next { right: 10px; }

/* Paginação */
.carousel-pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  position: relative;
  transform: translateY(-20px);
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: #ec7424;
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(236, 116, 36, 0.6);
}

/* ===================================
   SCROLL ANIMATIONS
   =================================== */
/* Fade In Simples - Apenas opacidade */
.fade-in {
  opacity: 0;
  transition: opacity 1s ease-out;
}

.fade-in.visible {
  opacity: 1;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Variante rápida para seções com muitos itens */
.fade-in-up-fast {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-in-up-fast.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger effect */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.stagger-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delays para stagger */
.stagger-item:nth-child(1).visible { transition-delay: 0s; }
.stagger-item:nth-child(2).visible { transition-delay: 0.1s; }
.stagger-item:nth-child(3).visible { transition-delay: 0.2s; }
.stagger-item:nth-child(4).visible { transition-delay: 0.3s; }
.stagger-item:nth-child(5).visible { transition-delay: 0.4s; }
.stagger-item:nth-child(6).visible { transition-delay: 0.5s; }

/* Slide In From Bottom com Rotate */
.slide-rotate-up {
  opacity: 0;
  transform: translateY(80px) rotate(-5deg);
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-rotate-up.visible {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

/* Zoom In com Blur */
.zoom-blur {
  opacity: 0;
  transform: scale(0.8);
  filter: blur(10px);
  transition: opacity 1.2s ease-out, transform 1.2s ease-out, filter 1.2s ease-out;
}

.zoom-blur.visible {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* Slide In From Top */
.slide-in-top {
  opacity: 0;
  transform: translateY(-80px);
  transition: opacity 1s ease-out, transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slide-in-top.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Rotate In */
.rotate-in {
  opacity: 0;
  transform: rotate(-180deg) scale(0.5);
  transition: opacity 1s ease-out, transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rotate-in.visible {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Flip In */
.flip-in {
  opacity: 0;
  transform: perspective(1000px) rotateY(-90deg);
  transition: opacity 1s ease-out, transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-in.visible {
  opacity: 1;
  transform: perspective(1000px) rotateY(0deg);
}

/* Bounce In */
.bounce-in {
  opacity: 0;
  transform: scale(0.3) translateY(100px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bounce-in.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Fade In com Scale e Rotate */
.fade-scale-rotate {
  opacity: 0;
  transform: scale(0.5) rotate(45deg);
  transition: opacity 1s ease-out, transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fade-scale-rotate.visible {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Slide In Diagonal */
.slide-diagonal {
  opacity: 0;
  transform: translateX(-100px) translateY(100px);
  transition: opacity 1s ease-out, transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-diagonal.visible {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

/* ===================================
   HOVER EFFECTS
   =================================== */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(236, 116, 36, 0.3);
}

.hover-glow {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(236, 116, 36, 0.6);
  transform: scale(1.02);
}

.hover-scale {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===================================
   GLASSMORPHISM
   =================================== */
.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

.glass-card-dark {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ===================================
   PULSE & GLOW
   =================================== */
.pulse-glow {
  animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(236, 116, 36, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(236, 116, 36, 0.8);
  }
}

/* ===================================
   GRADIENT ANIMATIONS
   =================================== */
.gradient-animate {
  background: linear-gradient(45deg, #ec7424, #ff8a3d, #ec7424, #ff8a3d);
  background-size: 300% 300%;
  animation: gradient-shift 8s ease infinite;
}

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

.gradient-text {
  background: linear-gradient(90deg, #ec7424, #ff8a3d, #ec7424);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease infinite;
}

/* ===================================
   LOADING ANIMATION
   =================================== */
.spinner {
  border: 4px solid rgba(236, 116, 36, 0.1);
  border-left-color: #ec7424;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* ===================================
   RIPPLE EFFECT
   =================================== */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(236, 116, 36, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* ===================================
   FLOAT ANIMATION
   =================================== */
.float {
  animation: float 6s ease-in-out infinite;
}

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

/* ===================================
   CARD 3D EFFECT
   =================================== */
.card-3d {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: rotateY(5deg) rotateX(5deg) translateZ(10px);
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
  .carousel-nav {
    width: 45px;
    height: 45px;
    font-size: 20px;
    border-width: 2px;
  }
  
  .carousel-nav-prev { left: 10px; }
  .carousel-nav-next { right: 10px; }
  
  .card-3d:hover {
    transform: translateZ(5px);
  }
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.smooth-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gpu-accelerate {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

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