/* Reset and Base Styles - النسخة المدمجة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Michroma', 'Cairo', sans-serif;
    font-size: 12px; /* تم دمج هذا السطر من التكرار */
}

/* Body Styles - النسخة المدمجة والنهائية */
body {
    background-color: #f5f5f5; /* الخلفية الحالية (سنقوم بتعديلها) */
    
    /* إضافة الصورة كخلفية - هذا هو التعديل الأخير */
    background-image: url('2222222222.jpg');
    background-size: cover;       /* لضمان تغطية الصورة لكامل مساحة العرض */
    background-attachment: fixed; /* لجعل الصورة ثابتة أثناء تمرير المحتوى */
    background-position: center center; /* توسيط الصورة */
    
    color: #333;
    line-height: 1.6;
    font-size: 12px;
    min-height: 100vh; /* تأكد من أن الـ body يغطي كامل ارتفاع الشاشة */
}

/* Header Styles */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: #0a3d62;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* إضافة ظل عند التمرير */
.header-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: rgba(10, 61, 98, 0.95);
    backdrop-filter: blur(5px);
}

/* تعديل المسافة العلوية للمحتوى الرئيسي */
main {
    margin-top: 80px; /* يجب أن يكون هذا مساويًا لارتفاع الهيدر */
    position: relative;
    z-index: 1;
}
.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
    white-space: nowrap;
    margin: 0;
}

/* ==================================== */
/* أنماط شريط البحث المحدثة */
/* ==================================== */

/* الحاوية الرئيسية لشريط البحث في الهيدر */
.header-search {
    flex-grow: 1; /* لتأخذ المساحة المتاحة في الهيدر */
    display: flex;
    justify-content: center; /* توسيط شريط البحث */
    max-width: 600px; /* تحديد أقصى عرض على الشاشات الكبيرة */
    margin: 0 20px; /* مسافة من الجوانب */
}

/* حاوية حقل الإدخال والزر - search-wrapper */
.search-wrapper {
    display: flex;
    width: 100%;
    background-color: white;
    border-radius: 25px; /* حواف مستديرة */
    overflow: hidden; /* لضمان أن الحدود المستديرة تطبق على كل ما بداخلها */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #ccc; /* إضافة حدود بسيطة */
}

/* حقل إدخال البحث */
.search-wrapper input[type="text"] {
    flex-grow: 1; /* ليأخذ كل المساحة المتبقية */
    padding: 10px 15px;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    background-color: transparent;
    direction: rtl; /* ضمان أن النص يبدأ من اليمين للغة العربية */
    text-align: right;
}

/* زر البحث - search-btn */
.search-btn {
    /* للحصول على اللون الأزرق من الهيدر أو لون جذاب */
    background-color: #4b83d6; 
    color: white;
    border: none;
    padding: 10px 15px; /* تعديل البادينغ ليتناسب مع الزر */
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    display: flex; /* لتمكين توسيط الأيقونة */
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background-color: #3a68b4; /* لون أغمق عند التحويم */
}

.search-btn i {
    font-size: 16px; /* حجم أيقونة البحث */
}

/* ==================================== */
/* تعديلات شريط البحث للهواتف (الاستجابة) */
/* ==================================== */
@media (max-width: 768px) {
    .header-search {
        max-width: 100%; /* تأخذ العرض الكامل على الموبايل */
        margin: 10px 0;
        /* قد تحتاج لإضافة خاصية 'order: 3;' إذا كنت تنظم عناصر الهيدر باستخدام فليكس بوكس */
    }

    .search-wrapper {
        border-radius: 8px; /* تقليل استدارة الزوايا قليلاً على الموبايل */
    }
}
/* تعديلات القائمة الرئيسية */
.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.main-nav li {
    margin-left: 1.5rem;
    position: relative;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    transition: color 0.3s;
    white-space: nowrap;
}

.main-nav a:hover {
    color: #7ed6df;
}

.main-nav i {
    margin-left: 0.5rem;
}

