/* ===== نظام ألوان احترافي ===== */

/* تحميل CSS الخاص بالتعليقات */
@import url('comments.css');

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --accent: #f72585;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --success: #4cc9f0;
    --border: #e9ecef;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

/* ===== إعادة الضبط ===== */
.mira-blog-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    min-height: 100vh;
}

/* ===== الهيدر الرئيسي ===== */
.blog-hero {
    text-align: center;
    margin-bottom: 60px;
    padding: 80px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius);
    color: white;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100"><path fill="rgba(255,255,255,0.1)" d="M0,70 C150,110 350,10 500,70 L500,00 L0,0 Z"/></svg>') no-repeat bottom;
}

.blog-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.blog-hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 40px;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== شريط الفلاتر ===== */
.blog-filters-bar {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* ===== شبكة المقالات المتطورة ===== */
.blog-grid-advanced {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

/* ===== بطاقة المقال الاحترافية ===== */
.blog-card-premium {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
}

.blog-card-premium:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* الصورة */
.card-media {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-media::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.blog-card-premium:hover .card-media img {
    transform: scale(1.08);
}

/* شارة التصنيف */
.category-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

/* محتوى البطاقة */
.card-body {
    padding: 24px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: var(--gray);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.card-title a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.card-excerpt {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* إحصائيات البطاقة */
.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.read-time {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    font-size: 0.875rem;
}

.read-progress {
    width: 60px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.read-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width 1.5s ease;
}

.blog-card-premium:hover .read-progress-bar {
    width: 100%;
}

/* أزرار التفاعل */
.card-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: var(--light);
    color: var(--gray);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ===== الشريط الجانبي ===== */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    margin-top: 60px;
}

.sidebar {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.sidebar-widget {
    margin-bottom: 32px;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

/* المقالات الشائعة */
.popular-posts {
    list-style: none;
    padding: 0;
}

.popular-post-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.popular-post-item:hover {
    background: var(--light);
    padding-left: 12px;
}

.popular-post-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 40px;
}

.popular-post-content h4 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    line-height: 1.4;
}

.popular-post-meta {
    font-size: 0.75rem;
    color: var(--gray);
}

/* التصنيفات السحابية */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 8px 16px;
    background: var(--light);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ===== الباجنيشن المتقدم ===== */
.blog-pagination-advanced {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 60px;
}

.page-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--dark);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ===== تصميم متجاوب ===== */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    
    .blog-hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .blog-grid-advanced {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== المقال المفرد المتطور ===== */

.mira-single-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* هيدر المقال */
.single-hero {
    margin-bottom: 60px;
    padding-top: 40px;
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--gray);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb .sep {
    margin: 0 10px;
    color: #ccc;
}

.single-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 30px;
    color: var(--dark);
}

/* معلومات المقال */
.single-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--dark);
}

.post-date {
    font-size: 0.9rem;
    color: var(--gray);
}

.post-stats {
    display: flex;
    gap: 25px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--gray);
}

/* الصورة الرئيسية */
.featured-image {
    margin: 40px 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.main-image {
    width: 100%;
    height: auto;
    display: block;
}

.image-caption {
    padding: 15px 20px;
    background: var(--light);
    color: var(--gray);
    font-size: 0.9rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* تخطيط المقال */
.single-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 50px;
    position: relative;
}

/* شريط التنقل */
.article-nav {
    background: var(--light);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    border-left: 4px solid var(--primary);
}

.nav-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* محتوى المقال */
.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #2d3748;
}

.article-content h2 {
    font-size: 2rem;
    margin: 50px 0 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
    color: var(--dark);
}

.article-content h3 {
    font-size: 1.6rem;
    margin: 40px 0 20px;
    color: var(--dark);
}

.article-content p {
    margin-bottom: 25px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 30px 0;
    box-shadow: var(--shadow);
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 20px 30px;
    margin: 40px 0;
    background: var(--light);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--dark);
}

.article-content pre {
    background: #1a1a2e;
    color: #e2e8f0;
    padding: 25px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 30px 0;
    font-family: 'Courier New', monospace;
}

.article-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #dc2626;
}

/* شريط المشاركة العائم */
.floating-share {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.share-btn, .save-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray);
}

.share-btn:hover, .save-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

/* شريط التقدم في القراءة */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border);
    z-index: 1001;
    display: flex;
    align-items: center;
}

.progress-bar {
    flex: 1;
    height: 100%;
    background: transparent;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    right: 20px;
    font-size: 0.8rem;
    color: var(--gray);
    background: white;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* تذييل المقال */
.article-footer {
    margin: 60px 0;
    padding: 40px;
    background: var(--light);
    border-radius: var(--radius);
}

.taxonomies {
    margin-bottom: 40px;
}

.taxonomies h4 {
    margin-bottom: 15px;
    color: var(--dark);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags-list .tag {
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    text-decoration: none;
    color: var(--gray);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tags-list .tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.print-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.print-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* تقييم المقال */
.rating-widget {
    margin-top: 40px;
}

.rating-widget h4 {
    margin-bottom: 15px;
    color: var(--dark);
}

.stars {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.star {
    font-size: 2rem;
    color: #e5e7eb;
    cursor: pointer;
    transition: color 0.3s ease;
}

.star:hover,
.star.active {
    color: #f59e0b;
}

.rating-score {
    font-size: 1.1rem;
    color: var(--gray);
}

/* معلومات الكاتب */
.author-box {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border-radius: var(--radius);
    padding: 40px;
    margin: 60px 0;
    border-left: 5px solid var(--primary);
}

.author-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.author-avatar-large img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: var(--shadow);
}

.author-info h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.author-bio {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.author-social a {
    display: inline-block;
    margin-right: 15px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.author-social a:hover {
    background: var(--primary-dark);
}

.author-posts h4 {
    margin-bottom: 20px;
    color: var(--dark);
}

.author-articles {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.author-article {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.author-article a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.author-article a:hover {
    color: var(--primary);
}

.article-date {
    color: var(--gray);
    font-size: 0.9rem;
}

/* مقالات ذات صلة */
.related-posts {
    margin: 80px 0;
}

.related-posts h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.no-related {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    background: var(--light);
    border-radius: var(--radius);
}

/* الشريط الجانبي للمقال */
.single-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.toc-widget {
    background: var(--light);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toc-nav {
    max-height: 400px;
    overflow-y: auto;
}

.toc-nav a {
    display: block;
    padding: 10px 15px;
    margin: 5px 0;
    color: var(--gray);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.toc-nav a:hover,
.toc-nav a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: white;
}

/* القائمة الشائعة */
.popular-list {
    list-style: none;
    padding: 0;
}

.popular-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.popular-item:hover {
    background: var(--light);
    padding-left: 10px;
}

.popular-rank {
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.popular-content {
    flex: 1;
}

.popular-content a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.popular-content a:hover {
    color: var(--primary);
}

.popular-meta {
    font-size: 0.8rem;
    color: var(--gray);
}

/* نصائح القراءة */
.tips-widget {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    padding: 25px;
    border-radius: var(--radius);
    border-left: 5px solid var(--primary);
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    padding: 10px 0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tips-list li:before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
}

.tips-list kbd {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--dark);
}

/* تصميم متجاوب */
@media (max-width: 1200px) {
    .single-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .floating-share {
        display: none;
    }
    
    .single-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .single-title {
        font-size: 2rem;
    }
    
    .single-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .author-header {
        flex-direction: column;
        text-align: center;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}