/* ======= استایل‌های صفحه اصلی ======= */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    margin-top: 20px;
}

.content-wrapper {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

/* سایدبار دسکتاپ */
.sidebar-desktop {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

/* محتوای اصلی */
.main-content {
    flex: 1;
    min-width: 0;
}

/* بخش فیلترهای فعال */
.active-filters-section {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    border: 1px solid #e8f5e9;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filters-label {
    font-size: 14px;
    color: #2d774d;
    font-weight: 600;
}

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

.filter-tag {
    background: #e8f5e9;
    color: #2d774d;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #c8e6c9;
}

.remove-filter {
    color: #ff4444;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-filter:hover {
    background: #ff4444;
    color: white;
}

/* گرید آگهی‌ها */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* کارت آگهی */
.listing-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    height: 180px;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-color: #00a650;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.card-content-wrapper {
    display: flex;
    height: 100%;
}

/* بخش عکس (سمت چپ) */
.card-image-section {
    width: 140px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

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

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

.no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 24px;
}

/* نشان‌ها */
.card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    min-width: 50px;
}

.type-badge.sale {
    background: #ff4444;
    color: white;
}

.type-badge.buy {
    background: #00a650;
    color: white;
}

/* بخش اطلاعات (سمت راست) */
.card-info-section {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.listing-title {
    font-size: 14px;
    font-weight: bold;
    color: #2d774d;
    margin-bottom: 8px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* متا اطلاعات */
.listing-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.meta-label {
    color: #666;
    font-weight: 500;
    min-width: 40px;
}

.meta-value {
    color: #333;
    flex: 1;
}

/* اطلاعات قیمت */
.listing-prices {
    margin-bottom: 8px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding: 3px 0;
}

.price-label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    min-width: 40px;
}

.price-value {
    font-size: 12px;
    font-weight: bold;
    color: #00a650;
}

.price-unknown {
    font-size: 11px;
    color: #666;
    font-style: italic;
}

/* فوتر کارت */
.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #f8f8f8;
    font-size: 10px;
    color: #888;
}

.area-info, .time-info {
    display: flex;
    align-items: center;
    gap: 3px;
}

.time-info {
    color: #ff6b35;
    font-weight: 500;
}

/* صفحه‌بندی */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 40px 0 30px;
    padding: 15px;
}

.pagination-btn {
    padding: 10px 16px;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 70px;
    text-align: center;
    font-size: 13px;
}

.pagination-btn:hover {
    background: #f8f8f8;
    border-color: #00a650;
    color: #00a650;
}

.pagination-numbers {
    display: flex;
    gap: 6px;
}

.pagination-number {
    padding: 8px 12px;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
    font-size: 13px;
}

.pagination-number:hover {
    background: #f8f8f8;
    border-color: #00a650;
}

.pagination-number.active {
    background: #00a650;
    color: white;
    border-color: #00a650;
}

/* حالت خالی */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    background: #f8fff8;
    border-radius: 16px;
    border: 2px dashed #e0f0e0;
    margin: 30px 0;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.empty-state h3 {
    color: #2d774d;
    margin-bottom: 12px;
    font-size: 20px;
}

.empty-state p {
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.6;
}

.empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 13px;
}

.btn-primary {
    background: #00a650;
    color: white;
}

.btn-primary:hover {
    background: #008f45;
}

.btn-secondary {
    background: #f8f8f8;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

/* ======= ریسپانسیو ======= */
@media (max-width: 1200px) {
    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar-desktop {
        width: 100%;
        position: static;
        margin-bottom: 15px;
    }
    
    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 0 10px;
        margin-top: 10px;
    }
    
    .active-filters-section {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .listing-card {
        height: 160px;
    }
    
    .card-image-section {
        width: 120px;
    }
    
    .card-info-section {
        padding: 12px;
    }
    
    .listing-title {
        font-size: 13px;
        height: 36px;
    }
    
    .meta-item {
        font-size: 10px;
    }
    
    .price-value {
        font-size: 11px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 8px;
    }
    
    .pagination-numbers {
        order: -1;
    }
    
    .empty-state {
        padding: 40px 20px;
    }
    
    .empty-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 180px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .filters-tags {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .listing-card {
        height: 150px;
    }
    
    .card-image-section {
        width: 100px;
    }
    
    .listing-footer {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
}