.post-ad-btn {
    background-color: #4b83d6;;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}

.post-ad-btn:hover {
    background-color: #0a3d62;
    color: white;
    transform: translateY(-2px);
}

/* تعديلات للغة العربية */
body[dir="rtl"] .search-wrapper input {
    padding-right: 50px;
    padding-left: 1rem;
}

body[dir="rtl"] .search-btn {
    right: 5px;
    left: auto;
}

body[dir="rtl"] .main-nav li {
    margin-left: 0;
    margin-right: 1.5rem;
}

body[dir="rtl"] .main-nav i {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* تعديلات للغة الإنجليزية */
body[dir="ltr"] .search-wrapper input {
    padding-left: 50px;
    padding-right: 1rem;
}

body[dir="ltr"] .search-btn {
    left: 5px;
    right: auto;
}

/* تعديلات للهواتف */
 (max-width: 1024px) {
    .header-container {
        flex-wrap: wrap;
        padding: 0.5rem;
    }
    
    .logo {
        order: 1;
    }
    
    .header-search {
        order: 3;
        width: 100%;
        margin: 1rem 0;
        max-width: 100%;
    }
    
    .main-nav {
        order: 2;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .main-nav li {
        margin: 0.3rem;
    }
}


/* تعديلات للهواتف */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
    }
    
    .logo, .header-search, .main-nav {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .main-nav ul {
        justify-content: center;
    }
    
    .search-wrapper input {
        padding: 0.7rem 2.5rem 0.7rem 1rem;
    }
    
    body[dir="rtl"] .search-wrapper input {
        padding-right: 2.5rem;
        padding-left: 1rem;
    }
    
    body[dir="ltr"] .search-wrapper input {
        padding-left: 2.5rem;
        padding-right: 1rem;
    }
    
    .search-btn {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .main-nav a {
        font-size: 0.9rem;
    }
    
    .post-ad-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .search-wrapper input {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    main {
        margin-top: 70px; /* ارتفاع أقل للهواتف */
    }
    
    .header-scrolled {
        backdrop-filter: none; /* إزالة تأثير الضبابية على الهواتف القديمة */
    }
}
/* Categories Section */
.categories {
    margin-bottom: 2rem;
}

.categories h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #0a3d62;
    font-size: 1.5rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.category-item {
   background-color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-item i {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    color:   #0a3d62;
}

.category-item span {
    font-weight: bold;
}




/* Featured Ads */
.featured-ads h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #0a3d62;
    font-size: 1.5rem;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.ad-item {
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.ad-item:hover {
    transform: translateY(-5px);
}

.ad-image {
    height: 180px;
    background-color: #eee;
    background-size: cover;
    background-position: center;
}

.ad-details {
    padding: 1rem;
}

.ad-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #0a3d62;
}

.ad-price {
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.ad-location {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.ad-location i {
    margin-left: 0.3rem;
}

/* Footer Styles */
footer {
    background-color: #0a3d62;
    color: white;
    padding: 2rem 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p, .footer-section li {
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    font-size: 1.5rem;
}

.copyright {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal h2 {
    color:  #0a3d62;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.modal button[type="submit"] {
    background-color: #0a3d62;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: background-color 0.3s;
}

.modal button[type="submit"]:hover {
    background-color:   #0a3d62;
}

/* Responsive Styles */
/* تحسينات عامة للهاتف */
@media (max-width: 768px) {
    header {
        padding: 0.8rem 1rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .main-nav li {
        margin-right: 0.8rem;
    }
    
    .main-nav a {
        font-size: 0.9rem;
    }
    
    .post-ad-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .language-switcher {
        font-size: 0.9rem;
        padding: 0.2rem 0.4rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .categories h2, .featured-ads h2, .year-filter h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem 1rem;
    }
}
        
   
    

    .logo {
        margin-bottom: 1rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav li {
        margin: 0.5rem;
    }

    .search-container {
        flex-direction: column;
    }

    .search-container input {
        border-radius: 5px;
        margin-bottom: 0.5rem;
    }

    .search-container button {
        border-radius: 5px;
        justify-content: center;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }


/* تعديلات الشبكة على الشاشات الصغيرة */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr); /* عمودين لكل صف */
        gap: 1rem;
    }
    
    .category-item {
        padding: 1rem 0.5rem;
    }
    
    .year-filter-grid {
        grid-template-columns: repeat(2, 1fr); /* عمودين لكل صف */
        gap: 1rem;
    }
    
    .year-filter-item {
        
        padding: 1rem 0.5rem;
    }
}

/* تحسينات إضافية للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .category-grid, .year-filter-grid {
        grid-template-columns: repeat(2, 1fr); /* عمودين لكل صف */
        gap: 0.8rem;
    }
    
    .category-item, .year-filter-item {
        padding: 0.8rem 0.3rem;
        font-size: 0.9rem;
    }
    
    .category-item i, .year-filter-item i {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
}

    .modal-content {
        width: 95%;
        padding: 1.5rem 1rem;
    }

/* تعديلات للغة الإنجليزية */
body[dir="ltr"] .dropdown-menu {
    right: auto;
    left: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* تصفية حسب السنة */
.year-filter {
    margin: 2rem 0;
    padding: 1rem;
   background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
}

.year-filter h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #0a3d62;
    font-size: 1.5rem;
}

.year-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.year-filter-item {
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.year-filter-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: #e9ecef;
}

.year-filter-item i {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color:   #0a3d62;
}

.year-filter-item span {
    font-weight: bold;
}
/* أنماط إضافية للمجموعات الفرعية */
.submenu .form-group {
    margin-top: 1rem;
    padding: 0.8rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.submenu label {
    color: #495057;
    font-size: 0.9rem;
}

.submenu select {
    background-color: white;
    border: 1px solid #ced4da;
}
/* أنماط نافذة تفاصيل الإعلان */
/* أنماط نافذة تفاصيل الإعلان */
.ad-details-modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;
    animation: fadeIn 0.3s;
}

.ad-details-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 90vh; /* ارتفاع أقصى */
    overflow-y: auto; /* تمكين التمرير عند الحاجة */
}

.ad-details-images {
    margin-bottom: 1.5rem;
    max-width: 100%;
    overflow: hidden;
}

.ad-details-images img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    display: block; /* لمنع المسافات الزائدة تحت الصور */
}

.ad-details-info {
    padding: 1rem;
    word-wrap: break-word; /* لكسر الكلمات الطويلة */
    overflow-wrap: break-word;
}

.ad-details-info h2 {
    color: #0a3d62;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    word-break: break-word;
}

.ad-details-info p {
    margin-bottom: 0.8rem;
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
}

/* تعديلات للهواتف */
@media (max-width: 768px) {
    .ad-details-content {
        width: 95%;
        padding: 1.5rem 1rem;
        margin: 5% auto;
    }
    
    .ad-details-info h2 {
        font-size: 1.3rem;
    }
    
    .ad-details-info p {
        font-size: 0.9rem;
    }
}
/* منع تداخل النصوص */
.ad-details-info h2,
.ad-details-info p,
.ad-details-info .car-specs,
.ad-details-info .property-specs {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* تحسين شكل الأزرار المحددة */
.category-item.active {
    background-color: #0a3d62;
    color: white;
}

/* تحسين عرض الصفحة عند الترجمة */
body[dir="rtl"] .ad-details-info,
body[dir="ltr"] .ad-details-info {
    text-align: inherit;
    direction: inherit;
}

/* أنماط زر عرض الكل */
.category-item.view-all, 
.year-filter-item.view-all {
    background-color: #f8f9fa;
    border: 2px dashed #0a3d62;
}

.category-item.view-all:hover, 
.year-filter-item.view-all:hover {
    background-color: #e9ecef;
    border-color: #4b83d6;
}

.category-item.view-all i, 
.year-filter-item.view-all i {
    color: #0a3d62;
}

.container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.error {
    color: #e74c3c;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #fde8e8;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

button[type="submit"] {
    background: #0a3d62;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
}
.ad-publisher {
    color: #555;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ad-publisher i {
    color: #0a3d62;
}

/* أنماط قسم التعليقات */
.comments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.comments-section h3 {
    color: #0a3d62;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 1rem;
}

.comment-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f5f5f5;
}

.comment-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.comment-text {
    padding: 0.5rem;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.add-comment {
    margin-top: 1.5rem;
}

.add-comment textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    min-height: 80px;
}

.add-comment button {
    background-color: #0a3d62;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
}

.login-to-comment {
    text-align: center;
    margin-top: 1rem;
}

.login-to-comment a {
    color: #0a3d62;
    text-decoration: none;
    font-weight: bold;
}

/* أنماط أزرار الحذف */
.delete-ad-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.delete-ad-btn:hover {
    background-color: #c0392b;
}

.delete-comment {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 0.2rem;
    font-size: 0.9rem;
}

.delete-comment:hover {
    color: #c0392b;
}

/* للغة العربية */
body[dir="rtl"] .delete-ad-btn {
    left: auto;
    right: 1rem;
}

/* أنماط زر المفضلة */
.favorite-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
}

body[dir="rtl"] .favorite-btn {
    left: auto;
    right: 10px;
}

.favorite-btn i {
    color: #ccc;
    font-size: 18px;
    transition: all 0.3s;
}

.favorite-btn:hover {
    background-color: rgba(255, 255, 255, 1);
}

.favorite-btn:hover i {
    color: #e74c3c;
}

.favorite-btn.active i {
    color: #e74c3c;
}

/* أنماط صفحة المفضلة */
#favoritesContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* رسائل التنبيه */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 1000;
    animation: fadeInUp 0.3s;
}

body[dir="rtl"] .toast {
    right: auto;
    left: 20px;
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: #f44336;
}

.toast.warning {
    background-color: #ff9800;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }

}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
}

.favorite-btn i {
    color: #ccc;
    font-size: 16px;
    transition: all 0.3s;
}

.favorite-btn:hover i {
    color: #e74c3c;
}

.favorite-btn.active i {
    color: #e74c3c;
}

body[dir="rtl"] .favorite-btn {
    right: auto;
    left: 10px;
}

/* أنماط المحادثات */
.chats-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
}

.conversations-list {
    margin-top: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background 0.3s;
}

.conversation-item:hover {
    background: #f9f9f9;
}

.conversation-item.unread {
    background: #f0f7ff;
    border-left: 3px solid #4b83d6;
}

.partner-info {
    flex: 1;
}

.partner-name {
    font-weight: bold;
    display: block;
    margin-bottom: 0.3rem;
}

.last-message {
    font-size: 0.9rem;
    color: #666;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.message-info {
    text-align: left;
    margin-right: 1rem;
}

.message-time {
    font-size: 0.8rem;
    color: #999;
    display: block;
}

.unread-count {
    background: #4b83d6;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-top: 0.3rem;
}

/* أنماط نافذة المحادثة */
.chat-container {
    max-width: 800px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #0a3d62;
    color: white;
    border-radius: 8px 8px 0 0;
}

.back-button {
    color: white;
    margin-left: 1rem;
    font-size: 1.2rem;
}

.messages-container {
    flex: 1;
    padding: 1rem;
    background: #f5f5f5;
    overflow-y: auto;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.message {
    max-width: 70%;
    margin-bottom: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    position: relative;
}

.message.sent {
    background: #4b83d6;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.message.received {
    background: white;
    border: 1px solid #ddd;
    margin-right: auto;
    border-bottom-left-radius: 0;
}

.message-time {
    font-size: 0.7rem;
    text-align: right;
    margin-top: 0.3rem;
    opacity: 0.8;
}

.message.sent .message-time {
    color: rgba(255,255,255,0.8);
}

.message-form {
    display: flex;
    padding: 1rem;
    background: white;
    border-radius: 0 0 8px 8px;
    border: 1px solid #ddd;
    border-top: none;
}

.message-form input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 30px;
    outline: none;
}

.message-form button {
    background: #4b83d6;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* تعديلات للهواتف */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 120px);
        margin: 1rem auto;
    }
    
    .message {
        max-width: 85%;
    }
}

/* إشعارات المحادثات */
.notification-badge {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
}

.dropdown-header {
    padding: 10px 15px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
}

.dropdown-footer {
    border-top: 1px solid #eee;
    font-weight: bold;
}

#recentChatsList {
    max-height: 300px;
    overflow-y: auto;
}

