body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Roboto", sans-serif;
    background-color: #fafafa;
    color: #1e293b;
    line-height: 1.6;
}

/* Design System Colors */
:root {
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --primary-blue-light: #eff6ff;
    --primary-blue-dark: #1d4ed8;

    --manga-gray: #1e293b;
    --manga-gray-light: #cbd5e1;
    --muted-gray: #64748b;
    --light-gray: #f1f5f9;

    --background: #fafafa;
    --card-background: #ffffff;
    --border-color: #e2e8f0;

    --shadow-card: 0 4px 12px rgba(59, 130, 246, 0.1);
    --shadow-card-hover: 0 8px 25px rgba(59, 130, 246, 0.15);
    --shadow-button: 0 2px 8px rgba(59, 130, 246, 0.2);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.m-trend {
    background: #f8f9fa;
    padding: 40px 0;
    margin: 40px 0;
}
.m-trend h3 {
    font-weight: 700;
    color: #0d2d6c;
}
.m-post {
    position: relative;
    padding-left: 40px;
    padding-top: 30px;
    padding-right: 10px;
    display: flex !important;
    gap: 15px;
    transition: 0.3s;
}
.m-post:hover {
    transform: translateY(-5px);
}
/* Rank number (SVG overlay) */
.m-post > svg {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}
/* Thumbnail */
.p-thumb {
    position: relative;
    flex-shrink: 0;
}
.p-thumb img {
    width: 160px;
    height: 220px;
    border-radius: 8px;
    object-fit: cover;
}
.p-thumb::before {
    content: "";
    position: absolute;
    top: -12px;
    right: 0;
    width: 75%;
    height: 2px;
    background: var(--before-bg);
    z-index: 1;
}
/* Content */
.p-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.m-star {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.star-rating {
    display: inline-block;
    width: 70px;
    height: 14px;
    background: url("https://i.imgur.com/Y1Zl8xF.png") repeat-x;
    background-size: contain;
    position: relative;
}
.star-rating span {
    display: block;
    height: 100%;
    background: url("https://i.imgur.com/q0G3Y5O.png") repeat-x;
    background-size: contain;
}
.num-view {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 8px;
}
.list-chaps {
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}
.list-chaps li a {
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    font-size: 0.85rem;
    color: #0d6efd;
    margin-bottom: 3px;
}
.list-chaps li span {
    font-size: 0.8rem;
    color: #666;
}
button.splide__arrow.splide__arrow--prev {
    left: 90%;
}

.splide__arrow {
    -ms-flex-align: center;
    align-items: center;
    background: #ccc;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: -ms-flexbox;
    display: flex;
    height: 2em;
    -ms-flex-pack: center;
    justify-content: center;
    opacity: 0.7;
    padding: 0;
    position: absolute;
    top: -10%;
    transform: translateY(-50%);
    width: 2em;
    z-index: 1;
}

/* Nút Previous */
.splide__arrow--prev {
    background-color: #0d6efd; /* Xanh dương */
    color: #fff; /* Màu icon */
}

/* Nút Next */
.splide__arrow--next {
    background-color: #0d6efd; /* Xanh dương */
    color: #fff;
}

.splide__pagination {
    bottom: -1.5em;
    left: 0;
    padding: 0 1em;
    position: absolute;
    right: 0;
    z-index: 1;
}

.splide__arrow--prev svg path {
    fill: #fff; /* Màu trắng */
    stroke: none; /* Tắt viền nếu có */
}

/* Mũi tên Next */
.splide__arrow--next svg path {
    fill: #fff; /* Màu trắng */
    stroke: none;
}

/* Khi hover đổi màu */
.splide__arrow:hover svg path {
    fill: #ffcc00; /* Vàng khi hover */
}

/* ====== RIGHT COLUMN ====== */
.rank-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.rank-item img {
    width: 50px;
    height: 65px;
    border-radius: 4px;
    margin-right: 10px;
    object-fit: cover;
}
.rank-num {
    margin-left: auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.rank-1 {
    background: #ffd35a;
}
.rank-2 {
    background: #df7861;
    color: #fff;
}
.rank-3 {
    background: #60a5fa;
    color: #fff;
}

.nav-tabs .nav-link.active {
    font-weight: bold;
    color: #1d4ed8;
    border-color: #1d4ed8 #1d4ed8 #fff;
}

/* Star Rating */
.star-rating {
    display: inline-block;
    background: url("https://cms-assets.tutsplus.com/uploads/users/34/posts/30118/preview_image/star-rating.jpg")
        repeat-x; /* hình sao trống */
    width: 80px;
    height: 16px;
    position: relative;
}

.star-rating span {
    display: block;
    background: url("https://i.imgur.com/GVYz7Rg.png") repeat-x; /* hình sao vàng */
    height: 16px;
}

/* SplideUpdate Css - Mới cập nhật Slider */

/* SplideUpdate Css - Cập nhật tu tiên Slider */

#splideUpdate {
    margin: 20px auto;
    position: relative;
    height: 700px;
}

/* Track */
#splideUpdate .splide__track {
    overflow: hidden;
    border-radius: 12px;
    height: 100%;
}

/* List */
#splideUpdate .splide__list {
    display: flex;
    gap: 16px; /* khoảng cách giữa các slide */
    padding: 10px;
    box-sizing: border-box;
}

