body {
    font-family: "Roboto", "Arial", sans-serif;
}

.card {
    font-family: inherit;
}

aside {
    width: 260px;
    min-height: 100vh;
}

.icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.nav-link {
    color: #333;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    background-color: #f1f1f1;
}

.nav-link.active {
    font-weight: 600;
    background-color: #e9ecef;
}

.top-banner img {
    width: 100%;
    height: 100%;
    /* chiều cao banner */
    object-fit: cover;
    /* ảnh lấp đầy không méo */
}

.search-input {
    flex: 1;
    background-color: #f9f9f9;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-right: none;
    padding: 0 16px;
    font-size: 16px;
    color: #0f0f0f;
    border-top-left-radius: 40px;
    border-bottom-left-radius: 40px;
    outline: none;
}

.search-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.search-btn {
    width: 64px;
    height: 40px;
    background-color: #f9f9f9;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-left: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-right-radius: 40px;
    border-bottom-right-radius: 40px;
}

.btn-bg-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-bg-circle:hover {
    background-color: #e0e0e0;
    border-color: #e0e0e0;
}

.btn-bg-circle:active {
    background-color: #c8c8c8;
    border-color: #b5b5b5;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.btn-bg-circle:focus {
    background-color: #d8d8d8;
    border-color: #c5c5c5;
}

/* ==== MENU LEFT ==== */
.sidebar {

    margin-top: 13px;
    transition: left 0.3s ease-in-out;
}

.sidebar span {

    padding-left: 20px;
}

/* Khi sidebar thu gọn thì bỏ padding-left */
.sidebar.collapsed span {
    padding-left: 0;
}

.sidebar.collapsed {
    width: 80px;
    height: 120px;
}

/* ==== NAV LINK ==== */
.sidebar .nav-link {

    margin: 10px;
    width: 220px;
    display: flow;
    padding: 4px 2px 2px 10px;
}

.sidebar.collapsed .nav-link {

    margin: 0px;
    width: 220px;
    display: flow;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    border-radius: 10px;

}

.sidebar .nav-link i {
    font-size: 1.4rem;
    min-width: 24px;
    text-align: center;
}

/* ==== ẨN CHỮ KHI THU NHỎ ==== */
.sidebar.collapsed .nav-link {


    padding: 0px 0 14px;
    outline: 0;
    width: 80px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: x-small;

}


.sidebar.collapsed .nav-link:hover::after {
    opacity: 1;
    left: 80px;
}

.nav-link a {
    font-weight: bold;
}

.nav-link.active {
    background-color: white;
}

.nav-link:hover {
    background-color: white;
    color: inherit;
}

.my-carousel .card img {
    object-fit: cover;
    height: 120px;
    border-radius: 8px;
}

.my-carousel .carousel-item img {
    width: 100%;
    height: auto;
    /* giữ tỉ lệ ảnh */
    object-fit: cover;
    /* tránh méo ảnh */
}

/* Thanh trược ngang tin tức  */
.carousel-control-prev,
.carousel-control-next {
    width: 45px !important;
    height: 45px !important;
    ;
    background-color: whitesmoke;
    border-radius: 50%;
    top: 50% !important;
    transform: translateY(-50%);
    opacity: 1;
    /* transition: all 0.2s; */
    /* transition: all 0.2s; */
    border: solid 0px gray;

    /* Bóng xám mềm */
}

.carousel-control-next {
    box-shadow: 2px 0px 3px 2px rgba(0, 0, 0, 0.2);
}

.carousel-control-next:hover {
    box-shadow: 2px 0px 3px 2px rgba(0, 0, 0, 0.2);
    background-color: rgba(243, 238, 238, 0.95);
}

.carousel-control-prev {
    box-shadow: -2px 0px 3px 2px rgba(0, 0, 0, 0.2);
}

.carousel-control-prev:hover {
    box-shadow: -2px 0px 3px 2px rgba(0, 0, 0, 0.2);
    background-color: rgba(243, 238, 238, 0.95);

}

/* Ẩn phần nền gradient mặc định của Bootstrap */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    /* background-size: 50%, 50%; */
    background-size: 60% 60%;
    /* 200% chiều ngang, 50% chiều dọc */
    background-color: transparent;
    filter: invert(1) contrast(200%) brightness(1);
}

/* Dịch vị trí cho đẹp hơn */
.carousel-control-prev {
    left: -20px !important;
}

.carousel-control-next {
    right: -20px !important;
}

/* Menu con Phật bảo */
#searchMobile {
    display: none;
}

#idSearchTop {
    width: 700px;
    max-width: 700px;
}

.titleTuVien {
    font-size: large;
    font-weight: 500;
    color: rgb(5, 66, 61);
    text-shadow: 2px 5px 6px rgba(6, 24, 41, 0.648);

}

.box-16-9 {
    width: 100%;
    height: 180px;
    aspect-ratio: 16 / 9;
    background: #ddd;
    object-fit: cover;
}

.box-small-16-9 {
    width: 100%;
    height: 100px;
    aspect-ratio: 16 / 9;
    background: #ddd;
    object-fit: cover;
}

@media (max-width: 768px) {
    #main-wrap {
        display: block !important;
        /* ghi đè d-flex */
    }

    .searchTop {
        display: none !important;
    }

    #idSearchTop {
        display: none !important;
    }

    #searchMobile {
        display: block;
    }

    .titleTuVien {
        font-size: small;
    }

    .box-16-9 {
        width: 100%;
        aspect-ratio: 16 / 9;
        height: fit-content;
    }

    .box-small-16-9 {
        width: 100%;
        aspect-ratio: 16 / 9;
        height: fit-content;
    }
}

@media (max-width: 992px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 260px;
        height: 100vh;
        background-color: #fff;
        z-index: 1050;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    #sidebar.active {
        left: 0;
    }

    #sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 1040;
    }

    #sidebar-overlay.active {
        display: block;
    }

    /* avatar - profile */
    .avatar-profile {
        width: 80px;
        /* hoặc kích thước bạn muốn */
        height: 80px;
        object-fit: cover;
        /* ảnh co lại đúng tỉ lệ, không méo */
        border-radius: 50%;
        /* bo tròn */
    }

    /* Menu ngang */
    .nav-link.active {
        background-color: white;
    }

    /* Ẩn bớt item khi silice trên điện thoại  */
    /* Chỉ hiển thị 1 card mỗi slide trên mobile */
    .carousel-item .col:nth-child(n+2) {
        display: none;
    }

}

/* Ẩn bớt item khi silice trên điện thoại  */
/* Chỉ hiển thị 1 card mỗi slide trên mobile */
/* Trên mobile, hiển thị 1 card mỗi slide */
@media (max-width: 767px) {
    .carousel-item .card {
        flex: 0 0 100%;
        margin-right: 0 !important;
    }
}