/**
 * Product Catalog CSS Enhancements
 * Advanced animations and UI effects for the product catalog
 */

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

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

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

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

.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    line-height: 0;
    height: 80px;
}

.wave-svg {
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 100%;
}

/* Animasi gelombang dengan kecepatan berbeda */
.wave-layer-1 {
    animation: wave-movement 15s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
    opacity: 0.3;
}

.wave-layer-2 {
    animation: wave-movement 20s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
    opacity: 0.5;
}

.wave-layer-3 {
    animation: wave-movement 25s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
    opacity: 0.7;
}

.wave-layer-4 {
    animation: wave-movement 30s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
    opacity: 1;
}

@keyframes wave-movement {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

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

/* Background Elements with static opacity */
/* We're keeping the elements but making them static */

.animate-blob {
    opacity: 0.15 !important;
    /* No animation, just static styling */
}

.animation-delay-2000 {
    opacity: 0.15 !important;
}

.animation-delay-4000 {
    opacity: 0.15 !important;
}

/* Product Cards Hover Effects */
.product-card {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Add staggered animation delays to product cards */
.product-card:nth-child(1) {
    animation-delay: 0.1s;
}
.product-card:nth-child(2) {
    animation-delay: 0.2s;
}
.product-card:nth-child(3) {
    animation-delay: 0.3s;
}
.product-card:nth-child(4) {
    animation-delay: 0.4s;
}
.product-card:nth-child(5) {
    animation-delay: 0.5s;
}
.product-card:nth-child(6) {
    animation-delay: 0.6s;
}
.product-card:nth-child(7) {
    animation-delay: 0.7s;
}
.product-card:nth-child(8) {
    animation-delay: 0.8s;
}
.product-card:nth-child(9) {
    animation-delay: 0.9s;
}
.product-card:nth-child(10) {
    animation-delay: 1s;
}
.product-card:nth-child(n + 11) {
    animation-delay: 1.1s;
}

/* Button hover effects */
.btn-primary {
    @apply bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white font-medium transition-all duration-300;
}

.btn-primary:hover {
    @apply shadow-lg transform scale-[1.02];
}

/* Badge styles */
.badge {
    @apply inline-flex items-center text-xs font-medium px-2.5 py-0.5 rounded-full;
}

.badge-blue {
    @apply bg-blue-100 text-blue-800 border border-blue-200;
}

.badge-green {
    @apply bg-green-100 text-green-800 border border-green-200;
}

.badge-red {
    @apply bg-red-100 text-red-800 border border-red-200;
}

.badge-yellow {
    @apply bg-yellow-100 text-yellow-800 border border-yellow-200;
}

/* Gradient text effect */
.gradient-text {
    @apply bg-clip-text text-transparent bg-gradient-to-r from-blue-600 to-indigo-600;
}

/* Custom loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Better scrollbars */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(203, 213, 225, 0.4) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 5px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: rgba(203, 213, 225, 0.4);
    border-radius: 20px;
}

/* Filter sidebar on mobile */
@media (max-width: 768px) {
    .filter-sidebar {
        @apply fixed inset-y-0 left-0 z-40 w-full max-w-xs bg-white shadow-xl transform -translate-x-full transition-transform duration-300 ease-in-out;
    }

    .filter-sidebar.open {
        @apply translate-x-0;
    }

    .filter-backdrop {
        @apply fixed inset-0 bg-black bg-opacity-50 z-30 hidden;
    }

    .filter-backdrop.open {
        @apply block;
    }
}

/* Text truncation utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Toast notifications */
.toast-notification {
    animation: fadeInRight 0.3s ease-out forwards;
}