/* Slide item */
#splideUpdate .splide__slide {
    height: 100%;
}

#splideUpdate .comic-card {
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    margin: 10px; /* tăng khoảng cách để card không dính nhau */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee; /* phân tách rõ card */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    height: 100%; /* chiều cao đồng nhất */
    transition: all 0.25s ease-in-out;
}

/* Hover effect */
#splideUpdate .comic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* Image */
#splideUpdate .comic-card img {
    width: 130px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

/* Right content */
#splideUpdate .comic-card-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Title */
#splideUpdate .comic-card-right h5 {
    font-size: 15px;
    margin: 0 0 6px;
    font-weight: 600;
    line-height: 1.4;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Views badge */
#splideUpdate .comic-card-right .views {
    display: inline-block;
    background: #f7f7f7;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 6px;
    color: #555;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chapters */
#splideUpdate .comic-card-right .chapters {
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
}

#splideUpdate .comic-card-right .chapters a {
    color: #007bff;
    font-weight: 500;
    text-decoration: none;
}

#splideUpdate .comic-card-right .chapters a:hover {
    text-decoration: underline;
}

#splideUpdate .comic-card-right .chapters small {
    color: #777;
    margin-left: 6px;
    font-size: 12px;
}
/* Khung item */
#splideFeatured .comic-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#splideFeatured .comic-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Ảnh bìa */
#splideFeatured .comic-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

/* Tên truyện */
#splideFeatured .comic-item h5 {
    font-size: 15px;
    font-weight: 600;
    margin: 10px 8px 4px;
    line-height: 1.4;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* tối đa 2 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Rating */
#splideFeatured .comic-item .rating {
    font-size: 13px;
    color: #999;
    margin: 0 8px 4px;
}

/* Chapter & thời gian */
#splideFeatured .comic-item .chapter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin: 0 8px 10px;
}

#splideFeatured .comic-item .chapter a {
    font-weight: 600;
    color: #007bff;
    text-decoration: none;
}

#splideFeatured .comic-item .chapter a:hover {
    text-decoration: underline;
}

#splideFeatured .comic-item .chapter small {
    color: #888;
}

#splideFeatured .splide__arrow--prev {
    top: 5%;
}

/* Nút Next */
#splideFeatured .splide__arrow--next {
    top: 5%;
}

.tags-featured {
    margin: 40px 0;
}

.tags-featured .section-header {
    margin-bottom: 20px;
}

.tags-grid {
    display: flex;
    flex-wrap: wrap; /* cho phép xuống dòng */
    gap: 20px; /* khoảng cách giữa các item */
}

.g-item {
    flex: 0 0 calc(24% - 10px); /* chiếm 50% chiều rộng, trừ khoảng gap */
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    color: #fff;
}

.genre-content {
    position: relative;
    padding: 15px;
    min-height: 220px; /* giữ chiều cao đều */
}

.g-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.g-name a {
    color: #fff;
    text-decoration: none;
}

.g-name a:hover {
    text-decoration: underline;
}

.g-thumb {
    position: relative;
    z-index: 2;
}

.g-thumb img {
    max-height: 160px;
    object-fit: contain;
    display: block;
}

.num-series {
    margin-top: 10px;
    font-size: 14px;
}

.bg-cat {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: auto;
}

/* CSS Stories */

