/* إعدادات الصفحة الأساسية */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    padding-bottom: 60px; /* إضافة مسافة تحت المحتوى لتفادي تلاصق الفوتر */
}

header {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    text-align: center;
}

h1 {
    font-size: 24px;
}

button {
    background-color: #28a745;
    color: white;
    font-size: 18px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #218838;
}

/* الفوتر */
footer {
    background-color: #333; /* نفس لون الهيدر */
    color: white;
    padding: 20px 0;
    text-align: center;
    position: fixed;  /* جعل الفوتر ثابت */
    bottom: 0; /* جعله في أسفل الصفحة */
    left: 0;
    width: 100%; /* تأكد من أن الفوتر يغطي عرض الصفحة بالكامل */
    z-index: 999; /* لضمان أن الفوتر يبقى فوق باقي المحتويات */
}

/* تنسيق النص داخل الفوتر */
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content p {
    margin: 0;
    font-size: 14px;
}

.social-media {
    margin-top: 10px;
}

.social-media a {
    color: white;
    font-size: 20px;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-media a:hover {
    color: #00c6ff; /* تغيير اللون عند التمرير */
}

/* تصميم النموذج (النافذة) */
#postForm {
    display: none; /* إخفاء النموذج بشكل افتراضي */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* لجعل العنصر في وسط الشاشة */
    background-color: white;
    padding: 30px;
    width: 90%;
    max-width: 600px; /* توسيع العرض ليتناسب مع الشاشات الكبيرة */
    max-height: 80vh; /* الحد الأقصى للارتفاع ليبقى المربع غير مزعج */
    overflow-y: auto; /* في حال كان المحتوى أطول من المربع، يظهر تمرير عمودي */
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* لضمان ظهور المربع فوق المحتوى */
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.3s ease;
    border-radius: 8px;
}

/* التأثير الخاص بمربع البيانات عند الظهور */
#postForm.show {
    display: block;
    opacity: 1; /* جعل العنصر مرئي */
    transform: translate(-50%, -50%) scale(1); /* يظهر بشكل طبيعي مع تأثير التحجيم */
}

/* خلفية مظللة عند ظهور المربع */
#postFormBackdrop {
    display: none; /* إخفاء الخلفية بشكل افتراضي */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* اللون الداكن */
    z-index: 999; /* أسفل المربع */
}

#postFormBackdrop.show {
    display: block; /* إظهار الخلفية عند تفعيل المربع */
}

/* تنسيق زر الإغلاق */
#closeBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    transition: color 0.3s ease;
    padding: 5px 10px;
}

#closeBtn:hover {
    color: red;
}

/* تصميم النموذج (الحقول) */
#postForm label {
    font-size: 16px;
    margin-bottom: 5px;
    display: block;
}

#postForm input,
#postForm select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#postForm button {
    background-color: #007bff;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
}

#postForm button:hover {
    background-color: #0056b3;
}

/* تصميم البوستات */
.posts-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: auto;
    padding-bottom: 60px; /* إضافة مسافة تحت الجدول */
}

.post {
    background-color: white;
    border-radius: 25px;
    padding: 20px;
    box-shadow: 0 10px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 450px; /* ارتفاع ثابت للبوست */
    overflow: hidden;
}

/* مسافة بين الاسم والصورة */
.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #e8f2fb  0%, #d9dfdf  100%);
    padding: 10px 15px;
    border-radius: 10px;
    color: rgb(206, 16, 64); /* عشان النص يبان كويس على الخلفية */
}

.post-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px; /* مسافة أكبر بين الصورة والاسم */
}

.post-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.post-header h3 a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.post-header h3 a:hover {
    color: #007bff; /* تغيير اللون عند التمرير */
}

/* تنسيق عناوين القطع (مثل Motherboard, CPU, GPU) */
.post p strong {
    color: #007bff; /* اللون الأزرق للعناوين */
    font-weight: bold;
}

/* تنسيق النص بجانب العنوان */
.post p {
    font-size: 14px;
    margin: 5px 0;
    color: #333; /* النص باللون الأسود */
}

/* إضافة تأثيرات للأزرار */
button {
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #008CBA; /* تغيير اللون عند التمرير */
    color: white;
}

/* ميديا كويري للتابلت */
@media (max-width: 992px) {
    .posts-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ميديا كويري للجوال */
@media (max-width: 600px) {
    .posts-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .post {
        height: auto; /* إزالة الارتفاع الثابت على الجوال */
    }

    .post-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-header img {
        margin-right: 0;
        margin-bottom: 10px;
    }
}
.country-name {
    font-size: 14px;
    color: #555;
    margin-top: 5px;
}

.post-header img.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.post-header-text {
    display: flex;
    flex-direction: column;
}

.post-header-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.post-header-text .tiktok-link {
    font-size: 14px;
    color: #555;
    text-decoration: none;
    margin-top: 4px;
    display: flex;
    align-items: center;
}

.post-header-text .tiktok-link i {
    margin-right: 6px;
    color: #69C9D0; /* لون تيك توك مميز */
    font-size: 16px;
}

.post-header-text .tiktok-link:hover {
    color: #007bff;
}