/**
 * Animations & Effects
 * 
 * @package Checkout_Peak
 */

/* Glassmorphism Effects */
.apple-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.apple-glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px 0 rgba(31, 38, 135, 0.08);
}

/* Dark Mode Glassmorphism */
@media (prefers-color-scheme: dark) {
    .apple-glass {
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    }

    .apple-glass-card {
        background: rgba(0, 0, 0, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.2);
    }
}

/* Glow Pulse Animation */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 102, 204, 0.3),
                    0 0 40px rgba(0, 102, 204, 0.2),
                    0 0 60px rgba(0, 102, 204, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 102, 204, 0.5),
                    0 0 60px rgba(0, 102, 204, 0.3),
                    0 0 90px rgba(0, 102, 204, 0.2);
    }
}

.glow-pulse {
    animation: glow-pulse 3s ease-in-out infinite;
}

/* Subtle Rotate Animation */
@keyframes subtle-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.subtle-rotate {
    animation: subtle-rotate 20s linear infinite;
}

/* Spin Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Slide In from Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Scale Up Animation */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-up {
    animation: scaleUp 0.4s ease-out forwards;
}

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

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary) / 0.6) 100%);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(210 100% 60%) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Parallax Effect (via JavaScript) */
.parallax {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid hsl(var(--muted));
    border-top-color: hsl(var(--primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Skeleton Loader */
@keyframes skeleton-loading {
    0% {
        background-color: hsl(var(--muted));
    }
    50% {
        background-color: hsl(var(--muted) / 0.6);
    }
    100% {
        background-color: hsl(var(--muted));
    }
}

.skeleton {
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

/* Transition Utilities */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

/* Selection */
::selection {
    background-color: hsl(var(--primary) / 0.2);
    color: hsl(var(--foreground));
}
