/* Custom CSS for Blog Homepage */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
}

/* Search container */
.search-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Blog post card styling */
.blog-post {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
    overflow: hidden;
}

.blog-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.blog-post-header {
    padding: 25px;
    padding-bottom: 0;
}

.blog-post-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
    text-decoration: none;
}

.blog-post-title:hover {
    color: #0d6efd;
    text-decoration: none;
}

.blog-post-meta {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.blog-post-meta i {
    margin-right: 5px;
    width: 16px;
}

.blog-post-content {
    padding: 0 25px 25px;
    color: #555;
    line-height: 1.6;
}

.blog-post-excerpt {
    margin-bottom: 20px;
}

.blog-post-footer {
    border-top: 1px solid #eee;
    padding: 15px 25px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Tags and categories */
.post-tags, .post-category {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tag, .category {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag:hover, .category:hover {
    background: #0d6efd;
    color: white;
    text-decoration: none;
}

/* Sidebar styling */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Categories in sidebar */
.categories .category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: color 0.3s ease;
}

.categories .category-item:last-child {
    border-bottom: none;
}

.categories .category-item:hover {
    color: #0d6efd;
}

.category-count {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Tags in sidebar */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags .tag {
    cursor: pointer;
    font-size: 0.85rem;
}

/* Recent posts */
.recent-post {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.recent-post:last-child {
    border-bottom: none;
}

.recent-post-title {
    font-size: 0.9rem;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.3;
}

.recent-post-title:hover {
    color: #0d6efd;
    text-decoration: none;
}

.recent-post-date {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

/* Archive */
.archive-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: color 0.3s ease;
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-item:hover {
    color: #0d6efd;
}

.archive-count {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: #0d6efd;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #0d6efd;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #dee2e6;
}

/* Loading animation */
.loading {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
}

.loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Active filter indicator */
.active-filter {
    background: #0d6efd !important;
    color: white !important;
}

/* Article Detail Page Styles */
.article-detail {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.article-header {
    padding: 40px;
    border-bottom: 1px solid #eee;
}

.article-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
    font-size: 2.5rem;
}

.article-meta {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-meta i {
    width: 16px;
}

.article-category-tags {
    margin-top: 20px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.article-content {
    padding: 40px;
    color: #333;
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-content h2 {
    color: #2c3e50;
    font-weight: 600;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.article-content h3 {
    color: #495057;
    font-weight: 600;
    margin: 25px 0 15px;
}

.article-content p {
    margin-bottom: 20px;
    text-align: justify;
}

.article-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    color: #e83e8c;
    font-size: 0.9em;
}

.article-content pre {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
    margin: 20px 0;
    overflow-x: auto;
}

.article-content blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #6c757d;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
}

.article-content ul, .article-content ol {
    padding-left: 30px;
    margin-bottom: 20px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-footer {
    padding: 30px 40px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

.share-buttons h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

.share-buttons .btn {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* Article Navigation */
.article-navigation {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
}

.nav-article {
    display: block;
    text-decoration: none;
    color: #495057;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-article:hover {
    color: #0d6efd;
    border-color: #0d6efd;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.nav-article-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.nav-article-title {
    font-weight: 600;
    line-height: 1.3;
}

/* Related Articles */
.related-articles {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
}

.related-articles h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.related-article {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.related-article:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.related-article h6 {
    margin-bottom: 10px;
}

.related-article h6 a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
}

.related-article h6 a:hover {
    color: #0d6efd;
}

.related-article-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.related-article-excerpt {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

/* Table of Contents */
.toc-card {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

#tableOfContents {
    max-height: 300px;
    overflow-y: auto;
}

#tableOfContents ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#tableOfContents ul ul {
    padding-left: 20px;
    margin-top: 5px;
}

#tableOfContents li {
    margin-bottom: 8px;
}

#tableOfContents a {
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    display: block;
    padding: 5px 0;
    border-left: 3px solid transparent;
    padding-left: 10px;
    transition: all 0.3s ease;
}

#tableOfContents a:hover,
#tableOfContents a.active {
    color: #0d6efd;
    border-left-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 0 5px 5px 0;
}

/* Author Info */
.author-info {
    text-align: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.author-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.author-bio {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
}

/* Back to top button */
.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-floating:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-floating.show {
    display: flex;
}

/* Breadcrumb */
.breadcrumb {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 20px;
}

.breadcrumb-item a {
    color: #0d6efd;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* Responsive design for article detail */
@media (max-width: 768px) {
    .article-header {
        padding: 25px 20px;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-content {
        padding: 25px 20px;
        font-size: 1rem;
    }
    
    .article-footer {
        padding: 20px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .share-buttons .btn {
        width: 100%;
        margin-right: 0;
    }
    
    .toc-card {
        position: static;
        margin-bottom: 20px;
    }
    
    .btn-floating {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .related-articles {
        padding: 20px;
    }
    
    .article-navigation {
        padding: 15px;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .blog-post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .search-container {
        margin: 0 15px;
    }
    
    .blog-post {
        margin: 0 15px 30px;
    }
    
    .blog-post-header,
    .blog-post-content {
        padding: 20px;
    }
    
    .blog-post-content {
        padding-top: 0;
    }
}