/**
 * Complete Animations CSS
 * 完全复刻原网站的所有动画效果
 * @package SillyDino_Pro
 */

/* Animation Variables */
:root {
    --animation-duration: 650ms;
    --init-delay: 150ms;
    --child-delay: 150ms;
}

/* Main Animation Classes */
.animate-section {
    --animation-duration: 650ms;
    --init-delay: 150ms;
    --child-delay: 150ms;
}

.animate-section.animate--hidden .animate-item {
    opacity: 0;
    filter: blur(1px);
    transform: translate(0%, 0%) scale(100%);
}

.animate-section.animate--shown .animate-item {
    opacity: 1;
    filter: blur(0);
    transform: none;
    transition: opacity var(--animation-duration) var(--init-delay),
                filter var(--animation-duration) var(--init-delay),
                transform var(--animation-duration) var(--init-delay);
}

.animate-section.animate--shown .animate-item.animate-item--child {
    transition-delay: calc(var(--init-delay) + (var(--child-delay) * var(--index)));
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(1px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse Animation (for urgency text) */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
}

@keyframes pulseScale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Button Hover Animation */
.button-animation {
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.button-animation:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.button-animation:active {
    transform: scale(0.98);
    transition-duration: 100ms;
}

/* Cart Icon Animation */
@keyframes cartBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.cart-added {
    animation: cartBounce 400ms ease;
}

/* Star Rating Animation */
.rating-stars__container--overlay {
    animation: starFill 800ms ease forwards;
}

@keyframes starFill {
    from {
        width: 0%;
    }
    to {
        width: calc(var(--rating) / 5 * 100%);
    }
}

/* Pills Selection Animation */
@keyframes pillSelect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1.02);
    }
}

.variant-pill.selecting {
    animation: pillSelect 200ms ease;
}

/* Bundle Selection Animation */
@keyframes bundleSelect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

.quantity-break--selected {
    animation: bundleSelect 300ms ease;
}

/* Image Hover Animation */
.product-image-hover {
    overflow: hidden;
}

.product-image-hover img {
    transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.product-image-hover:hover img {
    transform: scale(1.05);
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Skeleton Loading */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Sticky Header Animation */
.site-header {
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.site-header.header-up {
    transform: translateY(-100%);
}

/* Sticky Cart Bar Animation */
.sticky-cart-bar {
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-cart-bar.visible {
    transform: translateY(0);
}

/* Modal Animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: modalFadeIn 200ms ease;
}

/* Drawer Animation */
@keyframes drawerSlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.drawer {
    animation: drawerSlideIn 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Notification Animation */
@keyframes notificationSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification {
    animation: notificationSlideDown 300ms ease;
}

/* Progress Bar Animation */
@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-bar {
    animation: progressBar 2s ease;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        to right,
        #f6f7f8 0%,
        #edeef1 20%,
        #f6f7f8 40%,
        #f6f7f8 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* Heartbeat Animation */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(0.9);
    }
    20%, 40% {
        transform: scale(1.1);
    }
}

.heartbeat {
    animation: heartbeat 1.3s ease infinite;
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: ripple 0.6s ease-out;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* GPU Acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
