/* ============================================
   Dzrto Web - Animations
   ============================================ */

/* ============================================
   Keyframe Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.3);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.3);
    }

    70% {
        transform: scale(1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   Animation Classes
   ============================================ */

.animate-fadeIn {
    animation: fadeIn var(--transition-normal) ease forwards;
}

.animate-slideInUp {
    animation: slideInUp var(--transition-normal) ease forwards;
}

.animate-slideInDown {
    animation: slideInDown var(--transition-normal) ease forwards;
}

.animate-scaleIn {
    animation: scaleIn var(--transition-normal) ease forwards;
}

.animate-bounce {
    animation: bounce 1s ease infinite;
}

.animate-pulse {
    animation: pulse 2s ease infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease;
}

.animate-heartBeat {
    animation: heartBeat 1s ease;
}

/* ============================================
   Page Transitions
   ============================================ */

.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all var(--transition-normal) ease;
}

.page-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all var(--transition-normal) ease;
}

/* ============================================
   Staggered Animations
   ============================================ */

.stagger-animation>* {
    opacity: 0;
    animation: fadeIn var(--transition-normal) ease forwards;
}

.stagger-animation>*:nth-child(1) {
    animation-delay: 0ms;
}

.stagger-animation>*:nth-child(2) {
    animation-delay: 50ms;
}

.stagger-animation>*:nth-child(3) {
    animation-delay: 100ms;
}

.stagger-animation>*:nth-child(4) {
    animation-delay: 150ms;
}

.stagger-animation>*:nth-child(5) {
    animation-delay: 200ms;
}

.stagger-animation>*:nth-child(6) {
    animation-delay: 250ms;
}

.stagger-animation>*:nth-child(7) {
    animation-delay: 300ms;
}

.stagger-animation>*:nth-child(8) {
    animation-delay: 350ms;
}

.stagger-animation>*:nth-child(9) {
    animation-delay: 400ms;
}

.stagger-animation>*:nth-child(10) {
    animation-delay: 450ms;
}

/* ============================================
   Hover Effects
   ============================================ */

.hover-lift {
    transition: transform var(--transition-normal) ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform var(--transition-fast) ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow var(--transition-normal) ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
}

/* ============================================
   Ripple Effect
   ============================================ */

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.ripple-effect:active::after {
    animation: ripple 0.6s ease-out;
}

/* ============================================
   Loading Dots
   ============================================ */

.loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* ============================================
   Scroll Reveal
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   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;
    }

    .animate-fadeIn,
    .animate-slideInUp,
    .animate-slideInDown,
    .animate-scaleIn,
    .animate-bounce,
    .animate-pulse,
    .animate-float {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .reveal,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Order Status Update Animation
   ============================================ */

@keyframes statusPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(162, 100, 188, 0.3);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 25px rgba(162, 100, 188, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(162, 100, 188, 0.3);
    }
}

@keyframes progressPulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.active-order-tracker.status-updated {
    animation: statusPulse 0.5s ease-out;
}

.active-order-tracker.status-updated .progress-bar {
    animation: progressPulse 0.5s ease-out;
}

/* Smooth progress bar transition */
.active-order-tracker .progress-bar {
    transition: width 0.5s ease-out;
}

/* Icon transition */
.active-order-tracker .tracker-icon i {
    transition: all 0.3s ease-out;
}