/* ============================================
   SHOPISTIX E-COMMERCE - ANIMATION LIBRARY
   Premium Animation Effects
   ============================================ */

/* ===== KEYFRAME ANIMATIONS ===== */

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Rotate Animations */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }

    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Bounce Animations */
@keyframes bounce {

    0%,
    20%,
    53%,
    100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translateY(0);
    }

    40%,
    43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-20px);
    }

    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-10px);
    }

    80% {
        transform: translateY(0);
    }

    90% {
        transform: translateY(-4px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* Pulse Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes pulseScale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.1);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(1);
    }
}

/* Shake Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-3deg);
    }

    50% {
        transform: rotate(3deg);
    }

    75% {
        transform: rotate(-3deg);
    }
}

/* Float Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes floatShadow {

    0%,
    100% {
        transform: translateY(0);
        box-shadow: 0 20px 50px rgba(212, 168, 83, 0.3);
    }

    50% {
        transform: translateY(-15px);
        box-shadow: 0 30px 60px rgba(212, 168, 83, 0.2);
    }
}

/* Glow Animations */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(212, 168, 83, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(212, 168, 83, 0.6);
    }
}

@keyframes glowPurple {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(45, 27, 105, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(45, 27, 105, 0.6);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Text Animations */
@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Wave Animation */
@keyframes wave {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    25% {
        transform: translateY(-5px) rotate(3deg);
    }

    75% {
        transform: translateY(5px) rotate(-3deg);
    }
}

/* Ripple Animation */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Marquee Animation */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ===== ANIMATION CLASSES ===== */

/* Base Animation Setup */
.animate {
    animation-fill-mode: both;
    animation-duration: 0.6s;
}

.animate-once {
    animation-iteration-count: 1;
}

.animate-infinite {
    animation-iteration-count: infinite;
}

/* Fade Classes */
.fade-in {
    animation-name: fadeIn;
}

.fade-in-up {
    animation-name: fadeInUp;
}

.fade-in-down {
    animation-name: fadeInDown;
}

.fade-in-left {
    animation-name: fadeInLeft;
}

.fade-in-right {
    animation-name: fadeInRight;
}

/* Scale Classes */
.scale-in {
    animation-name: scaleIn;
}

.scale-up {
    animation-name: scaleUp;
}

.pop-in {
    animation-name: popIn;
}

/* Slide Classes */
.slide-in-up {
    animation-name: slideInUp;
}

.slide-in-down {
    animation-name: slideInDown;
}

.slide-in-left {
    animation-name: slideInLeft;
}

.slide-in-right {
    animation-name: slideInRight;
}

/* Bounce Classes */
.bounce {
    animation-name: bounce;
}

.bounce-in {
    animation-name: bounceIn;
}

/* Other Effect Classes */
.pulse {
    animation-name: pulse;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

.pulse-scale {
    animation-name: pulseScale;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

.float {
    animation-name: float;
    animation-duration: 3s;
    animation-iteration-count: infinite;
}

.glow {
    animation-name: glow;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

.spin {
    animation-name: spin;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.shake {
    animation-name: shake;
}

.wiggle {
    animation-name: wiggle;
    animation-duration: 0.5s;
}

/* Duration Modifiers */
.animate-fast {
    animation-duration: 0.3s;
}

.animate-slow {
    animation-duration: 0.8s;
}

.animate-slower {
    animation-duration: 1.2s;
}

/* Delay Modifiers */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}

.delay-7 {
    animation-delay: 0.7s;
}

.delay-8 {
    animation-delay: 0.8s;
}

.delay-9 {
    animation-delay: 0.9s;
}

.delay-10 {
    animation-delay: 1s;
}

/* Timing Functions */
.ease-in {
    animation-timing-function: ease-in;
}

.ease-out {
    animation-timing-function: ease-out;
}

.ease-in-out {
    animation-timing-function: ease-in-out;
}

.ease-elastic {
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Reveal */
.stagger-reveal .reveal-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-reveal.active .reveal-item:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-reveal.active .reveal-item:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-reveal.active .reveal-item:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-reveal.active .reveal-item:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-reveal.active .reveal-item:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-reveal.active .reveal-item:nth-child(6) {
    transition-delay: 0.6s;
}

.stagger-reveal.active .reveal-item:nth-child(7) {
    transition-delay: 0.7s;
}

.stagger-reveal.active .reveal-item:nth-child(8) {
    transition-delay: 0.8s;
}

.stagger-reveal.active .reveal-item {
    opacity: 1;
    transform: translateY(0);
}

/* ===== HOVER ANIMATIONS ===== */

/* Card Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(212, 168, 83, 0.4);
}

.hover-border-glow {
    position: relative;
}

.hover-border-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.hover-border-glow:hover::before {
    opacity: 1;
}

/* Image Hover Effects */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

.img-zoom-rotate {
    overflow: hidden;
}

.img-zoom-rotate img {
    transition: transform 0.5s ease;
}

.img-zoom-rotate:hover img {
    transform: scale(1.1) rotate(3deg);
}

/* Button Hover Effects */
.btn-hover-slide {
    position: relative;
    overflow: hidden;
}

.btn-hover-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-hover-slide:hover::before {
    left: 100%;
}

.btn-hover-fill {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-hover-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--secondary-dark);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-hover-fill:hover::before {
    width: 100%;
}

/* Link Hover Effects */
.link-underline {
    position: relative;
    display: inline-block;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

.link-underline-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Icon Hover Effects */
.icon-hover-bounce:hover {
    animation: bounce 0.6s ease;
}

.icon-hover-spin:hover {
    animation: spin 0.5s ease;
}

.icon-hover-shake:hover {
    animation: shake 0.5s ease;
}

/* ===== LOADING ANIMATIONS ===== */

/* Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Dots */
.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--secondary);
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-image {
    height: 200px;
}

/* ===== SPECIAL EFFECTS ===== */

/* Gradient Text Animation */
.gradient-text-animated {
    background: linear-gradient(90deg, var(--secondary), var(--accent), var(--secondary));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* Particle Background Effect (CSS Only) */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--secondary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    top: 40%;
    left: 30%;
    animation-delay: 1s;
}

.particle:nth-child(3) {
    top: 60%;
    left: 50%;
    animation-delay: 2s;
}

.particle:nth-child(4) {
    top: 80%;
    left: 70%;
    animation-delay: 3s;
}

.particle:nth-child(5) {
    top: 30%;
    left: 90%;
    animation-delay: 4s;
}

/* Ripple Effect */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* Morphing Shape */
@keyframes morph {

    0%,
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph-shape {
    animation: morph 8s ease-in-out infinite;
}

/* ===== CART ANIMATIONS ===== */
.cart-add-animation {
    animation: bounceIn 0.5s ease;
}

.cart-shake {
    animation: shake 0.5s ease;
}

.cart-badge-pulse {
    animation: pulseScale 0.3s ease;
}

/* ===== PAGE TRANSITIONS ===== */
.page-transition-fade {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.page-transition-slide {
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

/* ===== REDUCED MOTION ===== */
@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;
    }
}