/* ================================================
   animations.css — Veritaris
   Keyframes, hover effects, AOS overrides, states
   ================================================ */

/* ------------------------------------------------
   1. Keyframes
   ------------------------------------------------ */

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

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

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

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

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

@keyframes scaleInBounce {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 12px rgba(139, 92, 246, 0);
  }
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.5);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(139, 92, 246, 0);
  }
}

@keyframes glowPulse {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(139, 92, 246, 0.6),
      0 0 20px rgba(139, 92, 246, 0.3);
  }
  50% {
    text-shadow:
      0 0 20px rgba(6, 182, 212, 0.8),
      0 0 40px rgba(6, 182, 212, 0.4),
      0 0 60px rgba(139, 92, 246, 0.2);
  }
}

@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
  }
  50% {
    border-color: rgba(6, 182, 212, 0.6);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
  }
}

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

@keyframes scanLine {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100vh);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

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

/* ------------------------------------------------
   2. Entrance animation classes
   ------------------------------------------------ */

.anim-fade-in-up {
  animation: fadeInUp 0.7s ease forwards;
}

.anim-fade-in-down {
  animation: fadeInDown 0.7s ease forwards;
}

.anim-fade-in-left {
  animation: fadeInLeft 0.7s ease forwards;
}

.anim-fade-in-right {
  animation: fadeInRight 0.7s ease forwards;
}

.anim-scale-in {
  animation: scaleIn 0.5s ease forwards;
}

.anim-float {
  animation: float 4s ease-in-out infinite;
}

/* Stagger delays */
.anim-delay-100 { animation-delay: 0.1s; }
.anim-delay-200 { animation-delay: 0.2s; }
.anim-delay-300 { animation-delay: 0.3s; }
.anim-delay-400 { animation-delay: 0.4s; }
.anim-delay-500 { animation-delay: 0.5s; }
.anim-delay-600 { animation-delay: 0.6s; }
.anim-delay-700 { animation-delay: 0.7s; }
.anim-delay-800 { animation-delay: 0.8s; }

/* ------------------------------------------------
   3. Hover effects — service cards
   ------------------------------------------------ */

.service-card {
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.service-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 20px 60px rgba(139, 92, 246, 0.25),
    0 8px 20px rgba(6, 182, 212, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 92, 246, 0.5);
}

.service-card:hover .service-icon {
  animation: scaleInBounce 0.4s ease forwards;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.6));
}

.service-card:hover .service-card__title {
  background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Neon glow on card icon wrapper */
.service-card__icon-wrap {
  transition: box-shadow 0.35s ease, background 0.35s ease;
}

.service-card:hover .service-card__icon-wrap {
  box-shadow:
    0 0 20px rgba(139, 92, 246, 0.5),
    0 0 40px rgba(6, 182, 212, 0.2);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.1));
}

/* ------------------------------------------------
   4. Navbar transition — scrolled state
   ------------------------------------------------ */

nav.navbar {
  transition:
    background 0.4s ease,
    backdrop-filter 0.4s ease,
    box-shadow 0.4s ease,
    padding 0.4s ease;
}

