/* Blog Enhancement Styles */

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    z-index: 1000;
    transition: width 0.3s ease;
}

/* Enhanced Code Blocks */
.code-block-container {
    position: relative;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.code-block-header {
    background: #2d3748;
    color: white;
    padding: 8px 15px;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-language {
    color: #81c995;
    font-weight: 600;
}

.copy-button {
    background: #4a5568;
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.3s ease;
}

.copy-button:hover {
    background: #2d3748;
}

.copy-button.copied {
    background: #28a745;
}

/* Interactive Table of Contents */
.toc-container {
    position: sticky;
    top: 100px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
}

.toc-container h4 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
}

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

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    color: #4a5568;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
    font-size: 0.875rem;
}

.toc-list a:hover {
    background: #e2e8f0;
    color: #007bff;
    transform: translateX(5px);
}

.toc-list a.active {
    background: #007bff;
    color: white;
    font-weight: 600;
}

/* Enhanced Blog Navigation */
.blog-nav {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.blog-nav-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.blog-nav-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

.blog-nav-icon {
    width: 20px;
    height: 20px;
    color: #007bff;
}

/* Reading Time Indicator */
.reading-time {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.reading-time i {
    color: #007bff;
}

/* Article Metadata */
.article-meta {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    border-left: 4px solid #007bff;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.meta-item:last-child {
    margin-bottom: 0;
}

.meta-icon {
    color: #007bff;
    width: 16px;
}

/* Enhanced Typography */
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    position: relative;
    scroll-margin-top: 100px;
}

.blog-content h2::before,
.blog-content h3::before,
.blog-content h4::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #007bff;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-content h2:hover::before,
.blog-content h3:hover::before,
.blog-content h4:hover::before {
    opacity: 1;
}

/* Interactive Elements */
.highlight-box {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid #2196f3;
    border-radius: 0 8px 8px 0;
    padding: 20px;
    margin: 25px 0;
    position: relative;
    overflow: hidden;
}

.highlight-box::before {
    content: '💡';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.5rem;
}

.highlight-box h5 {
    margin-left: 40px;
    color: #1976d2;
    font-weight: 600;
}

.highlight-box p {
    margin-left: 40px;
    margin-bottom: 0;
}

/* Code Examples Enhancement */
.code-example {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.code-example-tabs {
    background: #2d2d2d;
    display: flex;
    border-bottom: 1px solid #404040;
}

.code-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.code-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.code-tab:hover:not(.active) {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* Social Sharing */
.social-share {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.share-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-button.twitter {
    background: #1da1f2;
}

.share-button.linkedin {
    background: #0077b5;
}

.share-button.facebook {
    background: #1877f2;
}

.share-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .toc-container {
        position: static;
        margin-bottom: 20px;
    }
    
    .social-share {
        position: static;
        flex-direction: row;
        justify-content: center;
        margin: 20px 0;
        transform: none;
    }
    
    .blog-nav {
        padding: 15px;
    }
    
    .code-block-header {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .toc-container {
        background: #2d3748;
        color: white;
    }
    
    .toc-list a {
        color: #e2e8f0;
    }
    
    .toc-list a:hover {
        background: #4a5568;
    }
    
    .article-meta {
        background: #2d3748;
        color: white;
    }
    
    .highlight-box {
        background: linear-gradient(135deg, #2d3748, #4a5568);
        color: white;
    }
}

/* Print Styles */
@media print {
    .toc-container,
    .social-share,
    .blog-nav,
    .reading-progress {
        display: none;
    }
    
    .blog-content {
        max-width: none;
        margin: 0;
    }
}
