/* Color Palette */
:root {
    --primary-dark: #2d7a3e;
    --primary-main: #4caf50;
    --primary-light: #81c784;
    --bg-light: #e8f5e9;
    --bg-lighter: #f1f8f5;
    --text-dark: #1b1b1b;
    --text-gray: #666;
    --border-color: #c8e6c9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-lighter);
    background-image:
        linear-gradient(135deg, rgba(77, 175, 80, 0.03) 0%, rgba(129, 199, 132, 0.03) 100%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234caf50' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    color: var(--primary-dark);
    font-weight: 700;
    margin-top: 0;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.3;
}

h2 {
    font-size: 2rem;
    line-height: 1.4;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.4;
}

h4 {
    font-size: 1.25rem;
}

p {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

a {
    color: var(--primary-main);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* Header & Navigation */
.blog-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-main) 100%);
    padding: 1.5rem 0;
    color: white;
    box-shadow: 0 2px 8px rgba(45, 122, 62, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.blog-header .navbar-brand {
    font-family: 'Merriweather', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.blog-header .navbar-brand i {
    font-size: 1.5rem;
}

.blog-header .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.blog-header .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.blog-header .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main Layout */
main {
    flex: 1;
    padding: 3rem 0;
}

.container-blog {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Blog Cards */
.blog-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(45, 122, 62, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(129, 199, 132, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    box-shadow: 0 8px 16px rgba(45, 122, 62, 0.15);
    transform: translateY(-4px);
}

.blog-card-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-light), var(--border-color));
    position: relative;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--primary-main);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.blog-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-category {
    display: inline-block;
    color: var(--primary-main);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.blog-card-title {
    font-family: 'Merriweather', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.blog-card-title a {
    color: var(--primary-dark);
}

.blog-card-title a:hover {
    color: var(--primary-main);
}

.blog-card-excerpt {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.6;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-gray);
}

.blog-card-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-card-meta-item i {
    color: var(--primary-main);
}

.blog-card-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.blog-card-link:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}

/* Breadcrumb */
.breadcrumb-blog {
    background-color: transparent;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.breadcrumb-blog .breadcrumb-item {
    color: var(--text-gray);
}

.breadcrumb-blog .breadcrumb-item a {
    color: var(--primary-main);
}

.breadcrumb-blog .breadcrumb-item.active {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Sidebar */
.sidebar-blog {
    margin-top: 2rem;
}

.sidebar-widget {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(45, 122, 62, 0.08);
    border: 1px solid rgba(129, 199, 132, 0.1);
}

.sidebar-widget-title {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-main);
    position: relative;
}

.sidebar-widget-title::before {
    content: '🌿';
    margin-right: 8px;
}

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

.category-list li {
    margin-bottom: 0.75rem;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    color: var(--text-gray);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.category-list a:hover {
    color: var(--primary-main);
    padding-left: 8px;
}

.category-list a.active {
    color: var(--primary-main);
    font-weight: 600;
    background-color: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-bottom: 2px solid var(--primary-main);
}

.category-list a.active .category-count {
    background-color: var(--primary-main);
    color: white;
}

.category-count {
    background-color: var(--bg-light);
    color: var(--primary-dark);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Footer */
.blog-footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-main) 100%);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    border-top: 3px solid var(--primary-light);
}

.footer-section {
    margin-bottom: 2rem;
}

.footer-title {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 0.95rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-link:hover {
    color: white;
}

.footer-link i {
    color: var(--primary-light);
    width: 20px;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Detail Page Styles */
.article-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-main) 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.article-hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    font-size: 0.95rem;
    opacity: 0.95;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-meta-item i {
    font-size: 1.1rem;
}

.article-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    line-height: 1.8;
    color: var(--text-gray);
}

.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 3px solid var(--bg-light);
}

.article-content h2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.article-content p {
    margin-bottom: 1.5rem;
}

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

.article-content li {
    margin-bottom: 0.75rem;
    color: var(--text-gray);
}

.article-content strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.article-content em {
    color: var(--primary-main);
    font-style: italic;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(45, 122, 62, 0.1);
}

.article-content blockquote {
    border-left: 4px solid var(--primary-main);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-gray);
}

.article-content code {
    background-color: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--primary-dark);
    font-family: 'Courier New', monospace;
}

.article-content pre {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.article-content table th,
.article-content table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.article-content table th {
    background-color: var(--bg-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.article-content table tbody tr:hover {
    background-color: var(--bg-lighter);
}

.article-highlight {
    background-color: var(--bg-light);
    border-left: 4px solid var(--primary-main);
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.article-highlight strong {
    display: block;
    margin-bottom: 0.5rem;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: white;
}

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

.share-btn-facebook:hover {
    background-color: #0a66c2;
}

.share-btn-zalo {
    background-color: #0084ff;
}

.share-btn-zalo:hover {
    background-color: #0073e6;
}

.share-btn-copy {
    background-color: var(--primary-main);
}

.share-btn-copy:hover {
    background-color: var(--primary-dark);
}

/* Related Posts */
.related-posts {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 3rem;
    border: 1px solid var(--border-color);
}

.related-posts h3 {
    font-family: 'Merriweather', serif;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-main);
}

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

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .blog-header .navbar-brand {
        font-size: 1.3rem;
    }

    main {
        padding: 1.5rem 0;
    }

    .article-content {
        padding: 1.5rem;
    }

    .article-meta {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .sidebar-blog {
        margin-top: 3rem;
    }

    .share-buttons {
        justify-content: center;
    }

    .article-hero h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }

    .blog-header .navbar-brand {
        font-size: 1.1rem;
    }

    .blog-card-title {
        font-size: 1.1rem;
    }

    .blog-card-content {
        padding: 1rem;
    }

    main {
        padding: 1rem 0;
    }

    .article-hero h1 {
        font-size: 1.5rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .share-buttons {
        flex-direction: column;
    }

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

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* Loading Animation */
.blog-loading {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-main);
    margin: 0 4px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-item {
    margin: 0 4px 8px 4px;
}

.page-link {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--primary-main);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 44px;
    text-align: center;
}

.page-link:hover {
    color: white;
    background-color: var(--primary-main);
    border-color: var(--primary-main);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(45, 122, 62, 0.2);
}

.page-item.active .page-link {
    background-color: var(--primary-main);
    border-color: var(--primary-main);
    color: white;
    box-shadow: 0 2px 8px rgba(45, 122, 62, 0.3);
}

.page-item.disabled .page-link {
    background-color: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

.page-item.disabled .page-link:hover {
    background-color: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-gray);
    transform: none;
    box-shadow: none;
}

/* Input Group Focus */
.input-group .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
    outline: none;
}

.input-group-append .btn:hover {
    background-color: var(--primary-dark) !important;
}

/* Print Styles */
@media print {
    .blog-header, .blog-footer, .sidebar-blog, .share-buttons, .related-posts, .pagination {
        display: none;
    }

    .article-content {
        box-shadow: none;
        border: none;
    }
}