.recent-chat-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f5f5f5;
}

.recent-chat-item:hover {
    background: #f5f5f5;
}

.recent-chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #0a3d62;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    font-size: 0.8rem;
}

.recent-chat-info {
    flex: 1;
}

.recent-chat-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.recent-chat-preview {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.recent-chat-time {
    font-size: 0.7rem;
    color: #999;
}

.chat-btn {
    background: #4b83d6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-top: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.chat-btn:hover {
    background: #0a3d62;
}

.chat-btn i {
    font-size: 0.9rem;
}

.chat-btn {
    background-color: #0a3d62;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-btn:hover {
    background-color: #0c2461;
}

.chat-btn i {
    font-size: 16px;
}

/* أنماط شريط الأخبار المتحرك */
/* أنماط شريط الأخبار المتحرك - النسخة المعدلة */
/* أنماط شريط الأخبار المتحرك - النسخة المحسنة */
.news-ticker-container {
    position: sticky;
    top: 0px;
    z-index: 999;
    background-color: rgba(12, 36, 97, 0.9);
    width: 100%;
    display: flex;
    align-items: center;
    padding: 5px 10px;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.9);
    overflow: hidden;
    margin-bottom: 1rem;
}

.ticker-header {
    font-weight: bold;
    margin-right: 10px;
    white-space: nowrap;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    background-color: rgba(12, 36, 97, 0.9);
    padding-right: 10px;
    flex-shrink: 0;
}

