/* ========================================
   Alfa Chaveiro São Luís - CSS Animations
   Micro-animações e efeitos visuais modernos
======================================== */

/* Animações de entrada */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounceIn {
  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);
  }
}

/* Animações contínuas */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

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

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(56, 161, 105, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(56, 161, 105, 0.8), 0 0 30px rgba(56, 161, 105, 0.6);
  }
}

/* Animações de hover */
@keyframes buttonHover {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes cardHover {
  0% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

/* Classes de animação */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

.animate-slide-in-up {
  animation: slideInUp 0.6s ease-out;
}

.animate-slide-in-down {
  animation: slideInDown 0.6s ease-out;
}

.animate-zoom-in {
  animation: zoomIn 0.6s ease-out;
}

.animate-bounce-in {
  animation: bounceIn 0.8s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

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

.animate-rotate {
  animation: rotate 2s linear infinite;
}

.animate-shake {
  animation: shake 0.5s;
}

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

/* Animações com delay para elementos sequenciais */
.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

.animate-delay-4 {
  animation-delay: 0.4s;
}

.animate-delay-5 {
  animation-delay: 0.5s;
}

/* Animações para botões */
.btn-animated:hover {
  animation: buttonHover 0.3s ease;
}

/* Animações para cards */
.card-animated:hover {
  animation: cardHover 0.3s ease;
}

/* Animações para elementos específicos */
.hero-emoji {
  animation: float 3s ease-in-out infinite;
}

.service-icon {
  transition: transform 0.3s ease;
}

.service-icon:hover {
  animation: rotate 0.5s ease;
}

.cta-button-animated {
  position: relative;
  overflow: hidden;
}

.cta-button-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.cta-button-animated:hover::before {
  left: 100%;
}

/* Efeitos de loading */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(56, 161, 105, 0.3);
  border-left: 4px solid #38a169;
  border-radius: 50%;
  animation: rotate 1s linear infinite;
  margin: 0 auto;
}

/* Animações para formulários */
.form-group {
  position: relative;
}

.form-input {
  transition: all 0.3s ease;
}

.form-input:focus {
  animation: glow 0.3s ease;
}

.form-label {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  transition: all 0.3s ease;
  pointer-events: none;
  color: #718096;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  top: -0.5rem;
  left: 0.5rem;
  font-size: 0.875rem;
  color: #38a169;
  background: white;
  padding: 0 0.5rem;
}

/* Animações de sucesso/erro */
.success-message {
  animation: slideInDown 0.5s ease-out, fadeIn 0.5s ease-out;
}

.error-message {
  animation: shake 0.5s ease-out, slideInDown 0.5s ease-out;
}

/* Animações para tooltips */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-bg);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.tooltip::before {
  content: '';
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--dark-bg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.tooltip:hover::after,
.tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Animações de scroll */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

/* Mapa sempre visível - não afetado por animações de scroll */
.map-section {
  opacity: 1 !important;
  transform: none !important;
}

.scroll-fade-in.in-view {
  opacity: 1;
  transform: translateY(0);
}

.scroll-slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.6s ease;
}

.scroll-slide-in-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.scroll-slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.6s ease;
}

.scroll-slide-in-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* Performance optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}
