/**
 * Enhanced Advanced Filters System CSS
 * Comprehensive styling for 60+ filter options
 * Features: Responsive design, animations, dark theme
 */

/* ==================== FILTER PANEL ==================== */
.enhanced-filters-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.enhanced-filters-panel.active {
    right: 0;
}

/* ==================== FILTERS HEADER ==================== */
.filters-header {
    padding: 25px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.filters-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #D4AF37;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.filters-header h3 i {
    font-size: 1.3rem;
}

.filters-actions {
    display: flex;
    gap: 10px;
}

.filter-preset-btn,
.filter-save-btn,
.filter-clear-btn,
.filter-close-btn {
    padding: 8px 15px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    color: #D4AF37;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-preset-btn:hover,
.filter-save-btn:hover,
.filter-clear-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: #D4AF37;
    transform: translateY(-2px);
}

.filter-close-btn {
    padding: 8px 12px;
}

.filter-close-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: #ff3b30;
    color: #ff3b30;
}

/* ==================== FILTERS SEARCH ==================== */
.filters-search {
    padding: 20px 25px;
    background: rgba(26, 26, 26, 0.5);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    position: relative;
    flex-shrink: 0;
}

.filter-search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: rgba(42, 42, 42, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-search-input:focus {
    outline: none;
    border-color: #D4AF37;
    background: rgba(42, 42, 42, 1);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.filter-search-input::placeholder {
    color: #808080;
}

.filters-search i {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: #D4AF37;
    font-size: 1rem;
    pointer-events: none;
}

/* ==================== FILTERS PRESETS ==================== */
.filters-presets {
    padding: 20px 25px;
    background: rgba(26, 26, 26, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    flex-shrink: 0;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.preset-card {
    padding: 15px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
}

.preset-card:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%);
    border-color: #D4AF37;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.preset-name {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.preset-count {
    font-size: 0.85rem;
    color: #b0b0b0;
}

/* ==================== FILTERS CONTENT ==================== */
.filters-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    scrollbar-width: thin;
    scrollbar-color: #D4AF37 #1a1a1a;
}

.filters-content::-webkit-scrollbar {
    width: 8px;
}

.filters-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.filters-content::-webkit-scrollbar-thumb {
    background: #D4AF37;
    border-radius: 4px;
}

.filters-content::-webkit-scrollbar-thumb:hover {
    background: #E5C158;
}

/* ==================== FILTER CATEGORY ==================== */
.filter-category {
    margin-bottom: 25px;
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-category:hover {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.1);
}

.category-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.8) 0%, rgba(26, 26, 26, 0.8) 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.category-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.category-icon {
    font-size: 1.2rem;
}

.category-count {
    display: none;
    padding: 3px 10px;
    background: #D4AF37;
    color: #0a0a0a;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 8px;
}

.category-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.select-all-btn,
.clear-category-btn {
    padding: 6px 12px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    color: #D4AF37;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.select-all-btn:hover,
.clear-category-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: #D4AF37;
}

.toggle-category-btn {
    padding: 6px 10px;
    background: transparent;
    border: none;
    color: #D4AF37;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.toggle-category-btn:hover {
    color: #E5C158;
    transform: scale(1.1);
}

/* ==================== CATEGORY OPTIONS ==================== */
.category-options {
    padding: 15px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(42, 42, 42, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-option:hover {
    background: rgba(42, 42, 42, 0.8);
    border-color: #D4AF37;
    transform: translateX(3px);
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #D4AF37;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.option-label {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
}

.option-description {
    color: #b0b0b0;
    font-size: 0.8rem;
}

/* Single column for price options */
.filter-category[data-category="price"] .category-options {
    grid-template-columns: 1fr;
}

/* ==================== FILTERS FOOTER ==================== */
.filters-footer {
    padding: 20px 25px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-top: 2px solid rgba(212, 175, 55, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.active-filters-count {
    font-size: 1rem;
    color: #b0b0b0;
}

.active-filters-count span {
    font-size: 1.3rem;
    font-weight: 700;
    color: #D4AF37;
    margin-right: 5px;
}

.apply-filters-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #D4AF37 0%, #E5C158 100%);
    border: none;
    border-radius: 10px;
    color: #0a0a0a;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
}

.apply-filters-btn:active {
    transform: translateY(0);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .enhanced-filters-panel {
        width: 100%;
        right: -100%;
    }
    
    .filters-header h3 {
        font-size: 1.3rem;
    }
    
    .filters-actions {
        gap: 6px;
    }
    
    .filter-preset-btn,
    .filter-save-btn,
    .filter-clear-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .filter-preset-btn span,
    .filter-save-btn span,
    .filter-clear-btn span {
        display: none;
    }
    
    .presets-grid {
        grid-template-columns: 1fr;
    }
    
    .category-options {
        grid-template-columns: 1fr;
    }
    
    .category-actions {
        flex-wrap: wrap;
    }
    
    .select-all-btn,
    .clear-category-btn {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .filters-header {
        padding: 20px 15px;
    }
    
    .filters-search {
        padding: 15px;
    }
    
    .filters-content {
        padding: 15px;
    }
    
    .filters-footer {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
    }
    
    .apply-filters-btn {
        width: 100%;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.enhanced-filters-panel.active {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-option {
    animation: fadeIn 0.3s ease;
}

/* ==================== ACCESSIBILITY ==================== */
.filter-option:focus-within {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

.filter-search-input:focus {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

/* ==================== DARK MODE ENHANCEMENTS ==================== */
@media (prefers-color-scheme: dark) {
    .enhanced-filters-panel {
        background: linear-gradient(135deg, #0a0a0a 0%, #000000 100%);
    }
    
    .filter-category {
        background: rgba(10, 10, 10, 0.8);
    }
    
    .filter-option {
        background: rgba(26, 26, 26, 0.8);
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .enhanced-filters-panel {
        display: none;
    }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    .enhanced-filters-panel,
    .filter-option,
    .preset-card,
    button {
        transition: none;
        animation: none;
    }
}