.ticker-wrapper {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    height: 20px;
}

.ticker-content {
    display: flex;
    animation: ticker 20s linear infinite; /* سرعه أكبر */
    white-space: nowrap;
    padding-left: 100%;
}



/* الرسوم المتحركة المحسنة */
@keyframes ticker {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(0%);
    }
}

.ticker-item {
    color: white;
    margin-right: 30px;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
    font-size: 0.9rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.ticker-item:hover {
    color: #7ed6df;
}

.ticker-separator {
    color: #ff0000;
    margin: 0 15px;
    font-size: 14px;
    display: inline-block;
    animation: none !important;
    flex-shrink: 0;
}

/* تعديلات للهواتف */
@media (max-width: 768px) {
    .news-ticker-container {
        top: 0px;
        padding: 6px 10px;
        position: relative;
        z-index: 200;
    }
    
    .ticker-header {
        font-size: 0.8rem;
        margin-right: 10px;
    }
    
    .ticker-item {
        margin-right: 20px;
        font-size: 0.8rem;
    }
    
    .ticker-separator {
        margin: 0 10px;
        font-size: 12px;
    }
    
    .ticker-wrapper {
        height: 18px;
    }
    
    .ticker-content {
        animation: ticker 10s linear infinite; /* سرعه أكبر على الموبايل */
    }
}

/* أنماط زر الواتساب */
.whatsapp-contact {
    margin: 15px 0;
    text-align: center;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #25D366; /* لون الواتساب الأخضر */
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.whatsapp-btn:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.whatsapp-btn i {
    font-size: 1.2rem;
}

/* أنماط حاوية أزرار التواصل في صفحة الإعلان */
.ad-contact-actions {
    display: flex; /* لعرض الأزرار جنباً إلى جنب */
    gap: 15px; /* المسافة بين الأزرار */
    margin: 15px 0;
    justify-content: center; /* توسيط الأزرار */
    flex-wrap: wrap; /* للسماح للأزرار بالنزول لسطر جديد في الهواتف */
}

/* أنماط زر الواتساب (تعديل بسيط ليناسب الترتيب الجانبي) */
.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #25D366; /* لون الواتساب الأخضر */
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    white-space: nowrap; /* لمنع كسر الزر */
}

.whatsapp-btn:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.whatsapp-btn i {
    font-size: 1.2rem;
}

/* أنماط زر الرسالة الخاصة */
.chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #4b83d6; /* لون أزرق لزر المحادثة */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.chat-btn:hover {
    background-color: #0a3d62;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.chat-btn i {
    font-size: 1.2rem;
}