/* Story header */
.story-header {
    border-radius: 12px;
    border: none;
}
.story-cover {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.story-title {
    font-size: 1.8rem;
    color: #222;
}
.tags .tag {
    background: #f2f4f7;
    color: #fff;
    font-size: 0.85rem;
    padding: 6px 10px;
    margin-right: 4px;
    border-radius: 20px;
}
.read-more {
    font-weight: bold;
    color: #0066cc;
    text-decoration: none;
}
.read-more:hover {
    text-decoration: underline;
}

/* Chapter list */
.chapter-list {
    border-radius: 12px;
    overflow: hidden;
}
.chapter-list .card-header {
    background: #f8f9fa;
    font-size: 1.1rem;
}
.chapter-list table th {
    font-weight: bold;
}
.chapter-list table td a {
    font-weight: 500;
    text-decoration: none;
    color: #0066cc;
}
.chapter-list table td a:hover {
    text-decoration: underline;
}

/* Reaction box */
.reaction-box {
    border-radius: 12px;
    background: #f9fafc;
}
.reaction-icons span {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.reaction-icons span:hover {
    transform: scale(1.2);
}

/* Related stories */
.related-stories {
    border-radius: 12px;
}
.related-stories .card-header {
    background: #f8f9fa;
    font-size: 1.1rem;
}
.related-stories .list-group-item {
    border: none;
    padding: 12px 16px;
}
.related-stories .fw-bold {
    color: #222;
    font-size: 0.95rem;
}
.related-stories small {
    font-size: 0.8rem;
}

.comic-item .date_publish {
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6c757d; /* màu xám nhạt */
    display: block;
}

.rank-num {
    position: absolute;
    left: 8px;
    top: 24px;
    font-size: 102px;
    font-weight: 800;
    line-height: 1;
    color: transparent; /* rỗng phần fill */
    -webkit-text-stroke: 4px var(--rank-color);
    text-stroke: 4px var(--rank-color);
    opacity: 0.9;
    user-select: none;
    pointer-events: none;
}
/* nếu bạn muốn có gạch ngang như thiết kế cũ */
.rank-num::after {
    content: "";
    display: block;
    height: 4px;
    width: 120px;
    background: var(--rank-color);
    margin-top: 8px;
    margin-left: 40px;
    border-radius: 999px;
}

/* Khung navbar riêng của bạn */
.site-navbar {
    background: #fff;
    padding: 10px 0;
    position: relative;
}

/* Dựa trên Bootstrap .nav hiện có */
.site-navbar .nav {
    gap: 20px;
    flex-wrap: nowrap !important;
}

.site-navbar .nav-item {
    position: relative;
}

.site-navbar .nav-link {
    color: #222;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    line-height: 1;
    white-space: nowrap;
}

.site-navbar .nav-link:hover {
    color: var(--primary-blue);
}

/* Mega menu */
.site-navbar .mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 640px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1000;
}

.site-navbar .nav-item:hover > .mega-menu {
    display: block;
}

/* Lưới thể loại */
.site-navbar .categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.site-navbar .categories-grid a {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    transition: 0.2s;
}

.site-navbar .categories-grid a:hover {
    background: var(--primary-blue);
    color: #fff;
}

/* Xem tất cả */
.site-navbar .view-all {
    margin-top: 10px;
}

.site-navbar .view-all a {
    display: inline-block;
    padding: 6px 14px;
    background: #000;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
}

.site-navbar .view-all a:hover {
    background: #444;
}

/* Responsive: cho phép wrap ở < 992px, mega menu bám trái để không tràn màn hình */
/* @media (max-width: 991.98px) {
    .site-navbar .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .site-navbar .nav-link {
        padding: 0.5rem 0.75rem;
    }
    .site-navbar .mega-menu {
        left: 0;
        transform: none;
        min-width: 100%;
        right: 0;
    }
} */

/* Ẩn mega menu ở mobile (đã dùng offcanvas) */
@media (max-width: 991.98px) {
    .site-navbar .mega-menu,
    .site-navbar .nav-item > .categories-grid {
        display: none !important;
    }
}

/* Hover desktop + focus để mở panel (đã dùng trước đó) */
.site-navbar .nav-link {
    transition: color 0.2s ease, transform 0.15s ease;
}
.site-navbar .nav-item.position-relative:hover > .mega-menu,
.site-navbar .nav-item.position-relative:focus-within > .mega-menu,
.site-navbar .nav-item:hover > .categories-grid,
.site-navbar .nav-item:focus-within > .categories-grid {
    display: block;
}

/* Cải thiện offcanvas width một chút cho tablet */
@media (min-width: 576px) and (max-width: 991.98px) {
    #mobileMenu.offcanvas-start {
        width: 360px;
    }
}

