/**
 * AGORA TRANSPORTE — Premium Effects & Animations
 * Micro-interactions and visual enhancements
 */

/* ========================================================
   ANIMACIONES PREMIUM
   ======================================================== */

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

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

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

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

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

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

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(254, 71, 91, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(254, 71, 91, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(254, 71, 91, 0);
  }
}

@keyframes glow {
  0%, 100% {
    text-shadow: 0 0 10px rgba(254, 71, 91, 0);
  }
  50% {
    text-shadow: 0 0 20px rgba(254, 71, 91, 0.5);
  }
}

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

/* ========================================================
   APLICAR ANIMACIONES A ELEMENTOS
   ======================================================== */

/* Hero section animations */
.box-banner-info h2 {
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.box-banner-info .hero-subtitle {
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.box-banner-info .hero-actions {
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.hero-tag {
  animation: slideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CTA Button Pulse Effect */
.btn-whatsapp {
  position: relative;
}

.btn-whatsapp::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(217, 70, 166, 0.2);
  border-radius: 50px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.btn-whatsapp:hover::before {
  animation: pulse 1.5s infinite;
}

/* Card Hover Effects */
.card-service:hover,
.cardService:hover {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Link Underline Animation - REMOVIDO: Selectores demasiado genéricos rompen layout */
/* No aplicar efecto ::after global a todos los links */

.btn-whatsapp::after,
.btn-primary::after,
.btn-cotizar-outline::after {
  display: none;
}

/* ========================================================
   SCROLL REVEAL ANIMATIONS
   ======================================================== */

.wow {
  visibility: hidden;
  animation-duration: 0.8s;
  animation-fill-mode: both;
}

.wow.fadeInUp {
  animation-name: slideUp;
}

.wow.fadeIn {
  animation-name: fadeIn;
}

.wow.slideInLeft {
  animation-name: slideInLeft;
}

.wow.slideInRight {
  animation-name: slideInRight;
}

/* Stagger animations */
.row .col-lg-4:nth-child(1) {
  animation-delay: 0s;
}

.row .col-lg-4:nth-child(2) {
  animation-delay: 0.1s;
}

.row .col-lg-4:nth-child(3) {
  animation-delay: 0.2s;
}

.row .col-md-6:nth-child(1) {
  animation-delay: 0s;
}

.row .col-md-6:nth-child(2) {
  animation-delay: 0.1s;
}

.swiper-slide {
  animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================
   GRADIENT ANIMATIONS
   ======================================================== */

.gradient-animated {
  background: linear-gradient(
    45deg,
    #5B27A1 0%,
    #fe475b 50%,
    #5B27A1 100%
  );
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
}

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

/* ========================================================
   HEADER EFFECTS
   ======================================================== */

.header {
  animation: slideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-main-menu .main-menu li a {
  position: relative;
}

.nav-main-menu .main-menu li a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-pink-main), var(--color-purple-main));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-main-menu .main-menu li a:hover::before,
.nav-main-menu .main-menu li a.active::before {
  width: 100%;
}

/* ========================================================
   LABEL ANIMATIONS
   ======================================================== */

.section-label {
  animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-label span {
  display: inline-block;
  animation: glow 3s ease-in-out infinite;
}

/* ========================================================
   BUTTON ANIMATIONS
   ======================================================== */

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  pointer-events: none;
}

.btn-primary:active::after {
  width: 300px;
  height: 300px;
}

/* ========================================================
   ICON ANIMATIONS
   ======================================================== */

.feature-icon {
  position: relative;
  overflow: hidden;
}

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

.feature-item:hover .feature-icon::before {
  left: 100%;
}

.feature-icon svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item:hover .feature-icon svg {
  transform: scale(1.1) rotate(5deg);
}

/* ========================================================
   CARD ANIMATIONS
   ======================================================== */

.cardFleet,
.cardService,
.cardIconTitleDesc {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cardFleet:hover {
  transform: translateY(-8px) rotateX(2deg);
}

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

.cardIconTitleDesc:hover {
  transform: translateY(-6px);
}

/* 3D Hover Effect */
.card-service {
  perspective: 1000px;
}

.card-service:hover {
  transform: rotateY(2deg) rotateX(-2deg);
}

/* ========================================================
   TESTIMONIAL ANIMATIONS
   ======================================================== */

.testimonial-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.testimonial-text {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-stars span {
  display: inline-block;
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-stars span:nth-child(1) { animation-delay: 0s; }
.testimonial-stars span:nth-child(2) { animation-delay: 0.05s; }
.testimonial-stars span:nth-child(3) { animation-delay: 0.1s; }
.testimonial-stars span:nth-child(4) { animation-delay: 0.15s; }
.testimonial-stars span:nth-child(5) { animation-delay: 0.2s; }

/* ========================================================
   MOBILE ANIMATIONS
   ======================================================== */

.hamburger-menu {
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-wrap nav ul li a {
  animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================
   LOADING STATES
   ======================================================== */

.loading {
  background: linear-gradient(
    90deg,
    rgba(91, 39, 161, 0.1) 25%,
    rgba(91, 39, 161, 0.2) 50%,
    rgba(91, 39, 161, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* ========================================================
   FOCUS STATES
   ======================================================== */

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--color-pink-main);
  outline-offset: 2px;
}

/* ========================================================
   ACCESSIBILITY
   ======================================================== */

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

  html {
    scroll-behavior: auto;
  }
}

/* ========================================================
   RESPONSIVE ANIMATIONS
   ======================================================== */

@media (max-width: 768px) {
  .wow {
    animation-duration: 0.6s;
  }

  .box-banner-info h2 {
    animation-duration: 0.6s;
  }

  .cardFleet:hover {
    transform: translateY(-4px) rotateX(0deg);
  }

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

  .testimonial-card:hover {
    transform: translateY(-4px) scale(1.01);
  }
}

/* ========================================================
   SCROLLBAR STYLING
   ======================================================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-grey-100);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-purple-main), var(--color-pink-main));
  border-radius: 10px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-purple-dark), var(--color-pink-dark));
}

/* Firefox Scrollbar */
* {
  scrollbar-color: var(--color-purple-main) var(--color-grey-100);
  scrollbar-width: thin;
}

/* ========================================================
   SELECTION STYLING
   ======================================================== */

::selection {
  background: linear-gradient(135deg, var(--color-purple-main), var(--color-pink-main));
  color: var(--color-white);
}

::-moz-selection {
  background: linear-gradient(135deg, var(--color-purple-main), var(--color-pink-main));
  color: var(--color-white);
}
