/* ===== Blog Styles ===== */

/* Category Tabs */
.blog-filters { padding: 30px 0 10px; background: var(--light-bg, #f8f9fa); }
.category-tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cat-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: 50px;
    background: white; color: #555; text-decoration: none;
    font-size: 14px; font-weight: 500;
    border: 1px solid #e0e0e0; transition: all .25s;
}
.cat-tab:hover, .cat-tab.active {
    background: var(--cat-color, var(--primary-color, #0056b3));
    color: white; border-color: transparent;
}
.cat-tab i { font-size: 13px; }

/* Blog Grid */
.blog-grid-section { padding: 40px 0 60px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

/* Blog Card */
.blog-card {
    display: flex; flex-direction: column;
    background: white; border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    overflow: hidden; text-decoration: none; color: inherit;
    transition: transform .25s, box-shadow .25s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.card-category {
    padding: 12px 18px; color: white; font-size: 13px;
    font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 18px 18px 12px; flex: 1; }
.card-title { font-size: 17px; line-height: 1.4; margin-bottom: 8px; color: #222; }
.card-summary { font-size: 14px; color: #666; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { padding: 0 18px; font-size: 13px; color: #999; display: flex; gap: 16px; }
.card-meta i { margin-right: 4px; }
.card-tags { padding: 12px 18px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    background: #f0f4f8; color: #556; font-size: 12px;
}

/* No Articles */
.no-articles { text-align: center; padding: 80px 20px; color: #999; }
.no-articles i { margin-bottom: 20px; opacity: .4; }
.no-articles h3 { color: #666; margin-bottom: 10px; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 6px;
    background: white; color: #555; text-decoration: none;
    border: 1px solid #e0e0e0; font-size: 14px; transition: all .2s;
}
.page-btn:hover, .page-btn.active {
    background: var(--primary-color, #0056b3); color: white; border-color: transparent;
}

/* ===== Article Page ===== */
.article-header { padding: 60px 0 30px; background: linear-gradient(135deg, #001f3f 0%, var(--cat-color, #0056b3) 100%); color: white; }
.article-breadcrumb { font-size: 14px; margin-bottom: 20px; opacity: .8; }
.article-breadcrumb a { color: rgba(255,255,255,.8); text-decoration: none; }
.article-breadcrumb a:hover { color: white; }
.article-header h1 { font-size: 2.2rem; color: white; line-height: 1.3; margin-bottom: 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; margin-bottom: 12px; align-items: center; }
.meta-category { padding: 4px 12px; border-radius: 4px; color: white; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.article-tags .tag { background: rgba(255,255,255,.15); color: white; }

/* Article Layout */
.article-content-section { padding: 40px 0 60px; }
.article-layout { display: flex; gap: 40px; align-items: flex-start; }

/* Table of Contents */
.article-toc {
    position: sticky; top: 100px; width: 240px; min-width: 240px;
    background: #f8f9fa; border-radius: 8px; padding: 20px;
    font-size: 14px; order: -1;
}
.article-toc h4 { font-size: 15px; margin-bottom: 12px; color: #333; }
.article-toc ul { list-style: none; padding: 0; margin: 0; }
.article-toc li { margin-bottom: 8px; }
.article-toc a { color: #555; text-decoration: none; transition: color .2s; }
.article-toc a:hover { color: var(--primary-color, #0056b3); }
.toc-level-3 { padding-left: 16px; }

/* Article Body */
.article-body { flex: 1; min-width: 0; max-width: 800px; font-size: 16px; line-height: 1.8; color: #333; }
.article-body h2 { font-size: 1.6rem; margin-top: 40px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #e0e0e0; }
.article-body h3 { font-size: 1.3rem; margin-top: 30px; margin-bottom: 12px; }
.article-body p { margin-bottom: 16px; }
.article-body pre {
    background: #1e1e2e; color: #cdd6f4; padding: 20px; border-radius: 8px;
    overflow-x: auto; margin: 20px 0; font-size: 14px; line-height: 1.6;
}
.article-body code { font-family: 'Fira Code', 'Consolas', monospace; }
.article-body p > code {
    background: #f0f4f8; padding: 2px 6px; border-radius: 4px;
    font-size: 14px; color: #c7254e;
}
.article-body ul, .article-body ol { margin: 16px 0; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body img { max-width: 100%; border-radius: 8px; margin: 16px 0; }
.article-body blockquote {
    border-left: 4px solid var(--primary-color, #0056b3);
    padding: 12px 20px; margin: 20px 0; background: #f8f9fa;
    border-radius: 0 8px 8px 0; color: #555;
}

/* Related Articles */
.related-articles-section { padding: 40px 0; background: #f8f9fa; }
.related-articles-section h2 { text-align: center; margin-bottom: 30px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.related-card {
    display: block; padding: 20px; background: white; border-radius: 8px;
    text-decoration: none; color: inherit; transition: transform .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.related-card:hover { transform: translateY(-2px); }
.related-card h4 { font-size: 15px; color: #333; margin: 8px 0; }
.rel-cat { font-size: 13px; font-weight: 600; }
.rel-date { font-size: 13px; color: #999; }

/* Back to Blog */
.back-to-blog { padding: 30px 0 50px; text-align: center; }
.btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; background: #f0f0f0; color: #333;
    border-radius: 6px; text-decoration: none; font-weight: 500;
    transition: background .2s;
}
.btn-secondary:hover { background: #e0e0e0; }

/* ===== Chatbot Widget ===== */
.chatbot-toggle {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary-color, #0056b3); color: white;
    border: none; cursor: pointer; font-size: 24px;
    box-shadow: 0 4px 16px rgba(0,86,179,.4);
    transition: transform .2s; display: flex; align-items: center; justify-content: center;
}
.chatbot-toggle:hover { transform: scale(1.1); }
.chatbot-window {
    position: fixed; bottom: 90px; right: 24px; z-index: 9998;
    width: 370px; max-height: 520px; border-radius: 16px;
    background: white; box-shadow: 0 8px 40px rgba(0,0,0,.15);
    display: none; flex-direction: column; overflow: hidden;
}
.chatbot-window.open { display: flex; }
.chatbot-header {
    padding: 16px 20px; background: var(--primary-color, #0056b3);
    color: white; display: flex; align-items: center; gap: 10px;
}
.chatbot-header h4 { margin: 0; font-size: 15px; flex: 1; }
.chatbot-close { background: none; border: none; color: white; font-size: 18px; cursor: pointer; }
.chatbot-messages {
    flex: 1; padding: 16px; overflow-y: auto; min-height: 280px;
    display: flex; flex-direction: column; gap: 12px;
}
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.chat-msg.bot { background: #f0f4f8; color: #333; align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.user { background: var(--primary-color, #0056b3); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.chatbot-quick { padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid #f0f0f0; }
.quick-btn {
    padding: 6px 12px; border-radius: 16px; border: 1px solid #ddd;
    background: white; color: #555; font-size: 12px; cursor: pointer;
    transition: all .2s;
}
.quick-btn:hover { background: var(--primary-color, #0056b3); color: white; border-color: transparent; }
.chatbot-input {
    display: flex; padding: 12px; border-top: 1px solid #f0f0f0; gap: 8px;
}
.chatbot-input input {
    flex: 1; padding: 10px 14px; border: 1px solid #e0e0e0;
    border-radius: 20px; font-size: 14px; outline: none;
}
.chatbot-input input:focus { border-color: var(--primary-color, #0056b3); }
.chatbot-input button {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary-color, #0056b3); color: white;
    border: none; cursor: pointer; font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .article-layout { flex-direction: column; }
    .article-toc { width: 100%; position: static; order: 0; }
    .article-header h1 { font-size: 1.6rem; }
    .chatbot-window { width: calc(100% - 32px); right: 16px; bottom: 84px; }
}