/* إعدادات عامة */
:root {
    --primary-color: #2c5aa0;
    --primary-dark: #1e3a6b;
    --primary-light: #4a7bc8;
    --secondary-color: #f0b400;
    --secondary-dark: #d19d00;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
    background-color: #fff;
    direction: rtl;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    outline: none;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* شريط التنقل */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    margin-left: 10px;
    font-size: 1.8rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-list {
    display: flex;
    margin-right: 30px;
}

.nav-list li {
    margin-left: 25px;
}

.nav-list a {
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    padding: 8px 0;
    position: relative;
}

.nav-list a i {
    margin-left: 8px;
    font-size: 1.1rem;
}

.nav-list a:hover, .nav-list a.active {
    color: var(--primary-color);
}

.nav-list a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-add {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.btn-add i {
    margin-left: 8px;
}

.btn-add:hover {
    background-color: var(--secondary-dark);
    color: white;
}

.btn-login {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 600;
    padding: 8px 15px;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
}

.btn-login i {
    margin-left: 8px;
    font-size: 1.2rem;
}

.btn-login:hover {
    background-color: var(--primary-color);
    color: white;
}

/* منطقة البحث */
.search-section {
    background: linear-gradient(to left, rgba(44, 90, 160, 0.9), rgba(44, 90, 160, 0.7)), url('https://images.unsplash.com/photo-1518780664697-55e3ad937233?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 60px 0;
    margin-bottom: 50px;
}

.search-header {
    text-align: center;
    margin-bottom: 40px;
}

.search-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.search-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.search-box {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.search-group {
    display: flex;
    flex-direction: column;
}

.search-group label {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.search-group label i {
    margin-left: 8px;
    color: var(--primary-color);
}

.search-group select, .search-group input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
    color: var(--dark-color);
}

.search-group select:focus, .search-group input:focus {
    border-color: var(--primary-color);
}

.btn-search {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 28px;
    width: 100%;
    transition: var(--transition);
}

.btn-search i {
    margin-left: 10px;
}

.btn-search:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* الإعلانات */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.section-header h2 i {
    margin-left: 10px;
    color: var(--primary-color);
}

.view-all {
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.view-all i {
    margin-right: 8px;
    transition: var(--transition);
}

.view-all:hover {
    color: var(--primary-dark);
}

.view-all:hover i {
    transform: translateX(-5px);
}

.featured-ads, .recent-ads {
    padding: 40px 0;
}

.featured-ads {
    background-color: var(--light-gray);
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.ad-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.ad-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.ad-card:hover .ad-image img {
    transform: scale(1.05);
}

.ad-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--secondary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ad-content {
    padding: 20px;
}

.ad-price {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.ad-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-description {
    color: var(--gray-color);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.ad-features {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.ad-feature {
    display: flex;
    align-items: center;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.ad-feature i {
    margin-left: 5px;
    color: var(--primary-color);
}

.ad-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.ad-location {
    display: flex;
    align-items: center;
}

.ad-location i {
    margin-left: 5px;
}

/* الفئات */
.categories {
    padding: 60px 0;
    background-color: var(--light-color);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.category-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.category-icon {
    width: 70px;
    height: 70px;
    background-color: rgba(44, 90, 160, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.category-card p {
    color: var(--gray-color);
    margin-bottom: 10px;
}

.category-card .count {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* تذييل الصفحة */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col .logo {
    color: white;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.footer-description {
    margin-bottom: 25px;
    opacity: 0.8;
    line-height: 1.7;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-col h3 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    opacity: 0.8;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    opacity: 1;
    color: var(--primary-light);
    padding-right: 5px;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    opacity: 0.8;
}

.contact-info li i {
    margin-left: 10px;
    color: var(--primary-light);
    margin-top: 3px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* زر العودة للأعلى */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
}

/* تصميم متجاوب */
@media (max-width: 992px) {
    .search-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ads-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .nav-brand {
        margin-bottom: 15px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        display: none;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
        margin: 0 0 20px 0;
    }
    
    .nav-list li {
        margin: 0 0 10px 0;
        width: 100%;
    }
    
    .nav-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .btn-add, .btn-login {
        width: 100%;
        justify-content: center;
    }
    
    .search-header h1 {
        font-size: 2rem;
    }
    
    .search-row {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .search-header h1 {
        font-size: 1.8rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .ads-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
/* أنماط البحث المتقدم */
.search-options {
    text-align: center;
    margin-top: 20px;
}

.btn-advanced {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-advanced i {
    margin-left: 8px;
}

.btn-advanced:hover {
    background-color: rgba(44, 90, 160, 0.1);
}

.advanced-search {
    margin-top: 25px;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    display: none;
}

.advanced-search.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.advanced-form h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.advanced-form h3 i {
    margin-left: 10px;
    color: var(--primary-color);
}

.advanced-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-group input {
    margin-left: 8px;
    width: 18px;
    height: 18px;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

/* تصميم متجاوب للبحث المتقدم */
@media (max-width: 992px) {
    .advanced-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .advanced-row {
        grid-template-columns: 1fr;
    }
}
/* تحديث نظام عرض البطاقات */
.ads-grid {
    display: grid;
    grid-template-columns: 1fr; /* بطاقة واحدة في الصف للهواتف */
    gap: 25px;
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr; /* بطاقة واحدة في الصف للهواتف */
    gap: 25px;
}

/* للشاشات المتوسطة (أجهزة لوحية) */
@media (min-width: 768px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr); /* بطاقتين في الصف للأجهزة اللوحية */
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr); /* بطاقتين في الصف للأجهزة اللوحية */
    }
}

/* للشاشات الكبيرة (أجهزة الكمبيوتر) */
@media (min-width: 992px) {
    .ads-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 بطاقات في الصف للكمبيوتر */
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 بطاقات في الصف للكمبيوتر */
    }
}

/* تحسين عرض البطاقات على الشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .ad-card, .category-card {
        margin: 0 10px; /* إضافة هوامش جانبية صغيرة */
    }
}

/* تحسين تخطيط النماذج للأجهزة المحمولة */
@media (max-width: 768px) {
    .search-row {
        grid-template-columns: 1fr;
    }
    
    .search-group.full-width {
        grid-column: 1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: 1;
    }
    
    .advanced-row {
        grid-template-columns: 1fr;
    }
}

/* تحسين عرض صفحة تفاصيل الإعلان */
@media (max-width: 992px) {
    .ad-content {
        grid-template-columns: 1fr;
    }
    
    .ad-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .ad-features-grid {
        grid-template-columns: 1fr;
    }
    
    .main-image {
        height: 250px;
    }
    
    .seller-stats {
        flex-direction: column;
        gap: 15px;
    }
}
/* تحسينات إضافية للهواتف */
@media (max-width: 768px) {
    .ad-card {
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .ad-image {
        height: 180px; /* تقليل ارتفاع الصورة على الهواتف */
    }
    
    .ad-content {
        padding: 15px;
    }
    
    .ad-price {
        font-size: 1.3rem;
    }
    
    .ad-title {
        font-size: 1.1rem;
        -webkit-line-clamp: 2; /* عرض سطرين فقط للعنوان */
    }
    
    .ad-description {
        -webkit-line-clamp: 3; /* عرض 3 أسطر فقط للوصف */
    }
    
    .category-card {
        padding: 20px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .category-card h3 {
        font-size: 1.2rem;
    }
}

/* تحسينات للهواتف الصغيرة جداً */
@media (max-width: 480px) {
    .ad-image {
        height: 160px;
    }
    
    .ad-features {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .ad-feature {
        flex: 0 0 45%; /* عرض عنصرين في كل صف */
        justify-content: center;
    }
    
    .category-card {
        padding: 15px;
    }
}
/* تحسين تأثيرات التفاعل مع البطاقات */
.ad-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-light);
}

.category-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-light);
}

/* تحسين العرض على الشاشات الكبيرة جداً */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .ads-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
    
    .ad-card {
        max-width: 100%;
    }
}

/* تحسين التوازن بين البطاقات */
.ad-card, .category-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ad-content, .category-card > div:not(.category-icon) {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ad-description {
    flex-grow: 1;
}

/* تحسين تنسيق النصوص على الشاشات الصغيرة */
@media (max-width: 768px) {
    .ad-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .ad-date {
        font-size: 0.85rem;
    }
}
/* تحسين نظام الأعمدة للنماذج */
.form-row, .advanced-row {
    display: grid;
    gap: 20px;
}

/* للهواتف: عمود واحد */
@media (max-width: 768px) {
    .form-row, .advanced-row {
        grid-template-columns: 1fr;
    }
}

/* للأجهزة اللوحية: عمودين */
@media (min-width: 768px) and (max-width: 992px) {
    .form-row, .advanced-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* للكمبيوتر: 3 أعمدة */
@media (min-width: 992px) {
    .form-row, .advanced-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* استثناءات للأعمدة الكاملة */
.form-group.full-width, .search-group.full-width {
    grid-column: 1 / -1;
}

/* تحسين نموذج البحث للهواتف */
@media (max-width: 768px) {
    .search-section {
        padding: 40px 0;
    }
    
    .search-header h1 {
        font-size: 1.8rem;
    }
    
    .search-header p {
        font-size: 1rem;
    }
    
    .search-box {
        padding: 20px;
    }
}
/* نظام عرض بديل باستخدام flexbox */
.alternate-ads-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.alternate-ads-grid .ad-card {
    flex: 1 1 100%; /* بطاقة واحدة في الصف على الهواتف */
    max-width: 100%;
}

@media (min-width: 768px) {
    .alternate-ads-grid .ad-card {
        flex: 1 1 calc(50% - 20px); /* بطاقتين في الصف على الأجهزة اللوحية */
        max-width: calc(50% - 20px);
    }
}

@media (min-width: 992px) {
    .alternate-ads-grid .ad-card {
        flex: 1 1 calc(25% - 20px); /* 4 بطاقات في الصف على الكمبيوتر */
        max-width: calc(25% - 20px);
    }
}

/* تحسين تناسق البطاقات */
.alternate-ads-grid .ad-card {
    min-width: 0; /* يمنع البطاقات من التمدد أكثر من اللازم */
}
/* تحسين أداء تحميل الصور */
.ad-image {
    position: relative;
    overflow: hidden;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ad-card:hover .ad-image img {
    transform: scale(1.05);
}

/* صورة بديلة أثناء التحميل */
.ad-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%);
    background-size: 40px 40px;
    animation: loading 1s infinite linear;
    z-index: 1;
}

@keyframes loading {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

.ad-image.loaded::before {
    display: none;
}
/* تأثيرات ظهور البطاقات */
.ad-card, .category-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تأخير ظهور البطاقات بشكل متتابع */
.ad-card:nth-child(1) { animation-delay: 0.1s; }
.ad-card:nth-child(2) { animation-delay: 0.2s; }
.ad-card:nth-child(3) { animation-delay: 0.3s; }
.ad-card:nth-child(4) { animation-delay: 0.4s; }
.ad-card:nth-child(5) { animation-delay: 0.5s; }
.ad-card:nth-child(6) { animation-delay: 0.6s; }
.ad-card:nth-child(7) { animation-delay: 0.7s; }
.ad-card:nth-child(8) { animation-delay: 0.8s; }

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
/* نظام عرض البطاقات - تحديث نهائي */
.ads-grid, .categories-grid {
    display: grid;
    gap: 25px;
}

/* للهواتف: بطاقة واحدة في الصف */
.ads-grid {
    grid-template-columns: 1fr;
}

.categories-grid {
    grid-template-columns: 1fr;
}

/* للأجهزة اللوحية: بطاقتين في الصف */
@media (min-width: 768px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* للكمبيوتر: 4 بطاقات في الصف */
@media (min-width: 992px) {
    .ads-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* للشاشات الكبيرة جداً: 4 بطاقات مع مسافات أكبر */
@media (min-width: 1400px) {
    .ads-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

/* تحسينات للهواتف الصغيرة */
@media (max-width: 480px) {
    .ads-grid, .categories-grid {
        gap: 15px;
    }
    
    .ad-card, .category-card {
        margin: 0 5px;
    }
}

/* تحسينات للأجهزة اللوحية */
@media (min-width: 768px) and (max-width: 991px) {
    .ad-card, .category-card {
        min-height: 350px;
    }
}
/* أنماط علامات العرض */
.display-info {
    text-align: center;
    padding: 10px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--gray-color);
}

.mobile-only, .tablet-only, .desktop-only {
    display: none;
}

@media (max-width: 767px) {
    .mobile-only {
        display: inline;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .tablet-only {
        display: inline;
    }
}

@media (min-width: 992px) {
    .desktop-only {
        display: inline;
    }
}