/* قسم الأخبار من X - تصميم مبسط */
.x-posts {
    background: var(--bg-secondary) !important;
    padding: 80px 0;
}

/* عناوين القسم */
.x-posts .section-title {
    color: var(--accent-gold) !important;
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 15px;
}

.x-posts .section-subtitle {
    color: var(--text-muted) !important;
    text-align: center;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* حاوية التغريدات */
.x-posts-container {
    max-width: 800px;
    margin: 0 auto 40px;
}

/* تصميم التغريدة */
.x-post-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.x-post-card:hover {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
}

.x-post-card:nth-child(1) { animation-delay: 0.1s; }
.x-post-card:nth-child(2) { animation-delay: 0.2s; }
.x-post-card:nth-child(3) { animation-delay: 0.3s; }

/* رأس التغريدة */
.x-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.x-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    margin-left: 15px;
    background: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.x-post-avatar i {
    font-size: 24px;
    color: var(--bg-primary);
}

.x-post-user-info {
    flex: 1;
}

.x-post-user-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.x-post-user-name h4 {
    color: var(--text-primary) !important;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

.x-post-verified {
    color: var(--accent-gold);
    font-size: 0.9rem;
}

.x-post-handle {
    color: var(--text-secondary) !important;
    font-size: 0.95rem;
    margin: 0;
}

/* محتوى التغريدة */
.x-post-content {
    margin-bottom: 20px;
}

.x-post-text {
    color: var(--text-secondary) !important;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
}

.x-post-text a {
    color: var(--accent-gold) !important;
    text-decoration: none;
}

.x-post-text a:hover {
    text-decoration: underline;
}

/* إحصائيات التغريدة */
.x-post-stats {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.x-post-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
}

.x-post-stat i {
    font-size: 1rem;
}

.x-post-stat.likes i { color: #e0245e; }
.x-post-stat.retweets i { color: #17bf63; }
.x-post-stat.comments i { color: #1da1f2; }
.x-post-stat.views i { color: var(--accent-gold); }

/* تذييل التغريدة */
.x-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.x-post-date {
    color: var(--text-muted) !important;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.x-post-date i {
    color: var(--accent-gold);
}

.x-post-actions {
    display: flex;
    gap: 10px;
}

.x-post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.x-post-action-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.x-post-action-btn.view-tweet {
    background: rgba(29, 155, 240, 0.1);
    border-color: rgba(29, 155, 240, 0.3);
    color: #1da1f2;
}

.x-post-action-btn.view-tweet:hover {
    background: #1da1f2;
    color: white;
}

/* حالات التحميل والفراغ */
.x-posts-loading,
.x-posts-empty {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--accent-gold);
}

.x-posts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
}

.x-posts-empty i {
    font-size: 3rem;
    color: var(--text-muted);
}

/* زر مشاهدة المزيد */
.x-posts-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
    margin-top: 20px;
}

.x-view-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.x-view-more-btn:hover {
    background: var(--accent-orange);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 180, 0, 0.3);
}

/* أنيميشن */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .x-posts {
        padding: 60px 0;
    }
    
    .x-post-card {
        padding: 20px;
    }
    
    .x-post-stats {
        gap: 20px;
    }
    
    .x-post-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .x-post-actions {
        width: 100%;
    }
    
    .x-post-action-btn {
        flex: 1;
        justify-content: center;
    }
}

/* كلاس مساعد */
.hidden {
    display: none !important;
}
/* SVG مبسط وواضح جداً */

.x-post-avatar {
    background-image: url("century-logo.svg");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: 2px solid #aa66ff;
    box-shadow: 0 0 10px rgba(170, 102, 255, 0.5);
}








/* تحويل الحاوية إلى شبكة مربعات */
.x-posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;  /* عرض أكبر لاستيعاب عدة أعمدة */
    margin: 0 auto 40px;
    padding: 0 20px;
}

/* تصميم البطاقة المربعة */
.x-post-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 16px;  /* زوايا أقل انحناءً لتناسب الشكل المربع */
    padding: 20px;
    aspect-ratio: 1 / 1;  /* سر التربيع */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
    margin-bottom: 0;  /* الغيت المسافة السفلية، الشبكة تتحكم بالتباعد */
}

/* تعديل توزيع العناصر داخل المربع */
.x-post-header {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.x-post-content {
    flex: 1;  /* يأخذ المساحة المتبقية */
    overflow-y: auto;  /* تمرير المحتوى الطويل */
    margin-bottom: 12px;
}

.x-post-text {
    font-size: 0.95rem;  /* تصغير طفيف */
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;  /* قص النص بعد 4 أسطر */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ضبط الإحصائيات والأزرار لتكون في الأسفل */
.x-post-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    justify-content: space-around;
}

.x-post-stat {
    font-size: 0.8rem;
}

.x-post-footer {
    flex-shrink: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.x-post-date {
    justify-content: center;
}

.x-post-actions {
    display: flex;
    gap: 8px;
    justify-content: stretch;
}

.x-post-action-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.8rem;
    justify-content: center;
}

/* تعديل تأخير الأنيميشن ليتناسب مع الشبكة */
.x-post-card:nth-child(1) { animation-delay: 0.1s; }
.x-post-card:nth-child(2) { animation-delay: 0.15s; }
.x-post-card:nth-child(3) { animation-delay: 0.2s; }
.x-post-card:nth-child(4) { animation-delay: 0.25s; }
.x-post-card:nth-child(5) { animation-delay: 0.3s; }
.x-post-card:nth-child(6) { animation-delay: 0.35s; }
/* أضف المزيد حسب الحاجة */

/* للشاشات الصغيرة نعود لعمود واحد */
@media (max-width: 768px) {
    .x-posts-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .x-post-card {
        aspect-ratio: auto;  /* يعود مستطيلاً على الجوال */
        min-height: auto;
    }
    
    .x-post-text {
        -webkit-line-clamp: 3;
    }
}