/* ===================================
   SEARCH PAGE FILTERS STYLES
   =================================== */

/* Search Filters Wrapper */
.search-filters-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.08);
    border: 1px solid rgba(139, 69, 19, 0.1);
}

/* Search Refine Box */
.search-refine-box {
    margin-bottom: 1.5rem;
}

.search-refine-form {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(139, 69, 19, 0.15);
}

.search-input-wrapper i {
    color: #999;
    margin-left: 0.8rem;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.search-input-wrapper:focus-within i {
    color: var(--primary-color);
}

.search-refine-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    background: transparent;
    color: var(--text-color);
}

.search-refine-input::placeholder {
    color: #999;
}

.search-refine-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a0522d 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.search-refine-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 69, 19, 0.4);
}

.search-refine-btn:active {
    transform: translateY(0);
}

/* Category Filters */
.search-category-filters {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed rgba(139, 69, 19, 0.15);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
}

.filter-label i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Category Filter Chips */
.category-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    position: relative;
    overflow: hidden;
}

.category-chip::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a0522d 100%);
    transition: width 0.3s ease;
    z-index: 0;
}

.category-chip i,
.category-chip span {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.category-chip:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.2);
}

.category-chip:hover::before {
    width: 100%;
}

.category-chip:hover i,
.category-chip:hover span {
    color: white;
}

.category-chip.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a0522d 100%);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.category-chip.active i {
    color: white;
}

.category-chip i {
    font-size: 1rem;
}

/* Filter Results Count Badge */
.category-chip[data-count]::after {
    content: attr(data-count);
    background: rgba(255, 255, 255, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 0.3rem;
}

.category-chip.active[data-count]::after {
    background: rgba(255, 255, 255, 0.25);
}

/* Loading State */
.search-filters-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

.search-filters-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-filters-wrapper {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .search-input-wrapper {
        flex-direction: column;
        align-items: stretch;
        border-radius: 16px;
        padding: 0.8rem;
    }

    .search-refine-input {
        padding: 0.8rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid #e0e0e0;
    }

    .search-input-wrapper i {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .search-refine-btn {
        width: 100%;
        padding: 0.9rem;
        font-size: 1rem;
    }

    .category-filter-chips {
        gap: 0.6rem;
    }

    .category-chip {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }

    .filter-label {
        font-size: 0.95rem;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .search-filters-wrapper {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        border-color: rgba(139, 69, 19, 0.3);
    }

    .search-input-wrapper {
        background: #34495e;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .search-refine-input {
        color: #ecf0f1;
    }

    .category-chip {
        background: #34495e;
        border-color: rgba(255, 255, 255, 0.1);
        color: #ecf0f1;
    }
}

/* Animation for slide-up effect */
.search-filters-wrapper.slide-up {
    animation: slideUpFade 0.6s ease-out;
}

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

/* Active Filter Indicator */
.category-filter-chips::before {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

/* Hover Effects for Touch Devices */
@media (hover: none) {
    .category-chip:hover {
        transform: none;
    }

    .category-chip:active {
        transform: scale(0.95);
    }
}

/* Clear Filters Button */
.clear-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px dashed #999;
    border-radius: 50px;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.clear-filters-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.clear-filters-btn i {
    font-size: 0.9rem;
}
