/* ==========================================
   BROWSE PAGE STYLES
   Search Results & Filtering
   ========================================== */

.browse-page {
    width: 100%;
    min-height: 100vh;
    background: #0D0F10;
}

/* ==========================================
   BROWSE HEADER
   ========================================== */

.browse-header {
    padding: 2rem 0 3rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.browse-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Search Bar */
.browse-search-wrapper {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.browse-search-form {
    position: relative;
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.browse-search-form:focus-within {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.browse-search-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: #6B7280;
    pointer-events: none;
}

[dir="rtl"] .browse-search-icon {
    left: auto;
    right: 1rem;
}

.browse-search-input {
    flex: 1;
    padding: 1rem 1rem 1rem 3rem;
    border: none;
    font-size: 1rem;
    color: #1F2937;
    font-family: inherit;
}

[dir="rtl"] .browse-search-input {
    padding: 1rem 3rem 1rem 1rem;
}

.browse-search-input:focus {
    outline: none;
}

.browse-search-input::placeholder {
    color: #9CA3AF;
}

.browse-search-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    border: none;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    white-space: nowrap;
}

.browse-search-btn:hover {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
}

/* Results Info */
.results-info {
    text-align: center;
}

.results-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 900;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.results-count {
    font-size: 1rem;
    color: #A9ADB1;
}

/* ==========================================
   BROWSE MAIN
   ========================================== */

.browse-main {
    padding: 2rem 0 4rem;
}

.browse-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* ==========================================
   SIDEBAR FILTERS
   ========================================== */

.browse-sidebar {
    position: sticky;
    top: 100px;
    background: rgba(26, 29, 31, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.5rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) rgba(255, 255, 255, 0.05);
}

.browse-sidebar::-webkit-scrollbar {
    width: 6px;
}

.browse-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.browse-sidebar::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 3px;
}

.browse-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FFFFFF;
}

.filters-clear {
    padding: 0.35rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #3B82F6;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.filters-clear:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Filter Groups */
.filter-group {
    margin-bottom: 2rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 1rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.filter-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.filter-option span {
    flex: 1;
    font-size: 0.9rem;
    color: #A9ADB1;
}

.filter-option:hover span {
    color: #FFFFFF;
}

.option-count {
    font-size: 0.85rem;
    color: #6B7280;
}

/* ==========================================
   RESULTS AREA
   ========================================== */

.browse-results {
    min-height: 600px;
}

/* Sort Bar */
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(26, 29, 31, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.mobile-filters-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #3B82F6;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.mobile-filters-btn:hover {
    background: rgba(59, 130, 246, 0.15);
}

.mobile-filters-btn svg {
    width: 18px;
    height: 18px;
}

.sort-select {
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 200px;
}

.sort-select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.sort-select:focus {
    outline: none;
    border-color: #3B82F6;
}

.sort-select option {
    background: #1A1D1F;
    color: #FFFFFF;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.service-card {
    background: rgba(26, 29, 31, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.service-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-card:hover .service-image img {
    transform: scale(1.05);
}

.service-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

[dir="rtl"] .service-badge {
    right: auto;
    left: 12px;
}

.service-content {
    padding: 1.25rem;
}

.service-seller {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.seller-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.seller-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #FFFFFF;
}

.seller-level {
    font-size: 0.75rem;
    color: #6B7280;
}

.service-title {
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.service-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    font-size: 0.9rem;
    font-weight: 700;
    color: #F59E0B;
}

.rating-count {
    font-size: 0.85rem;
    color: #6B7280;
}

.service-price {
    text-align: right;
}

[dir="rtl"] .service-price {
    text-align: left;
}

.price-label {
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.price-amount {
    font-size: 1.1rem;
    font-weight: 800;
    color: #FFFFFF;
}

/* ==========================================
   PAGINATION
   ========================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-btn svg {
    width: 18px;
    height: 18px;
}

.pagination-dots {
    color: #6B7280;
    font-weight: 600;
}

/* ==========================================
   MOBILE FILTERS OVERLAY
   ========================================== */

.mobile-filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-filters-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-filters-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 85%;
    max-width: 350px;
    background: rgba(13, 15, 16, 0.98);
    backdrop-filter: blur(30px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 1001;
}

[dir="rtl"] .mobile-filters-panel {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
}

.mobile-filters-overlay.active .mobile-filters-panel {
    transform: translateX(0);
}

.mobile-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    background: rgba(13, 15, 16, 0.95);
    backdrop-filter: blur(20px);
    z-index: 10;
}

.mobile-filters-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FFFFFF;
}

.mobile-filters-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-filters-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.mobile-filters-close svg {
    width: 20px;
    height: 20px;
    color: #FFFFFF;
}

.mobile-filters-content {
    padding: 1.5rem;
}

.mobile-filters-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 1rem;
    position: sticky;
    bottom: 0;
    background: rgba(13, 15, 16, 0.95);
    backdrop-filter: blur(20px);
}

.mobile-filters-apply {
    flex: 1;
    padding: 0.85rem;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    border: none;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.mobile-filters-apply:hover {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
}

/* ==========================================
   RESPONSIVE - TABLET
   ========================================== */

@media (max-width: 1024px) {
    .browse-grid {
        grid-template-columns: 240px 1fr;
        gap: 1.5rem;
    }

    .browse-sidebar {
        padding: 1.25rem;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }
}

/* ==========================================
   RESPONSIVE - MOBILE
   ========================================== */

@media (max-width: 768px) {
    .browse-container {
        padding: 0 1.5rem;
    }

    .browse-header {
        padding: 1.5rem 0 2rem;
    }

    .browse-search-form {
        flex-direction: column;
        border-radius: 12px;
    }

    .browse-search-icon {
        top: 1rem;
    }

    .browse-search-input {
        width: 100%;
        padding: 0.85rem 0.85rem 0.85rem 3rem;
        text-align: left;
    }

    [dir="rtl"] .browse-search-input {
        padding: 0.85rem 3rem 0.85rem 0.85rem;
        text-align: right;
    }

    .browse-search-btn {
        width: 100%;
        border-radius: 0 0 8px 8px;
    }

    .browse-grid {
        grid-template-columns: 1fr;
    }

    .browse-sidebar {
        display: none;
    }

    .mobile-filters-btn {
        display: flex;
    }

    .sort-bar {
        padding: 1rem;
    }

    .sort-select {
        flex: 1;
        min-width: auto;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .pagination {
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .browse-container {
        padding: 0 1.25rem;
    }

    .results-title {
        font-size: 1.5rem;
    }

    .sort-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-filters-btn {
        width: 100%;
        justify-content: center;
    }

    .sort-select {
        width: 100%;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

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

.service-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

.service-card:nth-child(1) { animation-delay: 0.05s; }
.service-card:nth-child(2) { animation-delay: 0.1s; }
.service-card:nth-child(3) { animation-delay: 0.15s; }
.service-card:nth-child(4) { animation-delay: 0.2s; }
.service-card:nth-child(5) { animation-delay: 0.25s; }
.service-card:nth-child(6) { animation-delay: 0.3s; }

/* ==========================================
   END BROWSE CSS
   ========================================== */