/* Custom styles for the furniture catalog */

/* Line clamp utilities for text truncation */
.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;
}

/* Smooth transitions for all elements */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f3f4;
}

::-webkit-scrollbar-thumb {
    background: #9aa0a6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #80868b;
}

/* Focus styles for accessibility */
.focus\:ring-primary-500:focus {
    --tw-ring-opacity: 1;
    --tw-ring-color: rgb(154 160 166 / var(--tw-ring-opacity));
}

/* Image loading placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f1f3f4 25%, #e8eaed 50%, #f1f3f4 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Custom hover effects */
.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Gradient overlays */
.gradient-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.1) 0%, rgba(32, 33, 36, 0.1) 100%);
    pointer-events: none;
}

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

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

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

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

/* Product card enhancements */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Button animations */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Search input enhancements */
.search-input {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(218, 220, 224, 0.5);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #9aa0a6;
    box-shadow: 0 0 0 3px rgba(154, 160, 166, 0.1);
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f1f3f4 25%, #e8eaed 50%, #f1f3f4 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

/* Filter chips */
.filter-chip {
    transition: all 0.2s ease;
}

.filter-chip:hover {
    transform: scale(1.05);
}

.filter-chip.active {
    background: linear-gradient(135deg, #202124 0%, #3c4043 100%);
    box-shadow: 0 4px 12px rgba(32, 33, 36, 0.3);
}

/* Responsive grid enhancements */
@media (min-width: 640px) {
    .grid-responsive {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-friendly {
        color: #000 !important;
        background: #fff !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .contrast-border {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom focus indicators for keyboard navigation */
.focus-visible\:ring-4:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(154, 160, 166, 0.4);
}

/* Container queries for responsive components */
@container (min-width: 300px) {
    .container-responsive {
        padding: 1.5rem;
    }
}

@container (min-width: 500px) {
    .container-responsive {
        padding: 2rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}
