/* File: esb_guide/css/style.css */

/*--------------------------------------------------------------
# General Body & Typography
--------------------------------------------------------------*/
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f6; /* Màu nền nhẹ nhàng cho toàn trang */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    color: #2c3e50; /* Màu đậm hơn cho tiêu đề */
}

a {
    color: #007bff;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: none; /* Bỏ gạch chân mặc định khi hover, trừ khi cần thiết */
}

.container {
    max-width: 1140px; /* Giới hạn độ rộng container cho dễ đọc */
}

/*--------------------------------------------------------------
# Page Header (Phần tiêu đề đầu trang public)
--------------------------------------------------------------*/
.page-header {
    background: linear-gradient(45deg, #007bff, #0056b3); /* Gradient nền */
    color: white;
    padding: 3rem 1.5rem;
    margin-bottom: 2.5rem;
    text-align: center;
    border-bottom: 5px solid #004085;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-header h1 {
    margin-bottom: 0.75rem;
    font-weight: 300; /* Font nhẹ hơn cho tiêu đề chính */
    font-size: 2.8rem;
    color: white;
}

.page-header .lead {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/*--------------------------------------------------------------
# Guide Tree (#guideTreeContainer)
--------------------------------------------------------------*/
#guideTreeContainer .card-header {
    background-color: #fff; /* Nền trắng cho header card */
    border-bottom: 1px solid #e9ecef;
}
#guideTreeContainer .card-header h5 {
    color: #007bff; /* Màu tiêu đề cho card */
}

.guide-tree {
    padding-left: 0; /* Bỏ padding mặc định của ul */
}

.guide-tree .category-item {
    margin-bottom: 0.25rem; /* Khoảng cách nhỏ giữa các mục danh mục */
}

.guide-tree .category-name-wrapper {
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
    display: flex;
    align-items: center;
}

.guide-tree .category-name-wrapper:hover {
    background-color: #e9ecef;
}

.guide-tree .category-name-wrapper.expanded {
    /* background-color: #e0e0e0; */ /* Tùy chọn: đổi màu nền khi mở */
}

.guide-tree .category-name {
    font-weight: 500; /* Đậm hơn một chút cho tên danh mục */
    color: #2c3e50;
}
.guide-tree .category-name-wrapper:hover .category-name {
    color: #0056b3;
}


.guide-tree .toggle-icon {
    transition: transform 0.2s ease-in-out;
    font-size: 0.8em;
    color: #6c757d; /* Màu cho icon toggle */
    width: 16px; /* Đảm bảo icon chiếm không gian nhất định */
    text-align: center;
}

.guide-tree .category-name-wrapper.expanded .toggle-icon {
    transform: rotate(90deg);
}

.guide-tree .nested-list {
    padding-left: 20px; /* Thụt đầu dòng cho các mục con */
    margin-left: 8px; /* Căn chỉnh với icon */
    border-left: 1px dashed #ced4da; /* Đường kẻ phân cấp */
    overflow: hidden; /* Đảm bảo slideToggle hoạt động mượt */
}

.guide-tree .article-item a {
    display: block;
    padding: 6px 10px;
    color: #495057; /* Màu cho link bài viết */
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.95rem;
}

.guide-tree .article-item a .fa-fw {
    color: #007bff; /* Màu cho icon file */
    opacity: 0.7;
}

.guide-tree .article-item a:hover {
    background-color: #e7f3ff; /* Nền xanh nhạt khi hover */
    color: #0056b3; /* Chữ xanh đậm khi hover */
}

.guide-tree .article-item a.active {
    background-color: #007bff; /* Nền xanh cho link active */
    color: white; /* Chữ trắng cho link active */
    font-weight: 500;
}
.guide-tree .article-item a.active .fa-fw {
    color: white;
    opacity: 1;
}


/*--------------------------------------------------------------
# Article Display Area (#articleDisplayContainer)
--------------------------------------------------------------*/
#articleDisplayContainer {
    min-height: 450px; /* Chiều cao tối thiểu để giữ layout */
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Bóng đổ nhẹ nhàng */
    padding: 20px 25px; /* Padding bên trong */
}

#articleDisplayContainer h2 {
    font-size: 1.8rem; /* Kích thước tiêu đề bài viết */
    color: #343a40;
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #007bff; /* Đường kẻ dưới tiêu đề */
}

.article-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}
.article-meta span {
    margin-right: 15px;
}
.article-meta i {
    margin-right: 5px;
}

.article-content {
    font-size: 1rem; /* Kích thước font cho nội dung dễ đọc */
    color: #34495e;
}

.article-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.article-content pre {
    background-color: #2d2d2d; /* Nền tối cho code block */
    color: #f8f8f2; /* Chữ sáng cho code block */
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto; /* Cho phép cuộn ngang nếu code dài */
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    border: 1px solid #444;
}
.article-content code { /* Cho inline code */
    background-color: #eef;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #d63384; /* Màu hồng cho inline code */
}
.article-content pre code { /* Reset cho code bên trong pre */
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

.article-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 15px;
    margin: 1.5em 0;
    color: #555;
    font-style: italic;
}

.article-content ul, .article-content ol {
    padding-left: 20px;
    margin-bottom: 1rem;
}

.article-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%; /* Đảm bảo chiếm toàn bộ chiều cao của container */
    min-height: 300px; /* Chiều cao tối thiểu cho placeholder */
    color: #adb5bd; /* Màu xám nhạt cho placeholder */
    text-align: center;
}

.article-placeholder i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: #ced4da;
}

.loading-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}
.loading-spinner-container .spinner-border {
    width: 3rem;
    height: 3rem;
}
.loading-spinner-container p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/*--------------------------------------------------------------
# Footer (Phần chân trang public)
--------------------------------------------------------------*/
footer.border-top {
    border-top: 1px solid #dee2e6 !important;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    background-color: #ffffff; /* Nền trắng cho footer */
    color: #6c757d;
}

/*--------------------------------------------------------------
# Responsive Adjustments
--------------------------------------------------------------*/
@media (max-width: 991.98px) { /* Cho tablet và nhỏ hơn */
    .page-header h1 {
        font-size: 2.2rem;
    }
    .page-header .lead {
        font-size: 1.1rem;
    }
    #articleDisplayContainer h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 767.98px) { /* Cho mobile */
    .page-header {
        padding: 2rem 1rem;
    }
    .page-header h1 {
        font-size: 1.8rem;
    }
    .page-header .lead {
        font-size: 1rem;
    }

    #guideTreeContainer .card-body {
        max-height: 300px; /* Giới hạn chiều cao cây trên mobile, cho phép cuộn */
        overflow-y: auto;
    }

    #articleDisplayContainer {
        padding: 15px;
    }
    #articleDisplayContainer h2 {
        font-size: 1.4rem;
    }
    .article-content {
        font-size: 0.95rem;
    }
}