/* ===================================
   تحسينات صفحة المقال الفردي
   =================================== */

.single-post-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 3rem;
}

/* رأس المقال */
.entry-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-color);
}

.entry-categories {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.entry-category {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(44, 95, 126, 0.2);
}

.entry-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 95, 126, 0.3);
    color: white;
}

.entry-title {
    font-size: 2.5rem;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 800;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-item i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.meta-author a {
    color: var(--primary-color);
    font-weight: 600;
}

.meta-author a:hover {
    color: var(--accent-color);
}

/* الصورة البارزة */
.entry-featured-image {
    margin: 0 -2.5rem 1.5rem;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    max-height: 500px;
}

.entry-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* محتوى المقال */
.entry-content {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-primary);
}

.entry-content p {
    margin-bottom: 1.75rem;
}

.entry-content h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    position: relative;
    padding-bottom: 1rem;
}

.entry-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: 2px;
}

.entry-content h3 {
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
}

.entry-content h4 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.entry-content ul,
.entry-content ol {
    margin-right: 2rem;
    margin-bottom: 2rem;
}

.entry-content li {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2.5rem auto;
    display: block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.entry-content blockquote {
    margin: 2.5rem 0;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, rgba(44, 95, 126, 0.05), rgba(230, 126, 34, 0.05));
    border-right: 5px solid var(--accent-color);
    border-radius: 12px;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

/* الجداول */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.entry-content table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.entry-content table th {
    padding: 1.25rem 1.5rem;
    text-align: right;
    font-weight: 700;
    font-size: 1rem;
}

.entry-content table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}

.entry-content table tbody tr:hover {
    background: var(--bg-primary);
}

.entry-content table tbody tr:last-child td {
    border-bottom: none;
}

/* الكود */
.entry-content code {
    background: var(--bg-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-color);
}

.entry-content pre {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 2px solid var(--border-color);
}

.entry-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

/* التذييل - الوسوم مضغوطة */
.entry-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.entry-tags {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.entry-tags i {
    color: var(--accent-color);
    font-size: 1rem;
}

.entry-tags .tags-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.entry-tags a {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.entry-tags a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* قسم المشاركة - مضغوط */
.share-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(44, 95, 126, 0.05), rgba(230, 126, 34, 0.05));
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.share-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-title i {
    color: var(--accent-color);
    font-size: 1rem;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
}

.share-btn i {
    font-size: 1rem;
}

.share-btn.facebook {
    background: linear-gradient(135deg, #3b5998, #2d4373);
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1da1f2, #0c85d0);
}

.share-btn.whatsapp {
    background: linear-gradient(135deg, #25d366, #1ebe57);
}

.share-btn.linkedin {
    background: linear-gradient(135deg, #0077b5, #005885);
}

.share-btn.copy-link {
    background: linear-gradient(135deg, #6c757d, #545b62);
}

/* المقالات ذات الصلة */
.related-posts {
    margin-top: 4rem;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.related-posts .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.related-posts .section-title i {
    color: var(--accent-color);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.related-post-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.related-post-thumb {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    background: var(--bg-secondary);
}

.related-post-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-post-card:hover .related-post-thumb img {
    transform: scale(1.1);
}

.related-post-content {
    padding: 1.5rem;
}

.related-post-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.related-post-title a {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.related-post-title a:hover {
    color: var(--primary-color);
}

.related-post-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.related-post-meta i {
    color: var(--accent-color);
    margin-left: 0.3rem;
}

/* روابط الصفحات */
.page-links {
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.page-links-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 1rem;
}

.page-links a,
.page-links > span:not(.page-links-title) {
    padding: 0.75rem 1.25rem;
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 50px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.page-links a:hover,
.page-links > span:not(.page-links-title) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* استجابة للموبايل */
@media (max-width: 992px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .single-post-content {
        padding: 2rem 1.5rem;
    }
    
    .entry-title {
        font-size: 2rem;
    }
    
    .entry-content {
        font-size: 1.05rem;
    }
    
    .entry-featured-image {
        margin: 0 -1.5rem 2rem;
    }
    
    .related-posts {
        padding: 2rem 1.5rem;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .share-buttons {
        gap: 0.75rem;
    }
    
    .share-btn {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 140px;
        justify-content: center;
    }
    
    .entry-meta {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .share-btn {
        flex: 1 1 100%;
    }
    
    .entry-title {
        font-size: 1.6rem;
    }
    
    .entry-content h2 {
        font-size: 1.6rem;
    }
}

/* ===================================
   تحسين التخطيط للمقال - مساحة أوسع
   =================================== */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}

.main-content {
    min-width: 0;
}

@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: var(--accent-color);
}

.breadcrumbs span {
    color: var(--text-secondary);
}

/* ===================================
   قسم التحميل - للملفات
   =================================== */
.download-section {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(44, 95, 126, 0.08), rgba(230, 126, 34, 0.08));
    border-radius: 12px;
    text-align: center;
    border: 2px dashed var(--primary-color);
}

.download-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.download-btn-large:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(39, 174, 96, 0.4);
}

.download-btn-large i {
    font-size: 1.3rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.download-category {
    background: linear-gradient(135deg, #27ae60, #229954) !important;
}

.download-category:hover {
    background: linear-gradient(135deg, #229954, #1e8449) !important;
}
