/* Category Page Styles - Modern Classified Ads Design */

/* ==================== Category Hero Section ==================== */
.category-hero {
    position: relative;
    padding: 6rem 0 3rem;
    overflow: hidden;
    margin-top: 56px;
}

.category-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
}

.category-hero-shapes .shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: floatShape 6s ease-in-out infinite;
}

.category-hero-shapes .shape-1 {
    width: 200px;
    height: 200px;
    top: -50px;
    right: 10%;
    animation-delay: 0s;
}

.category-hero-shapes .shape-2 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 5%;
    animation-delay: 2s;
}

.category-hero-shapes .shape-3 {
    width: 150px;
    height: 150px;
    bottom: -30%;
    right: 25%;
    animation-delay: 4s;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Breadcrumb Light */
.breadcrumb-light {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-light .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-light .breadcrumb-item a:hover {
    color: white;
}

.breadcrumb-light .breadcrumb-item.active {
    color: white;
}

.breadcrumb-light .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

[dir="rtl"] .breadcrumb-light .breadcrumb-item + .breadcrumb-item::before {
    content: "\\";
}

/* Hero Content */
.category-hero-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.category-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

.category-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.category-description {
    color: rgba(255, 255, 255, 0.9);
}

.bg-white-25 {
    background: rgba(255, 255, 255, 0.25) !important;
}

/* ==================== Subcategories Navigation ==================== */
.subcategories-section {
    background: #f8f9fa;
}

.subcategories-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: #667eea #e9ecef;
    -webkit-overflow-scrolling: touch;
}

.subcategories-scroll::-webkit-scrollbar {
    height: 6px;
}

.subcategories-scroll::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 3px;
}

.subcategories-scroll::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.subcategory-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.subcategory-chip:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.subcategory-chip.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.subcategory-chip .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.subcategory-chip.active .count {
    background: rgba(255, 255, 255, 0.25);
}

/* ==================== Filter Sidebar ==================== */
.filter-sidebar {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.filter-header h5 {
    font-weight: 600;
    color: #333;
}

.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.filter-title .filter-toggle-icon {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 0.75rem;
    color: #adb5bd;
}

[dir="rtl"] .filter-title .filter-toggle-icon {
    margin-left: 0;
    margin-right: auto;
}

.filter-title.collapsed .filter-toggle-icon {
    transform: rotate(-90deg);
}

[dir="rtl"] .filter-title.collapsed .filter-toggle-icon {
    transform: rotate(90deg);
}

.filter-section .form-check {
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
}

[dir="rtl"] .filter-section .form-check {
    padding-left: 0;
    padding-right: 1.75rem;
}

.filter-section .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.price-hint {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Related Categories */
.related-categories .related-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s;
}

.related-categories .related-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

/* Mobile Filter */
@media (max-width: 991.98px) {
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        z-index: 1060;
        border-radius: 0;
        overflow-y: auto;
        transition: left 0.3s ease;
    }

    [dir="rtl"] .filter-sidebar {
        left: auto;
        right: -100%;
        transition: right 0.3s ease;
    }

    .filter-sidebar.mobile-show {
        left: 0;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    }

    [dir="rtl"] .filter-sidebar.mobile-show {
        left: auto;
        right: 0;
    }

    body.filter-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1055;
    }
}

/* ==================== Results Header ==================== */
.results-count {
    color: #666;
    font-size: 0.95rem;
}

.results-count strong {
    color: #333;
}

.view-toggle .btn {
    padding: 0.4rem 0.75rem;
}

.view-toggle .btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.sort-select {
    min-width: 150px;
}

/* Active Filters Tags */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: #e8ebf7;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #667eea;
}

.filter-tag .remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    color: #667eea;
    text-decoration: none;
    transition: all 0.2s;
}

.filter-tag .remove:hover {
    background: #667eea;
    color: white;
}

/* ==================== Ads Grid ==================== */
.ads-container {
    display: grid;
    gap: 1.5rem;
}

.ads-grid {
    grid-template-columns: repeat(3, 1fr);
}

.ads-list {
    grid-template-columns: 1fr;
}

