/**
 * NukeViet Content Management System
 * Optimized, Cleaned & Fixed CSS for GiangVien.Net
 * Integration: Fixed Book Showcase Layout (No-Image Version)
 */

/* ==========================================================================
   1. CẤU TRÚC CHUNG (LAYOUT & BODY) & COMMON STYLES
   ========================================================================== */
body.enable-animate {
    background-color: #0084ff !important;
    padding-top: 60px !important;
}

.section-body .wraper {
    background-color: #ffffff !important;
    padding: 2px;
    box-sizing: border-box;
    box-shadow: 0 0 2px rgba(0,0,0,0.1);
}

/* Gom nhóm các thành phần cần căn đều văn bản */
.panel-body p, 
.panel-body h3, 
.show, 
h1.title.margin-bottom-lg, 
.hometext.m-bottom, 
.SimilarArticleControl a, 
.SimilarArticleControl a .ArticleTitle, 
.tooltip-inner, 
.tooltip-inner .book-title-red, 
.tooltip-inner > div:first-child, 
.tooltip-inner span, 
.tooltip-inner p {
    text-align: justify;
}

.show {
    display: block;
}

/* ==========================================================================
   2. HEADER & TOP BAR & LOGO
   ========================================================================== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 26px !important;
    z-index: 99;
    color: #222;
    background-color: #ffffff !important;
    text-align: center;
    vertical-align: baseline;
    margin: 0;
    padding-bottom: 0 !important;
}

header.top-bar .main-bar {
    background-color: #ffffff !important;
    margin-bottom: 0;
}

/* Thanh line hỗ trợ/tiện ích */
.line-1 {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background-color: #f8faff;
    border-bottom: 2px solid #3498db;
    margin-top: 0;
    margin-bottom: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.line-1 a {
    display: inline-flex;
    align-items: center;
    color: #2c3e50 !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.line-1 a span, 
.line-1 a i {
    font-size: 20px;
    margin-right: 10px;
    line-height: 1;
}

.line-1 a:hover {
    color: #3498db !important;
    transform: translateY(-1px);
}

.logo {
    text-align: center;
}

.site-logo {
    max-height: 120px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.site-description {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

/* ==========================================================================
   3. TÌM KIẾM (SEARCH BAR & RESULTS)
   ========================================================================== */
.headerSearch {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.headerSearch .input-group,
.headerSearch .form-control,
.headerSearch .btn {
    border-radius: 0 !important;
}

.headerSearch .input-group {
    display: flex;
    width: 100%;
}

.headerSearch .form-control {
    flex: 1;
    border: 1px solid #ccc;
    padding: 20px;
    font-size: 16px;
}

.headerSearch .btn {
    border: none;
    background-color: #007bff;
    color: white;
    padding: 0 30px;
    font-size: 18px;
    transition: background-color 0.3s;
}

.headerSearch .btn:hover {
    background-color: #0056b3;
}

/* Kết quả tìm kiếm & Bộ đếm số thứ tự */
div.col-sm-18.col-md-19 { 
    counter-reset: search-counter !important; 
}

#search_result {
    counter-reset: search-counter;
}

div.col-sm-18.col-md-19 h9,
#search_result h9 {
    position: relative !important;
    margin-bottom: 5px !important;
    background: transparent !important;
    border: none !important;
    display: block !important;
    font-size: 13px !important;
    line-height: 1.0 !important;
}

div.col-sm-18.col-md-19 h9 {
    padding: 8px 0 8px 45px !important;
}

#search_result h9 {
    padding-left: 30px !important;
}

#search_result h9::before {
    counter-increment: search-counter !important;
    content: counter(search-counter) !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    background: #1a3f5e !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: bold !important;
    z-index: 1;
}

div.col-sm-18.col-md-19 h9 a {
    color: #1a3f5e !important;
    text-decoration: none !important;
}

div.col-sm-18.col-md-19 h9 a:hover {
    text-decoration: underline !important;
    color: #d9534f !important;
}

span.keyword {
    color: #d9534f !important;
    font-weight: bold !important;
    background: transparent !important;
}

/* ==========================================================================
   4. KHỐI NỘI DUNG CHI TIẾT (ARTICLE CONTENT) & CHUYÊN MỤC
   ========================================================================== */
h1.title.margin-bottom-lg {
    color: #0d47a1 !important;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
    letter-spacing: -0.5px !important;
    margin-bottom: 20px !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15) !important;
    border-left: none !important;
    padding-left: 0 !important;
}

