:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --light-text: #7f8c8d;
    --border-color: #eaeaea;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.8;
    color: var(--dark-text);
    background-color: #fff;
    padding-top: 20px;
    direction: rtl;
}

.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-title {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    line-height: 1.3;
}

.article-meta {
    color: var(--light-text);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.article-content {
    display: flex;
    gap: 30px;
}

.table-of-contents {
    flex: 0 0 280px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-height: 80vh;
    overflow-y: auto;
}

.toc-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

.toc-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.toc-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
    padding-right: 5px;
}

.toc-item a {
    text-decoration: none;
    color: var(--dark-text);
    display: block;
    transition: color 0.3s ease;
}

.toc-item a:hover {
    color: var(--secondary-color);
}

.content-body {
    flex: 1;
    min-width: 0;
}

.article-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    scroll-margin-top: 20px;
}

.section-title {
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
}

.section-content {
    font-size: 1.05rem;
    text-align: justify;
}

.article-summary {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-right: 4px solid var(--secondary-color);
}

.summary-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.share-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--light-bg);
    color: var(--dark-text);
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
}

@media (max-width: 992px) {
    .article-content {
        flex-direction: column;
    }
    
    .table-of-contents {
        position: relative;
        top: 0;
        width: 100%;
        margin-bottom: 30px;
    }
    
    .article-title {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .article-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
}