@charset "utf-8";
/* CSS Document */

/* Reset و استایل‌های پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tahoma', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    font-size: 14px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* استایل هدر */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo a {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.main-navigation ul {
    display: flex;
    list-style: none;
}

.main-navigation li {
    margin-left: 20px;
}

.main-navigation a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.main-navigation a:hover {
    color: #0073aa;
}

/* استایل بخش اصلی */
.content-area {
    display: flex;
    margin: 25px 0;
    gap: 25px;
}

.main-content {
    flex: 1;
    width: 70%;
}

/* استایل هدر آگهی‌ها */
.advertisements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-title {
    font-size: 24px;
    color: #2c3e50;
    font-weight: 700;
}

.view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.view-btn.active {
    background: #0073aa;
    color: #fff;
}

.view-btn svg {
    width: 16px;
    height: 16px;
}

/* استایل گرید آگهی‌ها */
.advertisements-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.advertisements-grid.single-column-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.advertisements-grid.two-columns-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* استایل کارت آگهی */
.advertisement-card {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e9ecef;
}

.advertisement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.ad-thumbnail {
    flex: 0 0 200px;
    overflow: hidden;
}

.ad-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.advertisement-card:hover .ad-thumbnail img {
    transform: scale(1.05);
}

.no-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #888;
    min-height: 150px;
}

.ad-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.ad-title {
    font-size: 18px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.ad-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.ad-title a:hover {
    color: #0073aa;
}

.ad-excerpt {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.ad-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.meta-item {
    display: flex;
    align-items: center;
}

.meta-label {
    font-weight: bold;
    margin-left: 5px;
    color: #555;
}

.ad-price {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    color: #28a745;
    margin-top: 10px;
    display: inline-block;
}

.ad-read-more {
    margin-top: auto;
}

.read-more-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.read-more-btn:hover {
    background: #005a87;
}

/* استایل بنرها */
.ad-banner {
    margin: 25px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
    border: 1px solid #e9ecef;
}

.ad-banner-static {
    margin: 0 0 30px 0;
    border: 2px solid #0073aa;
    background: #f0f8ff;
}

.ad-banner img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.ad-banner a {
    display: block;
    transition: opacity 0.3s;
}

.ad-banner a:hover {
    opacity: 0.9;
}

/* استایل سایدبار */
.sidebar {
    width: 400px;
    flex: 0 0 400px;
}

.sidebar-widget {
    background: #fff;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #2c3e50;
}

.widget-content {
    font-size: 14px;
    line-height: 1.6;
}

/* استایل صفحه‌بندی */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    transition: all 0.3s;
}

.pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.pagination .page-numbers:hover {
    background: #f0f0f0;
}

/* رسپانسیو */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .sidebar {
        width: 350px;
        flex: 0 0 350px;
    }
}

@media (max-width: 992px) {
    .content-area {
        flex-direction: column;
    }
    
    .main-content {
        width: 100%;
    }
    
    .sidebar {
        width: 100%;
        flex: 0 0 auto;
        margin-top: 30px;
    }
    
    .advertisements-grid.two-columns-view {
        grid-template-columns: 1fr;
    }
    
    .advertisement-card {
        flex-direction: column;
    }
    
    .ad-thumbnail {
        flex: 0 0 auto;
        height: 200px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-navigation li {
        margin: 0 10px 10px 0;
    }
    
    .advertisements-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ad-meta {
        grid-template-columns: 1fr;
    }
    
    .ad-content {
        padding: 15px;
    }
    
    .ad-title {
        font-size: 16px;
    }
    
    .sidebar-widget {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .view-toggle {
        width: 100%;
    }
    
    .view-btn {
        flex: 1;
        justify-content: center;
    }
    
    .ad-thumbnail {
        height: 180px;
    }
    
    .pagination .page-numbers {
        padding: 6px 12px;
        margin: 0 2px;
    }
}