/* تعديل للهواتف (لعرض الأزرار بشكل مكدس إذا كانت الشاشة ضيقة جداً) */
@media (max-width: 480px) {
    .ad-contact-actions {
        flex-direction: column; /* الأزرار بشكل عمودي */
        gap: 10px;
    }

    .whatsapp-btn,
    .chat-btn {
        width: 100%; /* جعل الأزرار تأخذ عرض الحاوية بالكامل */
        justify-content: center;
    }
}

/* ==================================== */
/* أنماط إظهار/إخفاء كلمة المرور */
/* ==================================== */

/* الحاوية التي تحتوي على الحقل والزر */
.password-container {
    position: relative; /* لتمكين وضع الزر داخل الحقل */
    display: flex; /* لضمان أن الحقل يأخذ العرض الكامل */
    align-items: center;
}

/* حقل الإدخال داخل الحاوية */
.password-container input[type="password"],
.password-container input[type="text"] {
    width: 100%;
    /* قد تحتاج لتقليل padding-right ليتناسب الزر */
    padding-left: 40px !important; 
    padding-right: 15px !important;
}

/* زر التبديل */
.toggle-password {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
    z-index: 10;
}

/* تحديد موقع الزر حسب اتجاه الصفحة */
body[dir="rtl"] .toggle-password {
    left: 15px; /* وضع الزر على اليسار في اتجاه RTL */
}

