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

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.mt-4 {
    margin-top: 0rem !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: #ffffff;
    color: #333333;
    margin: 0 !important;
    padding: 0 !important;
}

.main-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    max-width: 100%;
}

/* Left Sidebar - Treeview */
.sidebar {
    width: 350px;
    background: #f8f9fa;
    color: #333333;
    overflow-y: auto;
    border-right: 1px solid #dee2e6;
    transition: width 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
    padding: 0;
    border: none;
}

.doc-header.fixed-top {
    z-index: 1015;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.sidebar-header {
    padding: 15px;
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
}

.search-box {
    margin-top: 15px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 35px 10px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    font-size: 14px;
}

.search-box input::placeholder {
    color: #6c757d;
}

.search-box input:focus {
    outline: none;
    border-color: #007bff;
    background: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.treeview {
    padding: 10px 0;
}

.treeview-item {
    padding: 10px 10px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
    user-select: none;
}

.treeview-item:hover {
    background: #e9ecef;
    border-left-color: #007bff;
}

.treeview-item.active {
    background: #e7f3ff;
    border-left-color: #007bff;
    color: #0056b3;
    font-weight: bold;
}

.treeview-item-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.treeview-item-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #6c757d;
    cursor: pointer;
    flex-shrink: 0;
}

.treeview-item-icon:hover {
    color: #333333;
}

.treeview-item-icon.expanded::before {
    content: '▼';
}

.treeview-item-icon.collapsed::before {
    content: '▶';
}

.treeview-item-icon.leaf {
    width: 16px;
}

.treeview-item .item-name {
    font-size: 14px;
    display: flex;
    align-items: center;
    flex: 1;
    color: #333333;
    pointer-events: none;
    /* Let click bubble to treeview-item */
}

.treeview-item.active .item-name {
    color: #0056b3;
    font-weight: bold;
}

/* Lazy Load & End of List */
.lazy-load-indicator {
    padding: 15px;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid #eee;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.end-of-list-message {
    padding: 20px;
    text-align: center;
    color: #adb5bd;
    font-size: 12px;
    font-style: italic;
    border-top: 1px solid #f8f9fa;
}

.treeview-item .item-module {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
    margin-left: 22px;
}

.treeview-item.active .item-module {
    color: #0056b3;
}

.treeview-children {
    display: none;
    margin-left: 15px;
}

.treeview-children.expanded {
    display: block;
}

.treeview-item[data-level="0"] {
    padding-left: 10px;
}

.treeview-item[data-level="1"] {
    padding-left: 15px;
}

.treeview-item[data-level="2"] {
    padding-left: 15px;
}

.treeview-item[data-level="3"] {
    padding-left: 15px;
}

.treeview-item[data-level="4"] {
    padding-left: 15px;
}

.treeview-group {
    margin-top: 15px;
}

.treeview-group-header {
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.empty-state {
    padding: 40px 15px;
    text-align: center;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Right Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    width: 100%;
    min-width: 0;
}

.content-header {
    padding: 75px 15px 15px 15px;
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
}

.content-header h1 {
    font-size: 24px;
    color: #333333;
    margin: 0;
    font-weight: 500;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    background: #ffffff;
    margin: 0;
    border-radius: 0;
    color: #333333;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.content-body>* {
    max-width: 100% !important;
    box-sizing: border-box;
}

.content-body .container,
.content-body [class*="container"],
.content-body [class*="Container"],
.content-body [style*="max-width"],
.content-body [style*="width: 1160"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* Ensure all divs and sections are full width */
.content-body div,
.content-body section,
.content-body article {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Force override any body or container styles from loaded HTML */
.content-body body,
.content-body .container,
.content-body [class*="container"] {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.content-body html {
    padding: 0 !important;
    margin: 0 !important;
}

/* Override any inline or computed styles */
.content-body * {
    max-width: 100% !important;
}

/* Style for loaded HTML content - Light Theme */
.content-body body,
.content-body html {
    background: #ffffff !important;
    color: #333333 !important;
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
    color: #333333 !important;
}

.content-body p,
.content-body li,
.content-body span,
.content-body div {
    color: #333333 !important;
}

.content-body code {
    background: #f8f9fa !important;
    color: #e83e8c !important;
    border: 1px solid #dee2e6 !important;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.content-body pre {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
}

.content-body pre code {
    background: transparent !important;
    border: none !important;
    padding: 0;
    color: #333333 !important;
}

.content-body table {
    border-color: #dee2e6 !important;
}

.content-body th,
.content-body td {
    border-color: #dee2e6 !important;
    color: #333333 !important;
}

.content-body a {
    color: rgb(0, 86, 179) !important;
}

.content-body a:hover {
    color: rgb(0, 86, 179) !important;
    text-decoration: underline !important;
}

.content-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    text-align: center;
}

.content-placeholder-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.spinner {
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Scrollbar styling - Light Theme */
.sidebar::-webkit-scrollbar,
.content-body::-webkit-scrollbar,
.right-sidebar::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-track,
.content-body::-webkit-scrollbar-track,
.right-sidebar::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 5px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.content-body::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 5px;
}

.content-body::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Documentation Content Styles - Light Theme */
.content-body .container {
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 1150px;
    margin: 0 auto;
}

.content-body h1 {
    color: #333333;
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.content-body h2 {
    color: #0056b3;
    margin-top: 40px;
    margin-bottom: 15px;
    border-left: 5px solid #007bff;
    padding-left: 15px;
    font-size: 1.6em;
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    padding-top: 5px;
    padding-bottom: 5px;
}

.content-body h3 {
    color: #343a40;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* Table of Contents */
.content-body .toc {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    border-radius: 8px;
    display: inline-block;
    min-width: 150px;
}

.content-body .toc-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-body .toc-title::before {
    content: '📋';
}

.content-body .toc ul {
    list-style: none;
    padding-left: 0;
}

.content-body .toc li {
    margin: 8px 0;
}

.content-body .toc a {
    text-decoration: none;
    color: #0056b3 !important;
    font-size: 14px;
}

.content-body .toc a:hover {
    text-decoration: underline !important;
}

.content-body .step {
    background: #f0f7ff;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid #007bff;
    border-radius: 0 8px 8px 0;
    position: relative;
}

.content-body .step::before {
    content: '🚀';
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 1.5em;
    opacity: 0.2;
}

.content-body .note {
    background: #fff9db;
    border: 1px solid #ffe066;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    color: #664d03;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.content-body .note::before {
    content: '💡';
    margin-right: 10px;
    font-size: 1.2em;
}

.content-body .function-section {
    margin: 40px 0;
    padding: 25px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.content-body p {
    margin: 15px 0;
    line-height: 1.8;
    font-size: 15px;
}

/* Table Styling Improvements */
.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 15px;
    background: #ffffff;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.content-body th {
    background-color: #f1f3f5;
    color: #212529;
    font-weight: 600;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid #dee2e6 !important;
    border-right: 1px solid #dee2e6 !important;
}

.content-body td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee !important;
    border-right: 1px solid #eee !important;
    vertical-align: middle;
    line-height: 1.6;
}

.content-body tr:nth-child(even) {
    background-color: #fcfcfc;
}

.content-body tr:hover {
    background-color: #f8f9fa;
}

/* Image Styling Improvements */
.content-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 15px auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease;
}

.content-body img:hover {
    transform: scale(1.01);
}

/* Prevent small images (like toolbars/icons) from stretching */
.content-body img[src*="toolbar"],
.content-body img[src*="icon"],
.content-body img[src*="context_menu"],
.content-body img[src*="search"],
.content-body img[src*="filter"] {
    max-width: 90%;
    width: auto !important;
    /* Don't stretch small images */
    margin: 15px auto;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.content-body img[alt*="icon"],
.content-body img[alt*="biểu tượng"],
.content-body img[class*="inline-icon"] {
    display: inline-block;
    vertical-align: middle;
    margin: 0 5px;
    box-shadow: none;
    border: none;
    height: 1.2em;
    width: auto !important;
}

/* --- Figure & Caption Styling --- */
.content-body figure {
    margin: 15px 0;
    text-align: center;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.content-body figure img {
    margin: 0 auto 15px auto;
    /* Override default img margin */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.content-body figcaption {
    color: #666;
    font-style: italic;
    font-size: 14px;
    margin-top: 10px;
    font-weight: 500;
}

/* Right Sidebar - AI Chatbot */
.right-sidebar {
    width: 350px;
    background: #ffffff;
    border-left: 1px solid #dee2e6;
    display: flex !important;
    flex-direction: column;
    height: calc(100vh - 60px);
    transition: width 0.3s ease;
    position: sticky;
    top: 60px;
    z-index: 10;
    flex-shrink: 0;
}

.right-sidebar.collapsed {
    width: 50px;
}

.right-sidebar.collapsed .chatbot-sidebar-content {
    display: none;
}

.right-sidebar.collapsed .chatbot-sidebar-header h3 {
    display: none;
}

.right-sidebar.collapsed .chatbot-toggle-btn .toggle-icon {
    transform: rotate(180deg);
}

.chatbot-sidebar-header {
    padding: 15px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
}

.chatbot-toggle-btn {
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s;
}

.chatbot-toggle-btn:hover {
    background: #e9ecef;
    color: #333333;
}

.chatbot-toggle-btn .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 12px;
}

.chatbot-sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-welcome {
    padding: 15px 15px;
    text-align: center;
    color: #6c757d;
}

.chatbot-welcome-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.chatbot-welcome h4 {
    color: #333333;
    margin-bottom: 15px;
    font-size: 18px;
}

.chatbot-welcome p {
    color: #6c757d;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
}

.chatbot-welcome ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 15px;
    color: #495057;
}

.chatbot-welcome li {
    margin: 8px 0;
    font-size: 14px;
}

.chatbot-note {
    margin-top: 15px !important;
    padding: 10px;
    background: #e7f3ff;
    border-left: 3px solid #007bff;
    border-radius: 4px;
    color: #0056b3 !important;
    font-size: 13px !important;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-message {
    padding: 12px 15px;
    border-radius: 8px;
    max-width: 85%;
    word-wrap: break-word;
}

.chatbot-message.user {
    align-self: flex-end;
    background: #007bff;
    color: #ffffff;
}

.chatbot-message.assistant {
    align-self: flex-start;
    background: #f8f9fa;
    color: #333333;
    border: 1px solid #dee2e6;
}

.chatbot-input-area {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

.chatbot-input-area textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    margin-bottom: 10px;
    background: #ffffff;
    color: #333333;
}

.chatbot-input-area textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.chatbot-send-btn {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.chatbot-send-btn:hover {
    background: #0056b3;
}

.chatbot-send-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* --- Image Zoom Modal --- */
.image-zoom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-zoom-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-zoom-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.image-zoom-close:hover {
    color: #bbb;
    transform: scale(1.1);
}

.image-zoom-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    font-size: 18px;
}

/* --- Copy Code Button --- */
.code-container {
    position: relative;
    margin: 15px 0;
}

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.code-container:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.copy-code-btn.copied {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

/* --- Article Content Enhancements --- */
.content-body img {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.content-body img:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* --- Table Column Width Fix --- */
/* --- Table Column Width Fix --- */
.content-body table {
    table-layout: fixed;
    /* Bắt buộc tuân thủ width */
    width: 100%;
}

.content-body table th:first-child,
.content-body table td:first-child {
    width: 25%;
    /* Cột 1 chiếm 25% */
    min-width: 115px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.content-body table th:nth-child(2),
.content-body table td:nth-child(2) {
    width: 75%;
    /* Cột 2 chiếm 75% */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* --- Related Articles Styling --- */
h2#bai-viet-lien-quan+ul,
h2#bai-viet-lien-quan+div>ul,
h2#bai-viet-lien-quan+p+ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

h2#bai-viet-lien-quan+ul li,
h2#bai-viet-lien-quan+div>ul li,
h2#bai-viet-lien-quan+p+ul li {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

h2#bai-viet-lien-quan+ul li:hover,
h2#bai-viet-lien-quan+div>ul li:hover,
h2#bai-viet-lien-quan+p+ul li:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #2196F3;
}

h2#bai-viet-lien-quan+ul li a,
h2#bai-viet-lien-quan+div>ul li a,
h2#bai-viet-lien-quan+p+ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    display: block;
    width: 100%;
}

h2#bai-viet-lien-quan+ul li a::before,
h2#bai-viet-lien-quan+div>ul li a::before,
h2#bai-viet-lien-quan+p+ul li a::before {
    content: "📄";
    margin-right: 10px;
    font-size: 1.2em;
}

.active-toc {
    color: #3498db !important;
    font-weight: bold;
    border-left: 2px solid #3498db;
    padding-left: 5px;
}

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #6c757d;
}

.breadcrumb-item {
    cursor: pointer;
}

.breadcrumb-item:hover {
    color: #007bff;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #dee2e6;
}

/* --- Article Navigation (Prev/Next) --- */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    gap: 15px;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    max-width: 45%;
}

.nav-btn:hover {
    border-color: #007bff;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nav-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-title {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-btn.prev {
    text-align: left;
}

.nav-btn.next {
    text-align: right;
}

/* --- AI Chatbot Enhancements --- */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.message.user {
    align-self: flex-end;
    background: #007bff;
    color: white;
    border-bottom-right-radius: 2px;
}

.message.bot {
    align-self: flex-start;
    background: #f1f3f5;
    color: #333;
    border-bottom-left-radius: 2px;
}

.chatbot-input-area {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    background: #fff;
}

.chatbot-input-area textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
}

.chatbot-send-btn {
    width: 100%;
    padding: 8px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.chatbot-send-btn:hover {
    background: #0056b3;
}

.chatbot-loading {
    display: flex;
    gap: 5px;
    padding: 10px;
}

.dot {
    width: 8px;
    height: 8px;
    background: #adb5bd;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

/* Responsive adjustments */
@media (max-width: 1150px) {
    .right-sidebar {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }

    .right-sidebar {
        width: 280px;
    }
}

/* ========== FAQ Styles ========== */

.faq-question-list h3 {
    color: #333;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.faq-question-list .list-group-item {
    padding: 15px 15px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
    font-size: 15px;
}

.faq-question-list .list-group-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.faq-question-list .list-group-item span {
    flex: 1;
    color: #333;
}

.faq-detail-view .card {
    border-radius: 12px;
    overflow: hidden;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.faq-detail-view .card-header {
    padding: 15px 25px;
    background: #2c3e50;
    color: #fff;
}

.faq-detail-view .card-header h5 {
    font-size: 1.1rem;
    font-weight: 600;
}

.faq-detail-view .card-body {
    padding: 25px;
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

.faq-detail-view .card-body ol,
.faq-detail-view .card-body ul {
    margin-left: 15px;
    margin-bottom: 15px;
}

.faq-detail-view .card-body li {
    margin-bottom: 8px;
}

.faq-detail-view .card-body strong {
    color: #007bff;
}

.faq-detail-view .card-footer {
    background: #f8f9fa;
    padding: 15px 25px;
    font-size: 13px;
}

.faq-detail-view .card-footer a {
    word-break: break-all;
    color: #007bff;
}

.faq-detail-view .btn-outline-secondary {
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.faq-detail-view .btn-outline-secondary:hover {
    background: #6c757d;
    color: #fff;
    transform: translateX(-3px);
}

/* ========== Improved Search Styles ========== */
.search-box {
    margin-top: 15px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    background: #fff;
    color: #333;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input::placeholder {
    color: #adb5bd;
}

.search-box input:focus {
    outline: none;
    border-color: #007bff;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.6;
    pointer-events: none;
}

/* ========== Empty State Improvements ========== */
.empty-state {
    text-align: center;
    padding: 40px 15px;
    color: #6c757d;
}

.empty-state div:first-child {
    font-size: 15px;
    margin-bottom: 15px;
}

/* ========== Treeview Item Improvements ========== */
.treeview-item.active {
    background: linear-gradient(135deg, #e7f1ff, #f0f7ff);
    border-left: 3px solid #007bff;
}

.treeview-item:hover:not(.active) {
    background: #f8f9fa;
}

.item-name {
    font-weight: 500;
    color: #333;
}

.treeview-item.active .item-name {
    color: #0056b3;
    font-weight: 600;
}

/* ========== Lazy Load / Infinite Scroll Styles ========== */
.lazy-load-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    color: #6c757d;
    font-size: 13px;
    gap: 10px;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 15px;
    color: #6c757d;
    gap: 15px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading status at bottom of treeview */
.treeview-status {
    padding: 10px 15px;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* ========== Mobile Responsive Styles ========== */

/* Tablets and smaller */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }

    .right-sidebar {
        width: 280px;
    }

    .content-header h1 {
        font-size: 20px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {

    /* Hide sidebars on mobile by default */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 60px;
        height: calc(100vh - 60px);
        width: 85%;
        max-width: 320px;
        z-index: 1030;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.show-mobile {
        left: 0;
    }

    /* Chatbot hidden by default on mobile, slides from right */
    .right-sidebar {
        position: fixed;
        right: -100%;
        top: 60px;
        height: calc(100vh - 60px);
        width: 90%;
        max-width: 350px;
        z-index: 1035;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        display: flex !important;
    }

    .right-sidebar.show-mobile {
        right: 0;
    }

    /* Floating chatbot button on mobile */
    .chatbot-floating-btn {
        display: flex;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        color: white;
        border: none;
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
        cursor: pointer;
        z-index: 1030;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        transition: all 0.3s ease;
    }

    .chatbot-floating-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.5);
    }

    .chatbot-floating-btn.active {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    }

    /* Full-width content area */
    .content-area {
        width: 100% !important;
        padding-top: 60px;
    }

    .content-header {
        padding: 12px 15px;
    }

    .content-header h1 {
        font-size: 18px;
        line-height: 1.3;
    }

    .content-body {
        padding: 12px;
    }

    /* Adjust breadcrumb for mobile */
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 12px;
    }

    /* Mobile navigation buttons */
    .article-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .nav-btn {
        max-width: 100%;
        width: 100%;
    }

    .nav-btn.prev,
    .nav-btn.next {
        text-align: left;
    }

    /* FAQ Question List Mobile */
    .faq-question-list {
        padding: 10px;
    }

    .faq-question-list h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .faq-question-list .list-group-item {
        padding: 12px;
        font-size: 14px;
    }

    .faq-question-list .list-group-item:hover {
        transform: none;
    }

    /* FAQ Detail View Mobile */
    .faq-detail-view {
        padding: 10px;
    }

    .faq-detail-view .card-header {
        padding: 12px 15px;
    }

    .faq-detail-view .card-header h5 {
        font-size: 1rem;
        line-height: 1.4;
    }

    .faq-detail-view .card-body {
        padding: 15px;
        font-size: 14px;
        line-height: 1.6;
    }

    .faq-detail-view .card-footer {
        padding: 12px 15px;
    }

    .faq-detail-view .btn-outline-secondary {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* Related Questions Section Mobile */
    .related-questions-section {
        margin-top: 20px;
        padding: 15px;
    }

    .related-questions-section h4 {
        font-size: 1rem;
    }

    .related-question-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Table responsive */
    .content-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 13px;
    }

    .content-body th,
    .content-body td {
        padding: 10px 12px;
    }

    /* Images responsive */
    .content-body img {
        margin: 10px auto;
    }

    /* TOC mobile */
    .content-body .toc {
        display: block;
        width: 100%;
        margin: 10px 0 20px 0;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .content-header h1 {
        font-size: 16px;
    }

    .content-body {
        padding: 10px;
    }

    .faq-question-list .list-group-item {
        padding: 10px;
        font-size: 13px;
    }

    .faq-detail-view .card-body {
        padding: 12px;
        font-size: 13px;
    }

    .nav-title {
        font-size: 13px;
    }

    .nav-label {
        font-size: 11px;
    }
}

/* ========== Related Questions Section Styles ========== */
.related-questions-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.related-questions-section h4 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-questions-section h4::before {
    content: "🔗";
    font-size: 1.2em;
}

.related-questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-question-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
}

.related-question-item:hover {
    background: #e7f3ff;
    border-color: #007bff;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.related-question-item::before {
    content: "❓";
    margin-right: 10px;
    font-size: 1.1em;
}

.related-question-item span {
    flex: 1;
}

.related-question-item::after {
    content: "→";
    color: #007bff;
    font-weight: bold;
    margin-left: 10px;
}

/* Mobile overlay for sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1025;
}

/* Chatbot overlay for mobile */
.chatbot-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1032;
}

@media (max-width: 768px) {

    .sidebar-overlay.show,
    .sidebar-overlay.show,
    .chatbot-overlay.show {
        display: block;
    }
}

/* Hide floating button on desktop only */
@media (min-width: 769px) {
    .chatbot-floating-btn {
        display: none !important;
    }
}

/* Image Zoom Modal Improvements */
.image-zoom-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-zoom-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-zoom-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    font-size: 14px;
}

.image-zoom-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.image-zoom-close:hover {
    color: #bbb;
}

@media (max-width: 768px) {
    .image-zoom-content {
        width: 95%;
    }

    .image-zoom-close {
        top: 10px;
        right: 20px;
    }
}