.hometext.m-bottom {
    font-size: 18px !important;
    line-height: 1.6 !important;
    color: #444 !important;
    font-style: italic;
    border-left: 4px solid #ff0000;
    padding-left: 15px;
    margin: 20px 0 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
}

span.h5 {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-size: 15px !important;
    color: #007bff !important;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-decoration: none;
}

span.h5::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23007bff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3C/svg%3E") no-repeat center / contain;
}

span.h5 strong {
    color: #0056b3 !important;
    font-weight: 700;
    margin-left: 4px;
}

/* Khối bài viết liên quan (Similar Article) */
.SimilarArticleControl {
    margin: 0 0 20px 0;
    padding: var(--padding-box);
    border-radius: var(--rounded);
    background: var(--color-white, #ffffff);
    border: 1px solid #f1f1f1 !important;
    box-shadow: var(--box-shadow);
}

.SimilarArticleControl .ModuleTitle {
    white-space: nowrap;
    font-size: 18px;
    display: inline-flex;
    margin: 0 auto 15px auto;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #ce1126;
    text-transform: uppercase;
    width: 100%;
    height: 45px;
    position: relative;
    padding: 0 10px 10px 0;
    text-align: left;
    border-bottom: 1px solid #EEEEEE;
    letter-spacing: -1px;
}

.SimilarArticleControl .ModuleTitle:before {
    content: '';
    width: 80px;
    height: 1px;
    background: #ce1126;
    position: absolute;
    left: 0;
    bottom: 0;
}

.SimilarArticleControl a {
    color: #212529;
    text-decoration: none;
    font-size: 12px;
    position: relative;
    font-weight: normal;
}

.SimilarArticleControl li.ListItem a:before {
    content: "\25A0";
    color: var(--bs-gray-400);
    margin-right: 7px;
    font-size: 12px;
    position: absolute;
    left: 0;
    top: 0;
}

.SimilarArticleControl a img {
    display: none;
}

.SimilarArticleControl ul.ArticleList {
    list-style: none;
    padding: 0;
    width: 100% !important;
}

.SimilarArticleControl h3 {
    display: inline; 
    margin: 0;
    font-weight: normal;
}

.SimilarArticleControl a .ArticleTitle {
    text-decoration: none;
    padding: 0 0 0 25px;
    font-style: normal;
    font-size: 16px;
    color: #031739;
    display: inline;
    font-family: 'Roboto', sans-serif;
    position: relative;
    font-weight: normal;
}

.SimilarArticleControl .ItemClear {
    list-style: none;
}

.SimilarArticleControl li.ListItem {
    position: relative;
    clear: both;
    margin: 0;
    padding: 10px 10px 10px 0;
    display: block;
}

.ArticlePostDate {
    display: inline-block;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: #495059;
    margin: 0 0 0 10px;
    padding-left: 0;
    position: relative;
    vertical-align: middle;
}

.ArticlePostDate::before {
    content: ""; 
    display: inline-block;
    width: 12px;
    height: 12px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="%23495059" d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"/></svg>') no-repeat center / contain;
    vertical-align: middle;
    margin-right: 5px;
}

h3.detail-title a::before {
    font-family: "FontAwesome" !important;
    content: "\f105" !important;
    font-weight: normal !important;
    margin-right: 5px;
    display: inline-block;
}

.article-group {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.article-group h2.ModuleTitle {
    padding-bottom: 5px;
    margin-bottom: 5px;
}

/* Khối Tiêu đề Chuyên mục Tùy biến (Custom Header) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap');

.custom-header-container {
    padding: 5px 0 !important;
    margin-bottom: 1px;
}

.custom-title {
    margin: 0 !important;
    padding-bottom: 2px !important;
    display: inline-block !important;
    position: relative !important;
    font-size: 15px !important;
}

.custom-title::before {
    display: none !important;
    content: none !important;
}

.custom-title::after {
    content: "" !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 150% !important;
    height: 2px !important;
    background: linear-gradient(to right, #ff0000 0%, #ff0000 30%, rgba(255, 0, 0, 0) 100%) !important;
    display: block !important;
}

.custom-title a {
    color: #ff0000 !important;
    font-family: 'Roboto', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    letter-spacing: 0.5px !important;
}

/* Khối Danh Sách / Panel bài viết chính */
.panel.panel-default.clearfix {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 0px;
    padding: 5px;
    margin-bottom: 1px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: visible !important;
}

.panel.panel-default.clearfix .panel-heading {
    background: transparent !important;
    border-bottom: 0 solid #f5f5f5;
    padding: 5px !important;
}

/* Giới hạn số dòng mô tả bài viết ở danh sách (Tránh vỡ layout) */
.panel-body p {
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

img.img-thumbnail.pull-left.imghome {
    box-shadow: 0 2px 5px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    border: 1px solid #ddd;
    border-radius: 2px;
    transition: box-shadow 0.3s ease-in-out;
}

img.img-thumbnail.pull-left.imghome:hover {
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}

/* Danh sách tin liên quan dưới chân khối tin */
.panel-body h3,
.panel-body p:not(.text-right),
ul.related.list-items {
    padding: 0 !important;
    list-style: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

ul.related.list-items li.icon_list {
    position: relative !important;
    padding: 1px 0 1px 5px !important;
    background-image: none !important;
}

ul.related.list-items li.icon_list:last-child {
    border-bottom: none !important;
}

ul.related.list-items li.icon_list:before {
    content: "✦" !important;
    position: absolute !important;
    left: 0 !important;
    font-size: 10px !important;
    top: 3px !important;
    color: #800020 !important;
}

ul.related.list-items li.icon_list a {
    -webkit-line-clamp: unset !important;
    line-height: 1.4 !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 400;
}

ul.related.list-items li.icon_list:hover a {
    color: #28a745 !important;
    text-decoration: underline !important;
}

/* ==========================================================================
   5. TOOLTIP & KHỐI HIỂN THỊ THÔNG TIN SÁCH CHUNG
   ========================================================================== */
.tooltip-inner {
    max-width: 450px !important;
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.tooltip-inner .book-title-red, 
.tooltip-inner > div:first-child {
    color: #ff0000 !important;
    font-weight: bold !important;
    font-size: 17px !important;
    margin-bottom: 3px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #eeeeee !important;
    line-height: 1.4 !important;
    display: block !important;
}

.tooltip-inner img {
    float: left;
    margin: 0 12px 8px 0 !important;
    border: 1px solid #ddd;
    padding: 2px;
    background: #fff;
    border-radius: 4px;
}

.tooltip-inner span, 
.tooltip-inner p {
    font-size: 14px;
    line-height: 1.6;
    color: #1b5e20;
    display: inline;
}

/* Định vị mũi tên Tooltip */
.tooltip .tooltip-arrow {
    position: absolute;
    margin: 0;
}

.tooltip.right .tooltip-arrow {
    top: 50%;
    left: -12px !important;
    margin-top: -6px !important;
    border-width: 6px 12px 6px 0 !important;
    border-right-color: #e8f5e9 !important;
}

.tooltip.top .tooltip-arrow {
    bottom: -25px !important;
    left: 50%;
    margin-left: -6px !important;
    border-width: 25px 6px 0 !important;
    border-top-color: #e8f5e9 !important;
}

.tooltip.left .tooltip-arrow {
    top: 50%;
    right: -8px !important;
    margin-top: -6px !important;
    border-width: 6px 0 6px 8px !important;
    border-left-color: #e8f5e9 !important;
}

.tooltip.bottom .tooltip-arrow {
    top: -25px !important;
    left: 50%;
    margin-left: -6px !important;
    border-width: 0 6px 25px 6px !important;
    border-bottom-color: #e8f5e9 !important;
}

/* Khối bao ngoài và link tiêu đề sách */
.book-title-container {
    display: block !important;
    line-height: 1.1 !important;
    margin-top: 2px !important;
}

h3.book-title-container {
    margin-bottom: 2px !important;
}

.book-title-link {
    display: inline-block !important;
    padding-bottom: 4px !important;
    font-family: 'Inter', 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 15px !important;
    color: #800020 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 0.3s ease, transform 0.3s ease !important;
}

.book-title-link:hover {
    color: #3b82f6 !important;
    transform: translateX(5px);
}

.book-title {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    line-height: 1.4;
    margin: 5px 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.book-title:hover,
.book-title-link:hover .book-title {
    color: #ff5722;
}

h3.book-title-link a {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* GOM NHÓM HOÀN CHỈNH KHỐI THÔNG TIN SÁCH (Mã sách, Số trang, Ngày đăng) */
.bs-meta-info-row {
    display: flex;
    flex-wrap: wrap;       /* Cho phép các item xuống dòng */
    justify-content: center; /* Canh giữa các item theo chiều ngang */
    align-items: center;     /* Canh giữa các item theo chiều dọc */
    gap: 20px;               /* Tạo khoảng cách giữa các item (thay cho margin) */
    text-align: center;
}

/* Đảm bảo các item con không bị dính sát nhau */
.book-info-item {
    margin: 0 !important;   /* Xóa margin cũ để dùng gap cho chuẩn */
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 1px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.book-info-item strong {
    color: #333;
    margin-right: 4px;
}

/* Màu sắc riêng cho từng Tag thông tin */
.item-time {
    background-color: #f0f9ff;
    border: 0px solid #0284c7;
    color: #0284c7;
}

.item-code {
    background-color: #fff5f2;
    border: 0px solid #ff7a59;
    font-size: 16px !important;
    color: #fa1404 !important;
    font-weight: 600 !important;
}

.item-pages {
    background-color: #f0fbfb;
    border: 0px solid #10b981;
    font-size: 16px !important;
    color: #fa1404 !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   6. CẤU TRÚC KHỐI HIỂN THỊ CHI TIẾT SÁCH (BẢN KHÔNG ẢNH - CHUẨN SEO 100%)
   ========================================================================== */

/* Khung bọc tổng thể bài viết giới thiệu sách không ảnh */
.book-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 25px;
    background-color: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #333333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* Phần tiêu đề khối thông tin sách */
.book-header {
    text-align: center;
    margin-bottom: 25px;
}

/* Tiêu đề phụ (H2) - Tối ưu chống trùng lặp H1 hệ thống */
.book-title {
    font-size: 24px;
    color: #0073e6;
    margin: 0 0 8px 0;
    font-weight: 800;
    line-height: 1.4;
}

/* Tên tác giả - Hiển thị chữ đứng, căn giữa nổi bật */
.book-author {
    font-size: 18px;
    color: #e74c3c;
    margin: 0;
    font-weight: 600;
    font-style: normal;
}

/* Đoạn văn bản mô tả tóm tắt nội dung cuốn sách */
.book-summary {
    font-size: 16px;
    line-height: 1.8;
    text-align: justify;
    color: #4a5568;
    margin: 0 0 25px 0;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e2e8f0;
}

/* Hộp lưới thông số kỹ thuật (Chia 2 cột song song chuẩn xác tuyệt đối) */
.book-specs-box {
    background-color: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0073e6;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 20px;
    box-sizing: border-box;
}

/* Từng dòng thuộc tính thông số chi tiết */
.book-spec-item {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #4a5568;
}

.book-spec-text {
    line-height: 1.4;
}

/* Làm nổi bật thông số sau dấu hai chấm: Chữ đậm, màu đỏ rực rỡ */
.spec-highlight {
    color: #cc0000;
    font-weight: bold;
    font-size: 16px;
}

/* ==========================================================================
   7. THANH CHÂN TRANG / TIỆN ÍCH CĂN PHẢI (IN, LƯU, GỬI BÀI)
   ========================================================================== */
.row.margin-bottom-lg .col-md-12 {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    clear: both;
}

ul.list-inline.text-right {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

ul.list-inline.text-right li {
    display: inline-flex;
    margin: 0 !important;
    padding: 0 !important;
}

ul.list-inline.text-right li a.dimgray {
    color: #696969 !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

ul.list-inline.text-right li a.dimgray:hover {
    color: #0073e6 !important;
    transform: scale(1.1);
}

.bs-wrapper-full {
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   8. FIX LỖI DANH SÁCH TIN LIÊN QUAN / CẮT CHỮ TRÀN KHUNG
   ========================================================================== */
li.clearfix {
    display: flex !important;
    padding: 2px !important;
    gap: 5px;
    align-items: center;
}

li.clearfix > a:first-child {
    flex-shrink: 0;
}

li.clearfix > a:first-child img {
    border: 0px solid #ddd !important;
    padding: 4px !important;
    background-color: #fff !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    border-radius: 4px !important;
    display: block !important;
}

ul.related, 
ul.related li {
    max-width: 100% !important;
    overflow: hidden !important;
    min-width: 0 !important;
}

/* Sửa lỗi hiển thị dập tắt dấu ba chấm của thẻ H3 khi cắt chữ */
h3.show {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: keep-all !important;
}

h3.show a {
    display: inline-block !important; 
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ẩn chữ nhưng giữ giá trị cấu trúc SEO */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================================================
   9. KHỐI LƯỚI ẢNH MỤC LỤC SÁCH (SÁCH CÓ ẢNH PHIÊN BẢN 1)
   ========================================================================== */
.book-gallery-container {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    margin: 20px auto;
    max-width: 900px;
    padding: 10px;
    width: 100%;
}

.book-gallery-container h2 {
    color: rgb(211, 47, 47);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 25px;
    margin-top: 10px;
    text-align: center;
}

.book-gallery-grid {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    width: 100%;
}

.book-gallery-item {
    box-sizing: border-box;
    flex: 1 0 calc(50% - 10px);
    width: calc(50% - 10px);
    min-width: 280px;
    max-width: 100%;
    margin: 0;
}

.book-gallery-item img {
    border-radius: 6px;
    border: 1px solid rgb(224, 224, 224);
    box-shadow: rgba(0, 0, 0, 0.05) 0px 4px 8px;
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

/* ==========================================================================
   10. MEDIA QUERIES (TỐI ƯU RESPONSIVE CHO DI ĐỘNG)
   ========================================================================== */
@media screen and (max-width: 768px) {
    div.SimilarArticleControl {
        padding: var(--padding-box) !important;
        max-width: calc(100% - 20px);
        margin: auto !important;
        margin-bottom: 10px !important;
    }
    .tooltip {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    .custom-topbar-container,
    .custom-topbar-inner {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 5px 10px !important;
    }
    .custom-topbar-menu {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
    }
    .custom-user-actions {
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .custom-btn-support {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 600px) {
    .book-container {
        padding: 15px;
        margin: 10px;
    }
    .book-author {
        font-size: 16px;
    }
    .book-specs-box {
        grid-template-columns: 1fr; /* Tự động co bóp 2 cột về 1 cột dọc thẳng đứng trên di động */
        gap: 12px;
        padding: 15px;
    }
    .book-gallery-item {
        flex: 1 1 100%;
        width: 100%;
    }
    .book-gallery-container h2 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    ul.list-inline.text-right {
        justify-content: center !important; 
        gap: 20px;
    }
}

/* ==========================================================================
   11. CÁC THÀNH PHẦN BỔ SUNG KHÁC (TAGS, SEARCH BUTTON, TOPBAR, HISTATS...)
   ========================================================================== */
.imghome {
    width: 100px !important;
    height: 130px !important;
    object-fit: cover !important;
    display: block;
}

button.btn.ai-style-change-1 {
    background-color: #0077ff !important;
    border-color: #0073e6 !important;
    color: #ffffff !important;
    padding-left: 30px !important;
    padding-right: 30px !important;
    min-width: 100px !important;
    height: 40px !important;
    box-shadow: none !important;
    border-radius: 4px !important;
    border-style: solid !important;
    border-width: 1px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

button.btn.ai-style-change-1:hover {
    background-color: #0069d9 !important;
    border-color: #0062cc !important;
}

i.fas.fa-search.ai-style-change-6 {
    font-size: 18px !important;
    color: #ffffff !important;
}

.h5 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid #eee;
}

.h5 a {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.h5 a:hover {
    transform: translateY(-2px);
    filter: brightness(0.9);
}

.h5 a em { font-style: normal; }

/* Hệ màu sắc luân phiên cho thẻ Tags */
.h5 a:nth-of-type(6n+1) { background-color: #e3f2fd; color: #1976d2; border: 1px solid #bbdefb; }
.h5 a:nth-of-type(6n+2) { background-color: #f1f8e9; color: #558b2f; border: 1px solid #dcedc8; }
.h5 a:nth-of-type(6n+3) { background-color: #fff3e0; color: #ef6c00; border: 1px solid #ffe0b2; }
.h5 a:nth-of-type(6n+4) { background-color: #f3e5f5; color: #8e24aa; border: 1px solid #e1bee7; }
.h5 a:nth-of-type(6n+5) { background-color: #fce4ec; color: #c2185b; border: 1px solid #f8bbd0; }
.h5 a:nth-of-type(6n+6) { background-color: #e0f2f1; color: #00695c; border: 1px solid #b2dfdb; }

.counter-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px auto;
    padding: 5px 5px;
    width: fit-content;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.counter-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#histats_counter {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
}

.search-result-block {
    display: flex !important;
    padding: 15px !important;
    margin-bottom: 12px !important;
    background-color: #ffffff !important;
    border: 1px solid #eef2f6 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.25s ease-in-out !important;
}

.search-result-block:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06) !important;
    transform: translateY(-1px) !important;
}

.search-result-block .result-image {
    flex: 0 0 110px !important;
    width: 110px !important;
    height: 145px !important;
    margin-right: 18px !important;
    overflow: hidden !important;
    border-radius: 4px !important;
    background-color: #f8f9fa !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.12), -1px 0px 2px rgba(0, 0, 0, 0.05) !important; 
}

.search-result-block .result-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.4s ease !important;
}

.search-result-block:hover .result-image {
    border-color: #a8b2c1 !important;
    box-shadow: 4px 5px 12px rgba(0, 0, 0, 0.16) !important;
}

.search-result-block:hover .result-image img {
    transform: scale(1.03) !important;
}

.search-result-block .result-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.search-result-block .search-result-title {
    margin: 0 0 8px 0 !important;
    font-size: 19px !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
}

.search-result-block .search-result-title a {
    color: #0056b3 !important;
    text-decoration: none !important;
}

.search-result-block .search-result-title a:hover {
    color: #ff5722 !important;
}

.search-result-block .result-meta {
    font-size: 13px !important;
    color: #64748b !important;
    margin-bottom: 8px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    align-items: center !important;
}

.search-result-block .result-meta .meta-item {
    display: inline-flex !important;
    align-items: center !important;
}

.search-result-block .result-meta .meta-item i {
    color: #94a3b8 !important;
    margin-right: 5px !important;
    font-size: 13px !important;
}

.search-result-block .result-description {
    font-size: 15px !important;
    color: #475569 !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    text-align: justify !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.search-result-block span[style*="color"] {
    color: #e11d48 !important;
    font-weight: 700 !important;
    background-color: #fff1f2 !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
}

.search-result-heading {
    display: block !important;
    padding: 14px 20px !important;
    margin-bottom: 25px !important;
    background-color: #f8fafc !important;
    border-left: 4px solid #007bff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0 8px 8px 0 !important;
    font-size: 20px !important;
    color: #475569 !important;
    line-height: 1.5 !important;
    font-weight: 500;
}

.search-result-heading i {
    color: #007bff !important;
    margin-right: 6px !important;
    font-size: 16px !important;
}

.search-result-heading .search-count-num {
    color: #ffffff !important;
    background-color: #007bff !important;
    padding: 2px 10px !important;
    border-radius: 20px !important;
    font-weight: bold !important;
    font-size: 14px !important;
    margin: 0 3px !important;
    display: inline-block !important;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2) !important;
}

.search-result-heading .search-keyword-text {
    color: #e11d48 !important;
    font-weight: 600 !important;
    font-style: italic !important;
}

.btn-view-more {
    display: inline-block !important;
    padding: 10px 20px !important;
    background-color: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 30px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.btn-view-more:hover {
    background-color: #007bff !important;
    color: #ffffff !important;
    border-color: #007bff !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15) !important;
}

.custom-sticky-topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    z-index: 99999;
    background-color: #0084ff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.custom-topbar-container {
    width: 100% !important;
    padding: 10px 0 !important;
    display: flex !important;
    justify-content: center !important;
}

.custom-topbar-inner {
    width: 100% !important;
    max-width: 1140px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.custom-topbar-menu {
    display: flex !important;
    gap: 20px !important;
}

.custom-topbar-menu .menu-item {
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    transition: opacity 0.2s ease !important;
}

.custom-topbar-menu .menu-item:hover {
    opacity: 0.8 !important;
}

.custom-user-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.custom-btn-support {
    display: inline-flex !important;
    align-items: center !important;
    background: #ffffff !important;
    color: #0084ff !important;
    text-decoration: none !important;
    padding: 8px 18px !important;
    border-radius: 30px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.25s ease !important;
}

.custom-btn-support svg {
    width: 16px !important;
    height: 16px !important;
    fill: #0084ff !important;
    margin-right: 6px !important;
    transition: transform 0.25s !important;
}

.custom-btn-support:hover {
    background: #f1f3f5 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15) !important;
}

.custom-btn-support:hover svg {
    transform: scale(1.1) !important;
}

.custom-btn-auth {
    text-decoration: none !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    padding: 7px 14px !important;
    border-radius: 6px !important;
    transition: all 0.25s ease !important;
}

.custom-btn-register {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.custom-btn-register:hover {
    background-color: rgba(255, 255, 255, 0.35) !important;
}

.custom-btn-login {
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    background-color: transparent !important;
}

.custom-btn-login:hover {
    color: #0084ff !important;
    background-color: #ffffff !important;
}

.zalo-guide-box {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    max-width: 650px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333333;
    line-height: 1.6;
}

.zalo-guide-box h3 {
    color: #0056d6;
    font-size: 18px;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.zalo-guide-box .guide-list {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 20px;
}

.zalo-guide-box .guide-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 15px;
}

.zalo-guide-box .guide-list li::before {
    content: "•";
    color: #0068ff;
    font-weight: bold;
    font-size: 18px;
    position: absolute;
    left: 0;
    top: -2px;
}

.zalo-guide-box .guide-list li strong {
    color: #111111;
}

.zalo-guide-box .guide-desc {
    font-size: 15px;
    color: #555555;
    margin-bottom: 15px;
}

.zalo-guide-box .syntax-box {
    background: linear-gradient(to right, #f4f8ff, #ffffff);
    border-left: 4px solid #0068ff;
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
}

.zalo-guide-box .syntax-content {
    font-size: 15px;
    color: #222222;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.zalo-guide-box .badge {
    background-color: #0068ff;
    color: #ffffff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    margin-right: 5px;
}

.zalo-guide-box .btn-container {
    text-align: center;
    margin-top: 30px;
}

.zalo-guide-box .zalo-custom-btn {
    align-items: center;
    background-color: #0068ff;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 104, 255, 0.3);
    color: #ffffff;
    display: inline-flex;
    font-size: 16px;
    font-weight: 600;
    justify-content: center;
    padding: 12px 32px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    gap: 10px;
}

.zalo-guide-box .zalo-custom-btn:hover {
    background-color: #0056d6;
    box-shadow: 0 6px 20px rgba(0, 104, 255, 0.45);
    transform: translateY(-2px);
}

.custom-topbar-menu .menu-item.menu-home {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5) !important;
}

.custom-topbar-menu .menu-item.menu-home .icon {
    font-size: 19px !important;
    display: inline-block;
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.5)) hue-rotate(340deg) brightness(1.2) saturate(5) !important;
    animation: pulse 2s infinite;
}

.custom-topbar-menu .menu-item.menu-home:hover {
    color: #e0f2f1 !important;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7) !important;
    opacity: 1 !important;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

h1.title {
    display: inline-block;
}

.admin-inline {
    display: inline-block;
    vertical-align: middle;
    margin-left: 15px;
    font-size: 17px;
}

.book-subtitle { margin-top: 10px; color: #6b7280; font-size: 15px; }
#news-bodyhtml h2 { font-size: 28px; margin-top: 30px; }
#news-bodyhtml h3 { font-size: 24px; margin-top: 25px; }