/**
 * Modern Filter UI - Smooth & Attractive Design
 * Professional e-commerce style like Amazon/Flipkart
 */

/* ============================================
   FILTER SIDEBAR - Modern Design
   ============================================ */

.filter-sidebar {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid #e8ecef;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
    backdrop-filter: blur(10px);
}

.filter-sidebar::-webkit-scrollbar {
    width: 8px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 10px;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 10px;
    border: 2px solid #f1f3f5;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.filter-title {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.filter-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* ============================================
   ACTIVE FILTERS - Modern Chips
   ============================================ */

.active-filters-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin: 4px 4px 4px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #dee2e6;
    color: #495057;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.active-filter-chip:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.active-filter-chip .remove-filter {
    color: #6c757d;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    padding: 0 2px;
    margin-left: 4px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.active-filter-chip:hover .remove-filter {
    color: #ffffff;
    opacity: 1;
}

/* ============================================
   FILTER SECTIONS - Smooth Design
   ============================================ */

.filter-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f3f5;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section-title {
    font-weight: 600;
    color: #2d3436;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin-bottom: 12px;
    text-transform: none;
    letter-spacing: -0.3px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.3s ease;
}

.filter-section-title:hover {
    color: #667eea;
}

.filter-section-title::after {
    content: '−';
    font-size: 20px;
    font-weight: 300;
    color: #adb5bd;
    transition: all 0.3s ease;
}

.filter-section.collapsed .filter-section-title::after {
    content: '+';
    color: #667eea;
}

.filter-section.collapsed .filter-section-content {
    display: none;
}

/* ============================================
   CATEGORY LIST - Modern Checkboxes
   ============================================ */

.category-list {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.category-list::-webkit-scrollbar {
    width: 6px;
}

.category-list::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 10px;
}

.category-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 10px;
    border: 2px solid #f1f3f5;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    background: transparent;
}

.category-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.category-checkbox,
.subcategory-checkbox,
.sub-subcategory-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #667eea;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-item input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #667eea;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.category-item span {
    color: #495057;
    font-size: 14px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: all 0.3s ease;
}

.category-item input:checked + span {
    color: #667eea;
    font-weight: 600;
}

/* ============================================
   PRICE RANGE - Modern Slider
   ============================================ */

.price-range-container {
    padding: 16px 0;
}

.price-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 100%);
    outline: none;
    margin: 12px 0;
    cursor: pointer;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    border: 3px solid #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.price-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    border: 3px solid #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.price-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.price-values span {
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* ============================================
   RATING FILTER - Modern Slider
   ============================================ */

.rating-filter-container {
    padding: 16px 0;
}

.rating-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 100%);
    outline: none;
    margin: 12px 0;
    cursor: pointer;
}

.rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    border: 3px solid #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rating-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5);
}

.rating-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    border: 3px solid #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rating-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5);
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

#ratingValue {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.rating-stars {
    color: #f59e0b;
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
}

/* ============================================
   COLOR FILTER - Modern Pills
   ============================================ */

.color-filter-container {
    padding: 16px 0;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e9ecef;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.color-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.color-radio {
    display: none;
}

.color-radio:checked + .color-swatch {
    transform: scale(1);
    box-shadow: 0 0 0 3px #667eea, 0 0 0 5px rgba(102, 126, 234, 0.2);
}

.color-radio:checked ~ small {
    color: #667eea;
    font-weight: 700;
}

.color-option:has(.color-radio:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.color-option:has(.color-radio:checked) small {
    color: #ffffff;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    flex-shrink: 0;
}

.color-swatch::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/contain no-repeat;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-radio:checked + .color-swatch::after {
    transform: translate(-50%, -50%) scale(1);
}

.color-option small {
    font-size: 12px;
    color: #495057;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* ============================================
   PINCODE FILTER - Modern Input
   ============================================ */

.pincode-filter-container {
    padding: 16px 0;
}

#pincodeFilter {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#pincodeFilter:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(102, 126, 234, 0.2);
    background: #ffffff;
}

#pincodeFilter::placeholder {
    color: #adb5bd;
}

#applyPincodeBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-top: 8px;
}

#applyPincodeBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* ============================================
   FILTER ACTIONS - Modern Buttons
   ============================================ */

.filter-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid #f1f3f5;
}

.filter-actions .btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 20px;
}

.filter-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.filter-actions .btn-outline-secondary {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    color: #495057;
}

.filter-actions .btn-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.filter-actions .btn-outline-danger {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #fee2e2;
    color: #ef4444;
}

.filter-actions .btn-outline-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* ============================================
   RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    .filter-sidebar {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 16px;
        max-height: calc(100vh - 60px);
        top: 10px;
    }
    
    .filter-title {
        font-size: 18px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .filter-title::after {
        width: 50px;
    }
    
    .active-filters-display {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .active-filter-chip {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .filter-section {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .filter-section-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .category-list {
        max-height: 200px;
    }
    
    .category-item {
        padding: 8px 10px;
    }
    
    .category-item span {
        font-size: 13px;
    }
    
    .category-checkbox,
    .subcategory-checkbox,
    .sub-subcategory-checkbox,
    .category-item input[type="radio"] {
        width: 16px;
        height: 16px;
        margin-right: 10px;
    }
    
    .price-range-container,
    .rating-filter-container,
    .color-filter-container,
    .pincode-filter-container {
        padding: 12px 0;
    }
    
    .price-slider,
    .rating-slider {
        height: 5px;
    }
    
    .price-slider::-webkit-slider-thumb,
    .rating-slider::-webkit-slider-thumb,
    .price-slider::-moz-range-thumb,
    .rating-slider::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
    
    .price-values span,
    #ratingValue {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .color-options {
        gap: 6px;
    }
    
    .color-option {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .color-swatch {
        width: 20px;
        height: 20px;
    }
    
    .color-option small {
        font-size: 11px;
    }
    
    #pincodeFilter {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    #applyPincodeBtn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .filter-actions {
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .filter-actions .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .filter-sidebar {
        padding: 12px;
    }
    
    .filter-title {
        font-size: 16px;
    }
    
    .active-filter-chip {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .color-option {
        padding: 5px 8px;
    }
    
    .color-swatch {
        width: 18px;
        height: 18px;
    }
    
    .color-option small {
        font-size: 10px;
    }
    
    #pincodeFilter {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    #applyPincodeBtn {
        padding: 6px 12px;
        font-size: 12px;
    }
}