body[dir="ltr"] .toggle-password {
    right: 15px; /* وضع الزر على اليمين في اتجاه LTR */
}

.toggle-password:hover {
    color: #0a3d62; /* لون عند التحويم */
}

.toggle-password i {
    font-size: 1.1rem;
}

/* أنماط body */
body {
    /* الخلفية الحالية (سنقوم بتعديلها) */
    background-color: #f5f5f5;
    
    /* إضافة الصورة كخلفية */
    background-image: url('2222222222.jpg');
    background-size: cover;       /* لضمان تغطية الصورة لكامل مساحة العرض */
    background-attachment: fixed; /* لجعل الصورة ثابتة أثناء تمرير المحتوى */
    background-position: center center; /* توسيط الصورة */
    
    color: #333;
    line-height: 1.6;
    font-size: 12px;
    min-height: 100vh; /* تأكد من أن الـ body يغطي كامل ارتفاع الشاشة */
}

/* ==================================== */
/* أنماط الإعلانات على الموبايل (عرض إعلانين في السطر) */
/* ==================================== */

@media (max-width: 768px) {
    /* الخطوة 1: جعل الحاوية الرئيسية تعمل بنظام Flexbox 
       الرجاء استبدال .ads-list-container بالصنف الفعلي للحاوية التي تحتوي على عناصر ad-item
    */
    .ads-grid {
        display: flex;
        flex-wrap: wrap; /* للسماح للعناصر بالانتقال إلى سطر جديد */
        justify-content: space-between; /* لتوزيع العناصر بمسافة متساوية */
     
        padding: 0 5px; /* مسافة حماية من أطراف الشاشة */
    }

    /* الخطوة 2: تحديد عرض كل عنصر ad-item ليأخذ نصف السطر 
    */
    .ad-item {
        /* حساب العرض: (100% / 2) - المسافة بين الإعلانات
           (50% - 5px) يسمح بترك مسافة 10 بكسل بين الإعلانين 
        */
        width: calc(45% - 8px); 
        margin-bottom: 15px; /* مسافة تحت كل إعلان */
        margin-left: 0;
        margin-right: 0;
    }
}