:root { 
    --primary-color: #0c3359; 
    --primary-light: #e6f0f9; 
    --secondary-color: #f8f9fa;
    --accent-color: #c5a47e; 
    --text-main: #333333; 
    --text-muted: #6c757d; 
}
body { background-color: #f8f9fa; font-family: 'Inter', sans-serif; color: var(--text-main); font-size: 0.95rem; }
.hidden { display: none !important; } 
h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; }

.no-copy { user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; }
.no-interaction-img { pointer-events: none; }

.result-card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; border: 1px solid #edf2f7; box-shadow: 0 4px 10px rgba(0,0,0,0.04); position: relative; transition: all 0.3s; cursor: pointer; }
.result-card:hover { transform: translateY(-4px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: var(--accent-color); }
.public-nav-link { color: var(--text-main); font-weight: 600; transition: 0.2s; border-bottom: 2px solid transparent; padding: 15px 10px; position: relative;}
.public-nav-link:hover, .public-nav-link.active { color: var(--primary-color); border-bottom: 2px solid var(--accent-color); }

.news-card { cursor: pointer; transition: 0.3s; border: 1px solid #eee; border-radius: 10px; overflow: hidden; }
.news-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); border-color: var(--accent-color); }
.section-title { color: var(--primary-color); font-weight: 800; text-transform: uppercase; position: relative; padding-bottom: 15px; margin-bottom: 30px; }
.section-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 60px; height: 3px; background-color: var(--accent-color); }
.section-title.text-center::after { left: 50%; transform: translateX(-50%); }