/* Search Box */
#searchBox .dropdown-menu {
    display: none;
    max-height: 360px;
    overflow-y: auto;
}
#searchBox .dropdown-menu.show {
    display: block;
}
#searchBox .suggest-cover {
    width: 38px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    background: #eee;
}
#searchBox .suggest-title {
    font-size: 0.9rem;
    line-height: 1.2;
}
#searchBox .suggest-meta {
    font-size: 0.75rem;
}

/* ===== MOBILE ACCORDION MENU ===== */
.accordion-item {
    border: none;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: var(--transition);
}

.accordion-item + .accordion-item {
    margin-top: 10px;
}

.accordion-header {
    background: var(--primary-blue-light);
}

.accordion-button {
    background-color: var(--primary-blue-light);
    color: #1e293b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border: none;
    box-shadow: none;
    outline: none;
    transition: var(--transition);
}

/* Hover & Active states */
.accordion-button:hover {
    background-color: var(--primary-blue);
    color: #fff;
}
.accordion-button:not(.collapsed) {
    background-color: var(--primary-blue);
    color: #fff;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* Icon caret màu */
.accordion-button::after {
    filter: brightness(0) saturate(100%) invert(30%) sepia(90%) saturate(900%)
        hue-rotate(190deg) brightness(95%) contrast(95%);
}
.accordion-button:not(.collapsed)::after {
    filter: invert(100%);
}

/* Nội dung bên trong accordion */
.accordion-body {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
}

/* Link bên trong (list-group-item) */
.accordion-body .list-group-item {
    border: none;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #f8fafc;
    font-weight: 500;
    font-size: 0.9rem;
    color: #334155;
    padding: 10px 12px;
    transition: var(--transition);
}
.accordion-body .list-group-item:hover {
    background: var(--primary-blue);
    color: #fff;
}

/* Hiệu ứng mở rộng */
.accordion-collapse {
    transition: height 0.3s ease;
}

/* Padding tổng thể trong offcanvas */
.offcanvas-body {
    background: #f9fafb;
    padding: 1rem;
}

/* Tiêu đề accordion tổng (Menu / Offcanvas header) */
.offcanvas-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}
.offcanvas-title {
    font-weight: 700;
    color: #0f172a;
}

/* Nút close trong offcanvas */
.btn-close {
    filter: brightness(0.3);
}
.btn-close:hover {
    filter: brightness(0);
}

/* Responsive fine-tuning cho mobile */
@media (max-width: 575.98px) {
    .accordion-button {
        font-size: 0.9rem;
        padding: 0.65rem 0.9rem;
    }
    .accordion-body .list-group-item {
        font-size: 0.85rem;
        padding: 9px 10px;
    }
}

/* ===== Desktop dropdown nhỏ cho mục TIN TỨC ===== */
/* Mặc định ẩn dropdown */
.site-navbar .nav-item.has-sub {
    position: relative;
}
.site-navbar .nav-item .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease,
        visibility 0s linear 0.18s;
    z-index: 1000;
}

/* Chỉ áp dụng hành vi hover trên desktop (≥992px) */
@media (min-width: 992px) {
    /* Override d-lg-block của Bootstrap */
    .site-navbar .nav-item .sub-menu {
        display: block !important; /* để mình điều khiển bằng visibility/opacity */
        opacity: 0;
        visibility: hidden; /* nhưng vẫn ẩn */
    }
    .site-navbar .nav-item.has-sub:hover > .sub-menu,
    .site-navbar .nav-item.has-sub:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition-delay: 0s;
    }
}

/* Item trong dropdown */
.site-navbar .nav-item .sub-menu a {
    display: block;
    font-size: 14px;
    color: #334155;
    text-decoration: none;
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 4px 0;
    transition: background 0.2s, color 0.2s;
}
.site-navbar .nav-item .sub-menu a:hover {
    background: #3b82f6;
    color: #fff;
}

/* Ẩn hoàn toàn trên mobile vì bạn đã có offcanvas/accordion */
@media (max-width: 991.98px) {
    .site-navbar .nav-item .sub-menu {
        display: none !important;
    }
}
