/* Animated Title Styles */
.animated-title {
  transition: color 0.5s ease;
  background-image: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary), var(--color-primary-light));
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent !important;
  animation: titleGradientShift 6s ease-in-out infinite, titleEntrance 1.2s cubic-bezier(0.17, 0.67, 0.29, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}

.services-title:hover .animated-title {
  animation: titlePulse 1s ease-in-out infinite !important;
  letter-spacing: 0.02em;
}

/* Service Card Category animation */
.service-card__category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-primary);
  opacity: 0;
  transform: translateX(-100%) rotate(10deg);
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s ease;
  z-index: -1;
}

.service-card:hover .service-card__category {
  color: white;
  transform: translateY(-3px) scale(1.05);
  border-color: transparent;
  letter-spacing: 0.03em;
  padding-left: 1rem;
  padding-right: 1rem;
  animation: categoryPulse 2s infinite;
}

.service-card:hover .service-card__category::before {
  transform: translateX(0) rotate(0);
  opacity: 1;
}

/* Animation Keyframes */
@keyframes titleGradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

@keyframes titleEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes categoryPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(var(--color-primary-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0);
  }
}

/* Service Card Animations */
.service-card {
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.6s ease;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 107%, var(--color-primary-light) 0%, var(--color-primary) 30%, var(--color-primary-dark) 85%);
  opacity: 0;
  transform: scale(0.9);
  border-radius: inherit;
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.service-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 20px 40px rgba(var(--color-primary-rgb), 0.2);
  z-index: 2;
}

.service-card:hover::before {
  opacity: 0.075;
  transform: scale(1);
}

.service-card:hover .service-card__image {
  transform: scale(1.08);
  filter: brightness(1.05) contrast(1.05);
}

.service-card:hover .service-card__title {
  color: var(--color-primary);
  transform: translateY(-3px);
}

.service-card:hover .service-card__accent {
  transform: scale(1.3) rotate(10deg);
  opacity: 0.8;
}

.service-card:hover .service-card__badge {
  transform: rotate(360deg) scale(1.1);
  background: var(--color-primary);
  box-shadow: 0 5px 15px rgba(var(--color-primary-rgb), 0.3);
}

.service-card:hover .service-card__badge svg {
  filter: brightness(2);
}

.service-card__image {
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.6s ease;
}

.service-card__title {
  transition: color 0.4s ease, transform 0.4s ease;
}

.service-card__accent {
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.8s ease;
}

.service-card__badge {
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.6s ease, box-shadow 0.6s ease;
}

.service-card__badge svg {
  transition: filter 0.6s ease;
}

/* Service Card Content Animations */
.service-card__meta,
.service-card__features,
.service-card__feature,
.service-card__footer {
  transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.5s ease;
  transition-delay: calc(var(--index, 0) * 0.05s);
}

.service-card:hover .service-card__meta {
  --index: 1;
  transform: translateY(-5px);
}

.service-card:hover .service-card__features {
  --index: 2;
}

.service-card:hover .service-card__feature {
  --index: var(--feature-index, 3);
  transform: translateX(5px);
}

.service-card:hover .service-card__feature:nth-child(1) {
  --feature-index: 3;
}

.service-card:hover .service-card__feature:nth-child(2) {
  --feature-index: 4;
}

.service-card:hover .service-card__footer {
  --index: 5;
  transform: translateY(-5px);
}

/* Enhance button animation */
.service-card__button {
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  position: relative;
}

.service-card__button::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.2) 50%, 
    transparent 100%);
  transform: translateX(-100%);
}

.service-card:hover .service-card__button {
  letter-spacing: 0.05em;
  transform: translateY(-2px);
  background: var(--color-primary);
  color: white;
  box-shadow: 0 5px 15px rgba(var(--color-primary-rgb), 0.3);
}

.service-card:hover .service-card__button::after {
  animation: shimmer 2s infinite;
}

.service-card:hover .service-card__button-icon {
  transform: translateX(5px);
}

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Focus accessibility animations */
.service-card:focus-within {
  transform: translateY(-10px) scale(1.01);
  box-shadow: 0 15px 30px rgba(var(--color-primary-rgb), 0.15);
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.service-card:focus-within::before {
  opacity: 0.05;
  transform: scale(1);
}

.service-card__button:focus {
  outline: none;
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-primary);
}