@media (max-width: 1199.98px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 575.98px) {
    .ads-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== Modern Ad Card ==================== */
.ad-card-modern {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.ad-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

/* Ad Image */
.ad-image-link {
    display: block;
    text-decoration: none;
}

.ad-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ad-card-modern:hover .ad-image img {
    transform: scale(1.08);
}

.ad-image .no-image {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 3rem;
}

/* Ad Badges */
.ad-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

[dir="rtl"] .ad-badges {
    left: auto;
    right: 12px;
}

.ad-badges .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-featured {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.badge-urgent {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Images Count */
.images-count {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

[dir="rtl"] .images-count {
    left: auto;
    right: 12px;
}

/* Favorite Button */
.btn-favorite {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

[dir="rtl"] .btn-favorite {
    right: auto;
    left: 12px;
}

.btn-favorite:hover {
    background: #667eea;
    transform: scale(1.1);
}

.btn-favorite:hover i {
    color: white;
}

.btn-favorite i {
    font-size: 1rem;
    color: #667eea;
    transition: color 0.3s;
}

.btn-favorite i.fas.text-danger {
    color: #ef4444 !important;
}

/* Ad Content */
.ad-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ad-title-link {
    text-decoration: none;
}

.ad-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.ad-title-link:hover .ad-title {
    color: #667eea;
}

/* Ad Price */
.ad-price {
    margin-bottom: 0.75rem;
}

.price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
}

.price-currency {
    font-size: 0.9rem;
    color: #667eea;
    margin-left: 0.25rem;
}

[dir="rtl"] .price-currency {
    margin-left: 0;
    margin-right: 0.25rem;
}

.negotiable-badge {
    font-size: 0.7rem;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

[dir="rtl"] .negotiable-badge {
    margin-left: 0;
    margin-right: 0.5rem;
}

.price-free {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
}

/* Ad Meta */
.ad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: auto;
}

.meta-item {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.meta-item i {
    color: #adb5bd;
}

/* ==================== List View Styles ==================== */
.ads-list .ad-card-modern {
    flex-direction: row;
}

.ads-list .ad-image {
    width: 250px;
    height: auto;
    min-height: 180px;
    flex-shrink: 0;
}

.ads-list .ad-content {
    padding: 1.25rem;
}

.ads-list .ad-title {
    font-size: 1.15rem;
    -webkit-line-clamp: 1;
}

@media (max-width: 767.98px) {
    .ads-list .ad-card-modern {
        flex-direction: column;
    }

    .ads-list .ad-image {
        width: 100%;
        height: 200px;
    }
}

/* ==================== Pagination ==================== */
.pagination-modern {
    gap: 0.25rem;
}

.pagination-modern .page-item .page-link {
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 42px;
    text-align: center;
}

.pagination-modern .page-item .page-link:hover {
    background: #e8ebf7;
    color: #667eea;
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pagination-modern .page-item.disabled .page-link {
    background: #f8f9fa;
    color: #adb5bd;
}

.pagination-info {
    font-size: 0.85rem;
}

/* ==================== No Results ==================== */
.no-results {
    background: white;
    border-radius: 16px;
    padding: 4rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.no-results-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e9ecef 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.no-results-icon i {
    font-size: 2.5rem;
    color: #adb5bd;
}

.no-results h3 {
    color: #333;
    margin-bottom: 0.75rem;
}

/* ==================== RTL Adjustments ==================== */
[dir="rtl"] .category-hero-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .ms-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .text-lg-end {
    text-align: left !important;
}

[dir="rtl"] .justify-content-md-end {
    justify-content: flex-start !important;
}

/* ==================== Responsive Adjustments ==================== */
@media (max-width: 991.98px) {
    .category-hero {
        padding: 5rem 0 2rem;
    }

    .category-title {
        font-size: 1.75rem;
    }

    .category-icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .category-hero-content {
        flex-direction: column;
        text-align: center;
    }

    [dir="rtl"] .category-hero-content {
        flex-direction: column;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .subcategory-chip {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .ad-image {
        height: 180px;
    }
}

/* ==================== Dark Mode Support (Optional) ==================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment for dark mode support */
    /*
    .filter-sidebar,
    .ad-card-modern,
    .no-results {
        background: #1a1a2e;
        border-color: #2a2a4e;
    }

    .ad-title,
    .filter-title,
    .results-count strong {
        color: #fff;
    }
    */
}
