/* Service Card Transitions and Effects
   This file contains transition effects specifically for service cards
   when they're scaled down to 80% of their original size
*/

/* Initial load animation for service cards */
@keyframes cardScaleIn {
  0% {
    opacity: 0;
    transform: scale(calc(var(--service-card-scale) - 0.2));
  }
  70% {
    opacity: 1;
    transform: scale(calc(var(--service-card-scale) + 0.05));
  }
  100% {
    transform: scale(var(--service-card-scale));
  }
}

/* Apply the animation to service cards on page load */
.service-card-wrapper {
  animation: cardScaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0; /* Start with opacity 0 */
}

/* Staggered delay for cards */
.service-card-wrapper:nth-child(1) {
  animation-delay: 0.1s;
}
.service-card-wrapper:nth-child(2) {
  animation-delay: 0.2s;
}
.service-card-wrapper:nth-child(3) {
  animation-delay: 0.3s;
}
.service-card-wrapper:nth-child(4) {
  animation-delay: 0.4s;
}
.service-card-wrapper:nth-child(5) {
  animation-delay: 0.5s;
}
.service-card-wrapper:nth-child(6) {
  animation-delay: 0.6s;
}

/* Enhanced hover effect for wrapper */
.service-card-wrapper::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: radial-gradient(
    circle at center,
    rgba(var(--primary-rgb), 0.1) 0%,
    rgba(var(--primary-rgb), 0) 70%
  );
  border-radius: 20px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.4s ease;
  z-index: -1;
  pointer-events: none;
}

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

/* Glow effect for hovered card */
.service-card-wrapper.hover .service-card {
  box-shadow: 0 15px 30px rgba(var(--primary-rgb), 0.2),
    0 0 0 1px rgba(var(--primary-rgb), 0.05);
}

/* Transition between hover states */
.service-card-wrapper {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Focus states for accessibility */
.service-card:focus-within {
  outline: 2px solid rgba(var(--primary-rgb), 0.5);
  outline-offset: 5px;
}

/* Ensure transitions are disabled for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .service-card-wrapper,
  .service-card,
  .service-card:hover,
  .service-card-wrapper.hover,
  .service-card-wrapper::before {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* Dark/Light mode transition enhancements */
.service-card {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Very small screens adjustments */
@media screen and (max-width: 375px) {
  .service-card-wrapper {
    padding: 15px 2px;
  }

  .service-card {
    transform: scale(
      var(--service-card-scale-tiny)
    ); /* Slightly larger on very small screens */
  }

  .service-card:hover {
    transform: translateY(-5px) scale(0.92); /* Subtle effect for very small screens */
  }

  /* Adjust text sizes for very small screens */
  .service-card h3 {
    font-size: 1.5rem;
  }

  .service-card p {
    font-size: 1.05rem;
  }
}

/* Landscape orientation on mobile devices */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .service-card-wrapper {
    padding: 10px;
  }

  .service-card {
    transform: scale(0.75); /* Even smaller in landscape to fit more */
  }

  .service-card:hover {
    transform: translateY(-5px) scale(0.8);
  }

  /* Minimize vertical space usage */
  .service-header {
    padding: 15px 20px 10px;
  }

  .service-summary {
    padding: 0 20px 5px;
  }

  /* Adjust icon size */
  .service-icon {
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    margin-bottom: 10px;
  }
}

/* Print styles for service cards */
@media print {
  .service-card-wrapper {
    padding: 0 !important;
  }

  .service-card {
    transform: scale(1) !important; /* Full size for printing */
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  .service-details {
    max-height: none !important;
    opacity: 1 !important;
  }
}
