/**
 * Modern Card Enhancements for Suzen Chemicals
 * Additional animations and effects for product cards
 */

:root {
    --card-shadow-light: 0 4px 20px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(179, 222, 79, 0.15);
    --card-transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --card-border-radius: 16px;
    --card-border-radius-mobile: 12px;
}

/* Enhanced focus states for accessibility */
.product-card:focus-within,
.wishlist-item:focus-within {
    outline: 2px solid var(--theme-color);
    outline-offset: 2px;
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

/* Loading skeleton animation */
.card-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Lazy loading fade-in effect */
.card-fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for multiple cards */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* Interactive ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Card gloss effect */
.card-gloss::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: rotate(45deg);
    transition: transform 0.6s;
    pointer-events: none;
}

.card-gloss:hover::after {
    transform: rotate(45deg) translate(50%, 50%);
}

/* Card tilt effect */
.card-tilt {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-tilt:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

/* Price highlight animation */
.price-highlight {
    position: relative;
}

.price-highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--theme-color), #9bc93a);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.product-card:hover .price-highlight::after {
    transform: scaleX(1);
}

/* Micro-interactions for buttons */
.btn-bounce:hover {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Floating animation for special offers */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Gradient border animation */
.gradient-border {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--card-border-radius);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(45deg, var(--theme-color), #9bc93a, var(--theme-color));
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    :root {
        --card-border-radius: var(--card-border-radius-mobile);
    }
    
    .card-tilt:hover {
        transform: none; /* Disable tilt on mobile */
    }
    
    .card-gloss:hover::after {
        transform: none; /* Disable gloss on mobile */
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .wishlist-item,
    .card-fade-in,
    .floating {
        animation: none !important;
        transition: none !important;
    }
    
    .product-card:hover,
    .wishlist-item:hover {
        transform: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .product-card,
    .wishlist-item {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        border-color: rgba(179, 222, 79, 0.2);
    }
    
    .card-skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    }
}