/* Advanced Features Styles */

/* Read Progress Bar */
.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.read-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.1s ease;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.6);
}

/* Bookmark Button */
.bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem 0;
}

.bookmark-btn:hover {
    border-color: #fbbf24;
    background: #fef3c7;
    transform: translateY(-2px);
}

.bookmark-btn.bookmarked {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #f59e0b;
    color: white;
}

/* Related Posts */
.related-posts {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.related-posts h3 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-size: 1.5rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-post-card {
    background: var(--surface-light);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--card-shadow);
    border-color: #667eea;
}

.related-thumbnail {
    font-size: 2.5rem;
    text-align: center;
}

.related-post-card h4 {
    color: var(--text-main);
    font-size: 1.1rem;
    margin: 0;
}

.related-post-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Reading Time Badge */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Popular Posts Widget */
.popular-posts {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.popular-posts h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.popular-post-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface-light);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.popular-post-item:hover {
    transform: translateX(5px);
    background: var(--surface-subtle);
}

.popular-post-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: #667eea;
    min-width: 30px;
}

.popular-post-title {
    color: var(--text-main);
    font-weight: 600;
}

.popular-post-views {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Search Highlight */
.search-highlight {
    background: #fef3c7;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
}

[data-theme="dark"] .search-highlight {
    background: #78350f;
    color: #fef3c7;
}

/* Responsive */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 5rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .bookmark-btn {
        width: 100%;
        justify-content: center;
    }
}