/* PopMart LABUBU Fun - Animation Styles */

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes wiggle {
    0%, 7% {
        transform: rotateZ(0);
    }
    15% {
        transform: rotateZ(-15deg);
    }
    20% {
        transform: rotateZ(10deg);
    }
    25% {
        transform: rotateZ(-10deg);
    }
    30% {
        transform: rotateZ(6deg);
    }
    35% {
        transform: rotateZ(-4deg);
    }
    40%, 100% {
        transform: rotateZ(0);
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatLarge {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

@keyframes loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-delay {
    animation: fadeIn 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

.slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

.slide-up-delay {
    animation: slideUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.slide-up-delay-2 {
    animation: slideUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.slide-down {
    animation: slideDown 0.8s ease-out forwards;
}

.slide-left {
    animation: slideLeft 0.8s ease-out forwards;
}

.slide-right {
    animation: slideRight 0.8s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

.scale-in-delay {
    animation: scaleIn 0.6s ease-out 0.3s forwards;
    opacity: 0;
}

.rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
}

.bounce-in {
    animation: bounce 1s ease-out forwards;
}

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

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

.float-large-animation {
    animation: floatLarge 4s ease-in-out infinite;
}

.wiggle-animation {
    animation: wiggle 2s ease-in-out;
}

.shake-animation {
    animation: shake 0.5s ease-in-out;
}

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

.gradient-animation {
    background: linear-gradient(-45deg, #ff4d70, #4f46e5, #06b6d4, #10b981);
    background-size: 400% 400%;
    animation: gradient 4s ease infinite;
}

.shimmer-animation {
    position: relative;
    overflow: hidden;
}

.shimmer-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

.typewriter-animation {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typewriter 3s steps(30, end), blink 0.75s step-end infinite;
}

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

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.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-bounce {
    transition: transform 0.3s ease;
}

.hover-bounce:hover {
    animation: bounce 0.6s ease;
}

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

.hover-wiggle:hover {
    animation: wiggle 0.8s ease;
}

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

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 77, 112, 0.3);
}

.hover-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    background-size: 200% 200%;
    transition: background-position 0.3s ease;
}

.hover-gradient:hover {
    background-position: right center;
}

/* Interactive Elements */
.button-press {
    transition: transform 0.1s ease;
}

.button-press:active {
    transform: scale(0.95);
}

.card-tilt {
    transition: transform 0.3s ease;
}

.card-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Loading Animations */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: loading 1s linear infinite;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots::before,
.loading-dots::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.4s ease-in-out infinite both;
}

.loading-dots::before {
    animation-delay: -0.32s;
}

.loading-dots::after {
    animation-delay: -0.16s;
}

.loading-bar {
    position: relative;
    background-color: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.loading-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: shimmer 2s infinite;
}

/* Progress Animations */
.progress-fill {
    animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-width, 100%);
    }
}

/* Reveal Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

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

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

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

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

/* Page Transition */
.page-transition {
    animation: fadeIn 0.5s ease-out;
}

/* Focus Animations */
.focus-ring {
    transition: box-shadow 0.2s ease;
}

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 77, 112, 0.3);
}

/* Success/Error Animations */
.success-animation {
    animation: scaleIn 0.5s ease-out, pulse 0.5s ease-out 0.5s;
}

.error-animation {
    animation: shake 0.5s ease-out;
}

/* Notification Animations */
.notification-enter {
    animation: slideDown 0.3s ease-out;
}

.notification-exit {
    animation: slideUp 0.3s ease-out;
}

/* Modal Animations */
.modal-enter {
    animation: fadeIn 0.3s ease-out, scaleIn 0.3s ease-out;
}

.modal-exit {
    animation: fadeIn 0.3s ease-out reverse, scaleOut 0.3s ease-out;
}

.modal-backdrop {
    animation: fadeIn 0.3s ease-out;
}

/* Tooltip Animations */
.tooltip-enter {
    animation: fadeIn 0.2s ease-out, scaleIn 0.2s ease-out;
}

.tooltip-exit {
    animation: fadeIn 0.2s ease-out reverse;
}

/* Dropdown Animations */
.dropdown-enter {
    animation: slideDown 0.2s ease-out, fadeIn 0.2s ease-out;
}

.dropdown-exit {
    animation: slideUp 0.2s ease-out, fadeIn 0.2s ease-out reverse;
}

/* Tab Animations */
.tab-content-enter {
    animation: slideLeft 0.3s ease-out, fadeIn 0.3s ease-out;
}

.tab-content-exit {
    animation: slideRight 0.3s ease-out, fadeIn 0.3s ease-out reverse;
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.animation-paused {
    animation-play-state: paused;
}

/* Reduced Motion Support */
@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;
    }
    
    .float-animation,
    .pulse-animation,
    .gradient-animation,
    .shimmer-animation {
        animation: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .gradient-animation {
        background: var(--primary);
    }
    
    .shimmer-animation::before {
        background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.3), transparent);
    }
}

/* Dark Mode Animations */
@media (prefers-color-scheme: dark) {
    .shimmer-animation::before {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    }
}

/* Animation Utilities */
.animation-delay-100 {
    animation-delay: 0.1s;
}

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

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

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

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

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

.animation-duration-fast {
    animation-duration: 0.3s;
}

.animation-duration-normal {
    animation-duration: 0.5s;
}

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

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

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

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

.animation-linear {
    animation-timing-function: linear;
}

/* Custom Easing Functions */
.animation-bounce {
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animation-elastic {
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animation-back {
    animation-timing-function: cubic-bezier(0.6, -0.28, 0.735, 0.045);
}