/* ==========================================================================
   PRINCE GRAPHICS - TASTEFUL ANIMATION DESIGN SYSTEM
   Optimized for 60fps performance using transform & opacity GPU compositing.
   Zero layout thrashing; respects prefers-reduced-motion.
   ========================================================================== */

/* 1. FADE IN & SLIDE UP (Scroll & Load Reveals) */
@keyframes pgxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.animate-fade-in {
    animation: pgxFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    animation: pgxSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scroll reveal helper classes */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

/* Stagger Delays */
.delay-100 { transition-delay: 0.1s !important; animation-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; animation-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; animation-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; animation-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; animation-delay: 0.5s !important; }

/* 2. HOVER LIFT (Subtle Elevation) */
.hover-lift {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease !important;
    will-change: transform, box-shadow;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px -6px rgba(27, 42, 74, 0.12), 0 6px 12px -4px rgba(0, 0, 0, 0.05) !important;
}

.hover-lift-sm:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px -4px rgba(27, 42, 74, 0.10) !important;
}

/* 3. IMAGE ZOOM (Tasteful Card Media Hover) */
.img-zoom-wrapper {
    overflow: hidden;
    border-radius: inherit;
    display: block;
}

.img-zoom-wrapper img,
.img-zoom {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: transform;
}

.img-zoom-wrapper:hover img,
.img-zoom:hover {
    transform: scale(1.06);
}

/* 4. NUMBER COUNTERS (Crisp Tabular Typography) */
.counter-value {
    font-variant-numeric: tabular-nums;
    display: inline-block;
}

/* 5. PROGRESS INDICATORS & SHEEN FLOW */
@keyframes progressSheen {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.progress-bar-animated-smooth {
    background: linear-gradient(90deg, #1b2a4a 0%, #d4af37 50%, #1b2a4a 100%);
    background-size: 200% 100%;
    animation: progressSheen 2.5s infinite linear;
}

/* 6. SMOOTH MODAL TRANSITIONS */
.modal.fade .modal-dialog {
    transform: scale(0.94) translateY(-14px);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
    will-change: transform, opacity;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 7. LOADING SKELETONS (Shimmer placeholders) */
@keyframes skeletonShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f2f5 25%, #e2e6ea 37%, #f0f2f5 63%);
    background-size: 400% 100%;
    animation: skeletonShimmer 1.4s ease infinite;
    border-radius: 6px;
    display: inline-block;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 6px;
    width: 100%;
}

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

.skeleton-circle {
    border-radius: 50% !important;
    width: 48px;
    height: 48px;
}

.skeleton-card {
    height: 220px;
    width: 100%;
    border-radius: 12px;
}

/* 8. TOAST NOTIFICATIONS (Slide-In Toast Stack) */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

.pgx-toast {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
    border-left: 5px solid #1b2a4a;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transform: translateX(60px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    overflow: hidden;
    position: relative;
}

.pgx-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.pgx-toast.hide {
    opacity: 0;
    transform: translateX(60px);
}

.pgx-toast.toast-success { border-left-color: #10b981; }
.pgx-toast.toast-danger { border-left-color: #ef4444; }
.pgx-toast.toast-warning { border-left-color: #f59e0b; }
.pgx-toast.toast-info { border-left-color: #3b82f6; }

.pgx-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(27, 42, 74, 0.2);
    width: 100%;
    transform-origin: left;
}

/* 9. CART ANIMATION (Badge Pop & Item Fly) */
@keyframes cartBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.35) rotate(-6deg); }
    60% { transform: scale(0.92) rotate(3deg); }
    100% { transform: scale(1) rotate(0); }
}

.cart-badge-bump {
    animation: cartBounce 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: #d4af37 !important;
    color: #0f172a !important;
}

/* 10. ORDER TIMELINE ANIMATION */
@keyframes timelinePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.timeline-node-active {
    animation: timelinePulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
    background: #d4af37 !important;
    color: #0f172a !important;
}

.timeline-line-animated {
    position: relative;
    overflow: hidden;
}

.timeline-line-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.8), transparent);
    animation: progressSheen 2s infinite linear;
}

/* Accessibility: Respect Reduced Motion Preferences */
@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;
    }
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}