.modal-backdrop.show { opacity: 0.85; background-color: #0c3359; }

.article-content img { max-width: 100% !important; height: auto !important; border-radius: 8px; margin: 15px auto; box-shadow: 0 4px 10px rgba(0,0,0,0.08); display: block; }
.auto-album-dynamic img, .auto-album-wrapper img { margin: 0 !important; display: inline-block !important; box-shadow: none !important; }
.article-content p[style*="text-align: center"] img { margin: 10px auto !important; }
.article-content table { width: 100% !important; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem; }
.article-content th, .article-content td { border: 1px solid #dee2e6; padding: 12px; }
.article-content thead, .article-content th { background-color: var(--primary-light); color: var(--primary-color); font-weight: bold; text-align: center; }
.article-content h2 { color: var(--primary-color); font-weight: 700; margin-top: 2rem; margin-bottom: 1rem; border-bottom: 2px solid #eee; padding-bottom: 8px; font-family: 'Montserrat', sans-serif; line-height: 1.4; }
.article-content h3 { color: #2c3e50; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.8rem; font-family: 'Montserrat', sans-serif; line-height: 1.3; }
.article-content h2::before { content: '■ '; color: var(--accent-color); font-size: 0.8em; vertical-align: middle; }
.article-content p { margin-bottom: 1.2rem; text-align: justify; line-height: 1.7; }
.article-content ul, .article-content ol { margin-bottom: 1.2rem; padding-left: 1.5rem; line-height: 1.7; }
.article-content li { margin-bottom: 0.5rem; }
.hover-primary:hover { color: var(--primary-color) !important; text-decoration: underline !important; }
#toc-list a:hover { color: var(--primary-color) !important; text-decoration: underline !important; font-weight: bold; }

/* ==========================================
   CSS CHO MEGA MENU CHIA CỘT NHIỀU CẤP ĐỘ
   ========================================== */
@media all and (min-width: 992px) {
    .navbar .has-megamenu { position: static !important; }
    .navbar .nav-item.dropdown > .nav-link::after { content: ''; position: absolute; bottom: -20px; left: 0; width: 100%; height: 20px; background: transparent; }
    
    .navbar .megamenu { 
        left: 0; right: 0; width: 100%; margin-top: 0; padding: 30px 0; 
        border-radius: 0 0 12px 12px; position: absolute; 
        background: #fff; border-top: 2px solid var(--primary-color) !important; 
        box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important; 
        z-index: 1050; /* ĐÃ TĂNG Z-INDEX LÊN 1050 */
        
        /* Hiệu ứng Delay mượt mà khi hover out */
        display: block !important;
        visibility: hidden;
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s 0.4s;
        pointer-events: none;
    }
    
    .navbar .nav-item.has-megamenu:hover > .megamenu { 
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
        pointer-events: auto;
    }
    
    .megamenu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
    .megamenu-col { border-right: 1px dotted #ccc; padding: 0 25px; }
    .megamenu-col:last-child { border-right: none; }
    .megamenu-title { color: #4a4a4a; font-weight: 800; font-size: 1.2rem; margin-bottom: 15px; padding-bottom: 5px; font-family: 'Montserrat', sans-serif; }
    
    .megamenu-list { list-style: none; padding: 0; margin: 0; }
    .megamenu-item { display: block; padding: 6px 0; color: #555; text-decoration: none; transition: all 0.2s; font-size: 0.95rem; }
    .megamenu-item:hover { color: var(--accent-color); padding-left: 5px; }
    
    .mm-level-1 { font-weight: 600; color: #444; margin-top: 10px; font-size: 1rem; }
    .mm-level-2 { padding-left: 15px; font-size: 0.9rem; }
    
    /* CSS CHỈ KHI HOVER MỚI XỔ MỤC CON */
    .mm-icon { font-size: 0.55rem; margin-right: 6px; color: #888; vertical-align: middle; display: inline-block; transition: transform 0.2s; }
    .mm-child-list { display: none; padding-left: 0; margin: 0; list-style: none; }
    
    .mm-has-child:hover > .mm-child-list { 
        display: block; 
        animation: fadeInSubMenu 0.3s ease; 
    }
    .mm-has-child:hover > a > .mm-icon { 
        transform: rotate(90deg); 
        color: var(--accent-color); 
    }
}

@keyframes fadeInSubMenu { 
    from { opacity: 0; transform: translateY(-5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ==========================================
   MOBILE CSS CHO MEGA MENU 
   ========================================== */
@media (max-width: 991px) {
    .navbar-collapse { background: #fff; border-top: 1px solid #f0f0f0; margin-top: 10px; padding-bottom: 15px; }
    .navbar-nav { gap: 0 !important; }
    .public-nav-link { display: flex !important; justify-content: space-between !important; align-items: center !important; padding: 15px 20px !important; border-bottom: 1px solid #f5f5f5 !important; font-size: 1.05rem !important; }
    
    .toggle-icon { transition: transform 0.3s ease; font-size: 1.1rem; color: var(--text-muted); padding: 0 10px; cursor: pointer; }
    .show-menu > .nav-link .toggle-icon { transform: rotate(180deg); color: var(--accent-color); }
    
    .navbar .has-megamenu { position: relative; }
    .navbar .megamenu { padding: 10px 0; border: none; box-shadow: inset 0 4px 6px rgba(0,0,0,0.02); background: #fcfcfc; display: none; margin: 0; border-radius: 0; z-index: 1050; }
    .navbar .nav-item.has-megamenu.show-menu > .megamenu { display: block !important; }
    
    .megamenu-grid { display: flex; flex-direction: column; gap: 10px; }
    .megamenu-col { border-right: none; padding: 0; margin-bottom: 10px; }
    .megamenu-title { color: var(--primary-color); font-weight: 700; font-size: 1.1rem; border-bottom: 1px solid #eee; padding: 10px 20px; margin-bottom: 5px; background: #f9f9f9; }
    
    .megamenu-list { list-style: none; padding: 0; margin: 0; }
    .megamenu-item { display: block; padding: 8px 20px; color: #555; text-decoration: none; border-bottom: 1px dashed #eee; }
    
    .mm-level-1 { font-weight: 600; background-color: #fafafa; }
    .mm-level-2 { padding-left: 40px; font-size: 0.9rem; }
    
    /* Mobile chạm vào mới xổ con */
    .mm-icon { font-size: 0.6rem; margin-right: 6px; color: #aaa; transition: transform 0.2s; display: inline-block; }
    .mm-child-list { display: none; padding-left: 0; margin: 0; list-style: none; }
    .mm-has-child.show-sub > .mm-child-list { display: block; }
    .mm-has-child.show-sub > a > .mm-icon { transform: rotate(90deg); color: var(--accent-color); }
}

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gallery-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.hover-box { transition: all 0.3s ease; border: 1px solid #edf2f7; }
.hover-box:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); border-color: var(--accent-color); }
.icon-wrapper { width: 80px; height: 80px; background-color: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; transition: 0.3s; }
.hover-box:hover .icon-wrapper { background-color: var(--primary-color); }
.hover-box:hover .icon-wrapper i { color: #fff !important; }
.hover-zoom { transition: transform 0.2s ease; cursor: pointer; }
.hover-zoom:hover { transform: scale(1.02); }
/* ==========================================
   LAYOUT ALBUM ẢNH BÀI VIẾT TÙY CHỈNH
   ========================================== */
/* Layout 2 ảnh: Chia 50 - 50 */
.album-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}
.album-grid-2 img {
    width: 100%;
    height: 300px !important;
    object-fit: cover !important;
    border-radius: 8px;
    cursor: zoom-in;
    margin: 0 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}
.album-grid-2 img:hover { transform: scale(1.02); }

@media (max-width: 768px) {
    .album-grid-2 img { height: 200px !important; }
}

/* Layout 3+ ảnh: 1 To + Thumbnails */
.album-gallery { margin: 25px 0; }
.album-gallery .album-main {
    width: 100%;
    height: 450px !important;
    object-fit: cover !important;
    border-radius: 8px;
    cursor: zoom-in;
    margin: 0 0 10px 0 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: opacity 0.3s ease;
}
.album-gallery .album-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    justify-content: center;
    padding-bottom: 5px;
    scrollbar-width: none; /* Ẩn scrollbar Firefox */
}
.album-gallery .album-thumbs::-webkit-scrollbar { display: none; } /* Ẩn scrollbar Chrome/Safari */
.album-gallery .album-thumbs img {
    width: 80px;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    margin: 0 !important;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.album-gallery .album-thumbs img:hover, 
.album-gallery .album-thumbs img.active {
    opacity: 1;
    border-color: var(--accent-color);
}

@media (max-width: 768px) {
    .album-gallery .album-main { height: 250px !important; }
    .album-gallery .album-thumbs { justify-content: flex-start; } /* Vuốt ngang trên mobile */
}
/* ==========================================
   CHỐNG GIẬT HÌNH (FOUC) CHO AUTO ALBUM
   ========================================== */
#article-content-body:not(.album-loaded) img {
    opacity: 0 !important;
    visibility: hidden;
}
#article-content-body.album-loaded img {
    opacity: 1 !important;
    visibility: visible;
    transition: opacity 0.5s ease-in-out;
}