/* Enhance entrance animations for cards */
@media (prefers-reduced-motion: no-preference) {
  .service-card {
    opacity: 0;
    transform: translateY(30px);
    animation: cardEntrance 0.8s forwards cubic-bezier(0.17, 0.67, 0.83, 0.67);
  }
  
  @keyframes cardEntrance {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .services-grid__item:nth-child(1) .service-card { animation-delay: 0.1s; }
  .services-grid__item:nth-child(2) .service-card { animation-delay: 0.2s; }
  .services-grid__item:nth-child(3) .service-card { animation-delay: 0.3s; }
  .services-grid__item:nth-child(4) .service-card { animation-delay: 0.4s; }
  .services-grid__item:nth-child(5) .service-card { animation-delay: 0.5s; }
  .services-grid__item:nth-child(6) .service-card { animation-delay: 0.6s; }
}

/* Mobile Responsive Text Optimizations */
@media screen and (max-width: 768px) {
  /* Hero/Intro Section Text Size Reductions */
  .intro-badge {
    padding: 0.4rem 1rem;
    font-size: 0.7rem;
    margin-bottom: 1rem;
  }
  
  .intro-greeting {
    font-size: 0.9rem;
  }
  
  .intro-name {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  
  .intro-description {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }
  
  .intro-description p {
    margin-bottom: 0.5rem;
  }

  /* CTA Buttons Size Reduction */
  .btn-primary, 
  .btn-secondary,
  .service-card__button,
  .testimonials-cta-button,
  .services-view-all {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }
  
  .service-card__button span,
  .testimonials-cta-button span,
  .services-view-all span {
    font-size: 0.8rem;
  }
  
  .service-card__button-icon,
  .testimonials-cta-button svg,
  .services-view-all svg {
    width: 16px;
    height: 16px;
  }
  
  /* Card Content Size Reduction */
  .service-card__title {
    font-size: 1.1rem;
  }
  
  .service-card__excerpt {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .service-card__feature {
    font-size: 0.8rem;
    padding: 0.3rem 0;
  }
  
  .service-card__category {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
  }
  
  /* Title & Subtitle Size Reductions */
  .services-title,
  .testimonials-title {
    font-size: 1.5rem;
  }
  
  .services-subtitle,
  .testimonials-subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .services-badge,
  .testimonials-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
  }

  /* Optimize intro section layout */
  .intro-inner {
    flex-direction: column-reverse;
    gap: 1rem;
    padding: 1rem;
    padding-top: 8rem;
  }
  
  .intro-content {
    width: 100%;
    text-align: center;
    align-items: center;
  }
  
  .intro-description {
    padding-right: 0;
  }
  
  .intro-description::before {
    display: none;
  }
  
  .intro-description p {
    padding-right: 0;
    margin-bottom: 0px;
    line-height: 26px;
  }
  
  .intro-description p::before {
    display: none;
  }
  
  .intro-image-wrapper {
    width: 80%;
    margin: 0 auto;
    max-width: 300px;
  }
  
  .intro-image-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  .intro-stats-heading {
    font-size: 1rem;
  }
  
  .intro-credential-number {
    font-size: 1.2rem;
  }
  
  .intro-credential-text {
    font-size: 0.7rem;
    text-align: center;
  }
  
  .intro-credentials {
    gap: 0.8rem;
    flex-wrap: nowrap;
  }
  
  .intro-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .intro-button {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* Extra Small Mobile Screens */
@media screen and (max-width: 480px) {
  /* Hero/Intro Section Further Reductions */
  .intro-name {
    font-size: 1.7rem;
  }
  
  .intro-description {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }
  
  .intro-badge {
    padding: 0.3rem 0.8rem;
    font-size: 0.65rem;
  }
  
  /* CTA Buttons Extra Small */
  .btn-primary, 
  .btn-secondary,
  .service-card__button,
  .testimonials-cta-button,
  .services-view-all {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  /* Reduce card hover lift to avoid overflow issues */
  .service-card:hover {
    transform: translateY(-8px) scale(1.01);
  }
  
  /* Adjust card staggered animations for smoother mobile experience */
  .service-card:hover .service-card__meta,
  .service-card:hover .service-card__feature,
  .service-card:hover .service-card__footer {
    transform: none;
  }
  
  /* Minimize empty space */
  .services-section,
  .testimonials-section {
    padding: 3rem 0;
  }
  
  /* Further reduce section headings */
  .services-title,
  .testimonials-title {
    font-size: 1.3rem;
  }
  
  .service-card__category {
    top: 10px;
    left: 10px;
  }
  
  /* Enhance touch targets */
  .service-card__button {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

/* WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: flex;
  align-items: center;
  padding: 0.6rem;
  border-radius: 50px;
  background-color: #25D366;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  overflow: hidden;
  max-width: 50px;
}

.whatsapp-float:hover {
  max-width: 200px;
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.whatsapp-float-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background-color: white;
  border-radius: 50%;
  flex-shrink: 0;
}

.whatsapp-float-icon svg {
  color: #25D366;
}

.whatsapp-float-text {
  color: white;
  font-size: 0.85rem;
  white-space: nowrap;
  margin-right: 10px;
  margin-left: 12px;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease 0.1s;
}

.whatsapp-float:hover .whatsapp-float-text {
  opacity: 1;
  transform: translateX(0);
}

.whatsapp-float::before {
  content: '';
  position: absolute;
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  z-index: -1;
  transform: scale(0);
  transition: transform 0.5s ease;
}

.whatsapp-float:hover::before {
  transform: scale(2.5);
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  70% {
    transform: scale(2);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Mobile optimization for WhatsApp button */
@media screen and (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    padding: 0.5rem;
  }
  
  .whatsapp-float-icon {
    width: 30px;
    height: 30px;
  }
}
