/* Enhanced Blog Article Styles */

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

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

/* Article Layout with Sidebar */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Article Outline Sidebar */
.article-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.article-outline {
    background: var(--glass-white);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-white-border);
}

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

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

.outline-item {
    margin-bottom: 0.75rem;
    padding-left: 0;
}

.outline-item.h3 {
    padding-left: 1rem;
}

.outline-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.outline-link:hover {
    background: rgba(139, 92, 246, 0.05);
    color: var(--text-primary);
    border-left-color: #8B5CF6;
}

.outline-link.active {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
    font-weight: 600;
    border-left-color: #8B5CF6;
}

/* Article Meta Info */
.article-meta-box {
    background: var(--glass-white);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-white-border);
    margin-top: 2rem;
}

.article-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Related Articles Section */
.related-articles {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--glass-white-border);
}

.related-articles-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(90deg, #8B5CF6, #F97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.related-article-card {
    background: var(--glass-white);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-white-border);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.related-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.related-article-category {
    font-size: 0.85rem;
    color: #8B5CF6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.related-article-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.related-article-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Share Section */
.share-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(249, 115, 22, 0.1));
    border-radius: 16px;
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.share-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--glass-white);
    border: 1px solid var(--glass-white-border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: linear-gradient(135deg, #8B5CF6, #F97316);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        display: none;
    }
    
    /* Mobile Table of Contents */
    .mobile-toc {
        display: block;
        background: var(--glass-white);
        backdrop-filter: blur(20px);
        border-radius: 16px;
        padding: 1.5rem;
        border: 1px solid var(--glass-white-border);
        margin-bottom: 2rem;
    }
    
    .mobile-toc-toggle {
        width: 100%;
        text-align: left;
        padding: 0.75rem;
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(249, 115, 22, 0.1));
        border: 1px solid rgba(139, 92, 246, 0.3);
        border-radius: 8px;
        color: var(--text-primary);
        font-weight: 600;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-toc-content {
        margin-top: 1rem;
        display: none;
    }
    
    .mobile-toc.active .mobile-toc-content {
        display: block;
    }
}

@media (min-width: 1025px) {
    .mobile-toc {
        display: none;
    }
}

/* Article Content Enhancements */
.article-content h2 {
    position: relative;
    padding-left: 1rem;
    margin: 2.5rem 0 1.5rem;
}

.article-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 80%;
    background: linear-gradient(180deg, #8B5CF6, #F97316);
    border-radius: 2px;
}

.article-content h3 {
    color: #8B5CF6;
    margin: 2rem 0 1rem;
}

.article-content blockquote {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(249, 115, 22, 0.05));
    border-left: 4px solid #8B5CF6;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    font-style: italic;
    color: var(--text-primary);
}

.article-content .highlight-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(249, 115, 22, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.article-content .tip-box {
    background: rgba(34, 197, 94, 0.1);
    border-left: 4px solid #22C55E;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.article-content .tip-box::before {
    content: '💡 TIP: ';
    font-weight: bold;
    color: #22C55E;
}

/* Mobile TOC Styles - Fixed positioning */
.blog-mobile-toc {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 80vw;
    height: 100vh;
    background: var(--glass-white);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-white-border);
    z-index: 999;
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 2rem 1.5rem;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.blog-mobile-toc.active {
    right: 0;
}

.blog-mobile-toc-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #8B5CF6, #F97316);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    z-index: 998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-mobile-toc-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.4);
}

/* Hide mobile TOC on desktop */
@media (min-width: 1025px) {
    .blog-mobile-toc,
    .blog-mobile-toc-toggle {
        display: none;
    }
}

/* Show mobile TOC only on mobile/tablet */
@media (max-width: 1024px) {
    .blog-toc-container {
        display: none;
    }
}