/* --------------------------------------------------
 * Micro-interactions for Flip Cards
 * -------------------------------------------------- */

/* Gradient Border Animation */
.service-flip-card .flip-card-inner {
    position: relative;
    overflow: hidden;
}

.service-flip-card .flip-card-inner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent,
        rgba(13, 91, 211, 0.8),
        transparent 30%
    );
    transform: translate(-50%, -50%);
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.service-flip-card:hover .flip-card-inner::before {
    opacity: 1;
}

@keyframes rotate {
    100% {
        transform: translate(-50%, -50%) rotate(1turn);
    }
}

/* Add a pseudo-element to create the actual border appearance inside the card */
.service-flip-card .flip-card-inner::after {
    content: '';
    position: absolute;
    inset: 2px;
    background-color: #081923; /* Match the dark background */
    border-radius: 16px;
}

/* Ensure content is on top of the border animation */
.flip-card-front,
.flip-card-back {
    z-index: 1;
    background: transparent; /* Make the original background transparent */
}

/* Re-apply backgrounds to a new inner container if needed, or adjust existing */
.flip-card-front-content, .flip-card-back-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
}


/* Icon Bounce Animation on Flip */
.service-flip-card:hover .flip-card-back .flip-card-icon {
    animation: bounce-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s 1;
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}