nav.navbar.scrolled {
  background: rgba(10, 10, 15, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(139, 92, 246, 0.2);
}

/* Navbar link hover underline sweep */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ------------------------------------------------
   5. CTA button pulse animation
   ------------------------------------------------ */

.btn-primary {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 30px rgba(139, 92, 246, 0.5),
    0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Shimmer sweep on hover */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

/* Hero CTA pulse */
.hero__cta .btn-primary {
  animation: pulse 3s ease-in-out infinite;
}

.hero__cta .btn-primary:hover {
  animation: none;
  transform: translateY(-2px) scale(1.02);
}

/* ------------------------------------------------
   6. Form loading states
   ------------------------------------------------ */

/* Submit button states */
.btn-submit {
  position: relative;
  overflow: hidden;
  transition:
    background 0.3s ease,
    transform 0.2s ease,
    opacity 0.3s ease;
}

.btn-submit[data-state="loading"] {
  pointer-events: none;
  opacity: 0.85;
  cursor: not-allowed;
}

.btn-submit[data-state="loading"]::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-submit[data-state="done"] {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

/* Form field focus glow */
.form-field input,
.form-field select,
.form-field textarea {
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow:
    0 0 0 3px rgba(139, 92, 246, 0.15),
    0 0 20px rgba(139, 92, 246, 0.1);
  background: rgba(255, 255, 255, 0.07);
}

.form-field input.error,
.form-field select.error,
.form-field textarea.error {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Feedback banners */
.form-feedback {
  animation: fadeInUp 0.4s ease forwards;
}

.form-feedback.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.form-feedback.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.1);
}

/* ------------------------------------------------
   7. AOS overrides — deeper integration
   ------------------------------------------------ */

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

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

[data-aos="fade-up"] {
  transform: translateY(30px);
}

[data-aos="fade-left"] {
  transform: translateX(30px);
}

[data-aos="fade-right"] {
  transform: translateX(-30px);
}

[data-aos="zoom-in"] {
  transform: scale(0.9);
}

/* ------------------------------------------------
   8. Hero section animations
   ------------------------------------------------ */

.hero__headline {
  animation: fadeInUp 0.9s ease 0.2s both;
}

.hero__subheadline {
  animation: fadeInUp 0.9s ease 0.45s both;
}

.hero__cta {
  animation: fadeInUp 0.9s ease 0.65s both;
}

.hero__scroll-indicator {
  animation: fadeInDown 1s ease 1.2s both, float 3s ease-in-out 2.2s infinite;
}

/* Particles container fade-in */
#hero-particles {
  animation: scaleIn 1.5s ease 0.1s both;
}

/* ------------------------------------------------
   9. Counter section
   ------------------------------------------------ */

.counter-item {
  transition: transform 0.3s ease;
}

.counter-item:hover {
  transform: translateY(-4px);
}

.counter-number {
  animation: countUp 0.5s ease forwards;
  display: inline-block;
}

.counter-item .counter-icon {
  transition: transform 0.4s ease, filter 0.4s ease;
}

.counter-item:hover .counter-icon {
  transform: scale(1.15) rotate(-5deg);
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.7));
}

/* ------------------------------------------------
   10. Differentials / "Por que" section
   ------------------------------------------------ */

.diferencial-item {
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.diferencial-item:hover {
  transform: translateX(8px);
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.06);
}

.diferencial-item .diferencial-icon {
  transition: transform 0.3s ease, filter 0.3s ease;
}

.diferencial-item:hover .diferencial-icon {
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.6));
}

/* ------------------------------------------------
   11. Section entrance — gradient headline underline
   ------------------------------------------------ */

.section-title {
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  border-radius: 3px;
  transition: width 0.6s ease 0.3s;
}

.section-title.aos-animate::after {
  width: 60%;
}

/* ------------------------------------------------
   12. WhatsApp float button animation
   ------------------------------------------------ */

.whatsapp-float {
  animation: scaleInBounce 0.6s ease 1.5s both;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.12) rotate(-5deg);
  box-shadow:
    0 8px 30px rgba(37, 211, 102, 0.5),
    0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-float::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.4);
  animation: pulseRing 2s ease-in-out infinite;
}

/* ------------------------------------------------
   13. Map / iframe fade-in on load
   ------------------------------------------------ */

.map-container iframe {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.map-container iframe.loaded {
  opacity: 1;
}

/* ------------------------------------------------
   14. Service page hero
   ------------------------------------------------ */

.service-hero__icon {
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
}

.service-hero__title {
  animation: fadeInUp 0.8s ease 0.2s both;
}

.service-hero__breadcrumb {
  animation: fadeInUp 0.8s ease 0.1s both;
}

/* ------------------------------------------------
   15. Gradient text animation
   ------------------------------------------------ */

.gradient-text-animated {
  background: linear-gradient(
    270deg,
    #8b5cf6,
    #06b6d4,
    #a78bfa,
    #22d3ee
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
}

/* ------------------------------------------------
   16. Reduced motion support
   ------------------------------------------------ */

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

  .hero__headline,
  .hero__subheadline,
  .hero__cta,
  .hero__scroll-indicator,
  .whatsapp-float,
  #hero-particles {
    animation: none;
    opacity: 1;
  }

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}
