/**
 * Universal Card Component - Hover Effects & Animations
 *
 * @package AITSC_Pro_Theme
 * @subpackage Components
 * @since 3.1.0
 */

/* ==========================================================================
   3D Tilt Effect (Hardware accelerated)
   ========================================================================== */

.aitsc-card--glass:hover,
.aitsc-card--solid:hover,
.aitsc-card--outlined:hover {
    will-change: transform;
}

/* Shimmer Effect for Image Cards */
.aitsc-card--image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: skewX(-25deg);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.aitsc-card--image:hover::before {
    left: 150%;
}

/* Pulse Effect for Icon Cards */
@keyframes cardPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    50% {
        box-shadow: 0 4px 16px rgba(0, 102, 204, 0.3);
    }
}

.aitsc-card--icon:hover {
    animation: cardPulse 2s ease-in-out infinite;
}

/* Icon Bounce */
@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

.aitsc-card--icon:hover .aitsc-card__icon {
    animation: iconBounce 0.6s ease-in-out;
}

/* Glassmorphism Glow */
.aitsc-card--glass:hover {
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Ripple Effect for Outlined Cards */
.aitsc-card--outlined::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;
}

.aitsc-card--outlined:hover::after {
    width: 300px;
    height: 300px;
}

/* ==========================================================================
   Loading Animation
   ========================================================================== */

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

.aitsc-card.is-loading {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: cardSkeleton 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Entrance Animations
   ========================================================================== */

.aitsc-card.is-animating-in {
    animation: cardFadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

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

/* Staggered animation delays */
.aitsc-card:nth-child(1).is-animating-in { animation-delay: 0.1s; }
.aitsc-card:nth-child(2).is-animating-in { animation-delay: 0.2s; }
.aitsc-card:nth-child(3).is-animating-in { animation-delay: 0.3s; }
.aitsc-card:nth-child(4).is-animating-in { animation-delay: 0.4s; }
.aitsc-card:nth-child(5).is-animating-in { animation-delay: 0.5s; }
.aitsc-card:nth-child(6).is-animating-in { animation-delay: 0.6s; }

/* ==========================================================================
   Reduced Motion (Accessibility)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .aitsc-card {
        transition: none;
        animation: none;
    }

    .aitsc-card:hover {
        transform: none;
    }

    .aitsc-card::before,
    .aitsc-card::after {
        transition: none;
        animation: none;
    }

    .aitsc-card__icon {
        transition: none;
        animation: none;
    }
}

/* ==========================================================================
   Performance Optimization
   ========================================================================== */

/* Force GPU acceleration for hover effects */
.aitsc-card:hover {
    transform: translate3d(0, -4px, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}
