/* Blog Article Styles */

/* Table of Contents Sidebar */
.toc-sidebar {
    position: sticky;
    top: 100px;
    width: 250px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    margin-right: 3rem;
    float: left;
}

.toc-content {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
}

.toc-title {
    color: #8b5cf6;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.3rem 0.5rem;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

.toc-link:hover {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    border-left-color: #8b5cf6;
}

.toc-link.active {
    color: #d946ef;
    background: rgba(217, 70, 239, 0.1);
    border-left-color: #d946ef;
}

.toc-link.toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.85rem;
}

/* Article with TOC Layout */
.article {
    display: flex;
    gap: 3rem;
}

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

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(139, 92, 246, 0.1);
    z-index: 1001;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #d946ef);
    width: 0;
    transition: width 0.1s ease;
}

/* Mobile TOC Button */
.mobile-toc-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
}

.mobile-toc-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

/* Recommended Articles Hover Effect */
.recommended-articles article {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recommended-articles article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .toc-sidebar {
        display: none;
    }
    
    .article {
        display: block;
    }
    
    .mobile-toc-button {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .toc-sidebar {
        display: none;
    }
    
    .article {
        display: block;
    }
    
    .mobile-toc-button {
        display: flex !important;
    }
    
    .recommended-articles .container > div {
        grid-template-columns: 1fr !important;
    }
}

/* Content Styles Enhancement */
.article-body h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.article-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #a78bfa;
}

.article-body ul,
.article-body ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.article-body table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.5rem;
    overflow: hidden;
}

.article-body th,
.article-body td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.article-body th {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    font-weight: 600;
}

.article-body .highlight-box,
.article-body .tip-box {
    background: rgba(139, 92, 246, 0.1);
    border-left: 4px solid #8b5cf6;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0.5rem;
}

.article-body .highlight-box strong,
.article-body .tip-box h4 {
    color: #8b5cf6;
}