* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.header {
    background-color: #fff;
}

.header h1 {
    color: #333;
}

.tuhoc {
    width: 100%;
}

.tuhoc img {
    width: 250px;
    height: auto;
    border-radius: 5px;
}

.nganh {
    display: grid;
    grid-template-columns: auto auto;
    padding: 100px 0;
}

.thieu {
    background-color: rgb(206, 226, 214);
}

.items {
    display: grid;
    grid-template-columns: auto auto auto auto;
    gap: 25px;
    align-content: center;
    justify-content: center;
}

.logo p {
    text-align: center;
    font-weight: 600;
    font-size: 30px;
    opacity: 0.4;
    margin: 10px 0;
}

.dong .content, .items {
    padding-left: 10px;
}

.thieu .content, .items {
    padding-right: 10px;
}

.dong {
    padding-left: 100px;
}

.thieu {
    padding-right: 100px;
}

.content {
    justify-content: center;
    align-content: center;
}

.content p {
    text-align: justify;
    line-height: 1.5;
    font-size: 20px;
    font-family: Helvetica, Arial, sans-serif;
    padding-top: 24px;
}

.content h2 {
    font-family: Helvetica, Arial, sans-serif;
    line-height: 1.2;
    text-transform: uppercase;
    font-size: 30px;
    position: relative;
}

.content h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -17px;
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, #d933fe, #3751f6);
}

@media screen and (max-width: 1450px) {
    .items {
        display: flex;
        flex-flow: row wrap;
    }
}

@media screen and (max-width: 1270px) {
    .items {
        display: flex;
        flex-flow: column;
    }

    .tuhoc img {
        width: 125px;
        height: auto;
        border-radius: 5px;
    }

    .dong {
        padding-left: 0;
    }

    .thieu {
        padding-right: 0;
    }

    .logo p {
        text-align: center;
        font-weight: 600;
        font-size: 20px;
        opacity: 0.4;
        margin: 10px 0;
    }

    .nganh {
        display: grid;
        grid-template-columns: auto auto;
        padding: 10px 0;
    }

}


/* Phần này là của Nhân */
.tien_than {
    width: 100%;
    height: auto; /* Luôn mở rộng theo đúng chiều cao bên trong */
    background-color: rgb(206, 226, 214);
    padding: 2.5rem 0;
}

.tien_than .grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /*Nếu muốn layout linh hoạt trên mọi kích thước màn hình, thì sử dụng auto-fit, không cần dùng template-rows*/
    gap: 0.5rem;
    justify-content: center; /* Căn giữa thay vì space-around */
    align-content: space-around;
    margin: 0 auto;
    padding: 0 0.5rem;
    max-width: calc(4 * 300px + 3 * 0.5rem); /* Tổng chiều rộng tối đa */
}

.grid-item {
    position: relative; /* Tạo lớp chồng lên ảnh */
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 2px solid rgb(85, 85, 85);
    overflow: hidden;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9; /* Tỉ lệ giống với 300px và 170px */
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}

.tien_than .grid-container .grid-item:hover {
    cursor: pointer;
}

.tien_than .grid-container .grid-item .overlay {
    position: absolute; /* Tạo lớp chồng lên ảnh */
    background: linear-gradient(to right, cornflowerblue, rgba(188, 206, 251, 0.7)); /* Màu nền không che khuất hoàn toàn ảnh */
    color: #fff;
    font-size: 20px;
    width: 100%;
    height: 100%;
    text-align: center;
    padding: 100px 0.5rem 0.5rem 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tien_than .grid-container .grid-item:hover .overlay {
    opacity: 1; /* Tạo lớp chồng lên ảnh */
}

.grid-item a {
    display: block;
    width: 100%;
}

.grid-item a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: bottom;
    display: block;
}

.tien_than > h2 {
    font-size: 2.2rem;
    font-weight: 500;
    color: rgb(99, 40, 222);
    text-align: center;
    margin-bottom: 2rem;
}

.d-grid > button {
    margin-top: 2rem;
}

@media screen and (max-width: 768px) {
    .tien_than .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Phần của Nhân đến đây là hết */
/* phần của Thủy */
.tu-lieu {
    background-color: rgb(206 226 214);
    color: blue;
    font-size: 20px;
    margin-bottom: 10px;
    padding: 7rem 0;
    text-align: center;
    font-weight: bold;
    height: 29rem;
}

.grid-container-tulieu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    justify-content: center;
    align-content: center;
    column-gap: 15px;
    max-width: calc(4 * 300px + 3 * 0.5rem);
    margin: 0 auto;
}

.grid-item-tulieu {
    position: relative;

}

.grid-container-tulieu img {
    display: block;
    width: 100%;
    height: 250px;
    border-radius: 15px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.4);
    object-fit: cover;
}

.grid-item-tulieu::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
            to bottom,
            rgba(26, 24, 24, 0), /* điểm đầu: trong suốt */ rgba(26, 24, 24, 0.4) /* điểm cuối: xám mờ 40% */
    );
    border-radius: 15px;
    pointer-events: none; /* Cho phép các sự kiện hover tác dụng lên phần tử bên dưới */
    z-index: 1;
}

.grid-item-tulieu a:hover {
    cursor: pointer;
    opacity: 0.6;
}

.tu-lieu .grid-container-tulieu .grid-item-tulieu .text-overlay1 {
    position: absolute;
    color: white;
    font-weight: 600;
    font-size: 20px;
    bottom: 15px;
    left: 0;
    right: 0;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 5;
}

@media screen and (max-width: 1000px) {
    .tu-lieu {
        font-size: 16px;
        height: auto;
        display: block;
        text-align: center;
        margin-bottom: 10px;
        padding: 8rem 2% 2rem;
    }

    .tu-lieu p {
        margin: 0 0 10px;
        font-weight: bold;
        font-size: 24px;
    }

    .grid-container-tulieu {
        margin-bottom: 10px;
        row-gap: 10px;
    }
}

.an-cat {
    height: 50vh;
}

.an-cat {
    height: 100%;
    display: flex;
    grid-template-columns: 1fr 2fr;
    justify-content: center;
    align-content: center;
}

.an-cat-img {
    padding: 3%;
    margin-left: 20px;
    width: 100%;
    /* display: flex; */

    border-radius: 15px;
}

.an-cat a:hover {
    opacity: 0.6;
    cursor: pointer;
}

.an-cat-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: justify;
    align-content: center;
    justify-content: center;
}

.an-cat-content h2 {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.an-cat-content h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -17px;
    width: 10rem;
    height: 5px;
    background: linear-gradient(to right, #5da7fc, #6277ff);
}

@media screen and (max-width: 800px) {
    .an-cat {
        grid-template-columns: 1fr; /* Chuyển sang 1 cột duy nhất */
        /* height: auto;                Cho phép container tự điều chỉnh chiều cao */
        padding: 20px; /* Tùy chọn thêm khoảng cách */
    }

    .an-cat-img {
        margin: 0 auto; /* Canh giữa ảnh */
        width: 50%;
        justify-content: center;
        align-content: center;
        /* height: auto;                Giữ tỷ lệ hình ảnh */
        /* Sử dụng phần trăm để ảnh co giãn */
    }

    .an-cat-content {
        width: 50%; /* Điều chỉnh width theo phần trăm */
        padding: 20px; /* Giảm padding cho phù hợp với màn hình nhỏ */
        margin: 0 auto; /* Canh giữa nội dung */
    }
}

/*Tran Duc Lap*/
.footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Làm cho .contact và .container cùng nằm trên cùng 1 line */
    font-family: Arial, sans-serif;
    margin: 40px 0 20px 0;
}

.contact {
    font-size: 13px;
    position: relative;
    left: 2rem;
    padding-left: 1rem;
}

.footer .container {
    display: grid;
    grid-template-areas: "section1 section2 section3"
                        "section4 section5 section6";
    position: relative;
    left: 4rem;
    padding-right: 1rem;
}

.section1 {
    grid-area: section1;
}

.section2 {
    grid-area: section2;
}

.section3 {
    grid-area: section3;
}

.section4 {
    grid-area: section4;
}

.section5 {
    grid-area: section5;
}

.section6 {
    grid-area: section6;
}

.footer h4 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer li {
    margin-bottom: 5px;
}

@media screen and (max-width: 768px) {
    .contact {
        position: relative;
        top: 1rem;
        left: 0;
    }

    .footer .container {
        position: relative;
        left: 0;
        top: 1rem;
        bottom: 1rem;
    }
}

/*viet anh*/
.navbar {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 0.5rem 64px;
    color: #005c01;
    position: fixed;
    z-index: 20;
    width: 100%;
}


.logo {
    font-size: 28px;
    font-weight: bold;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}


.nav-links li {
    margin: 0 8px;
    padding: 12px 4px 12px 4px;
    position: relative;
}

.nav-links li:hover {
    color: white; /* Màu chữ khi hover */
    background-color: blueviolet;
}

.nav-links li a {
    text-decoration: none;
    color: #555555;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.login {
    display: block;
    font-size: 15px;
    cursor: pointer;
}

.nav-links > li:hover > a, .submenu li:hover a {
    color: white;
}

.nav-links li:hover .submenu {
    visibility: visible;
    opacity: 1;
}

.submenu {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    padding: 0;
    background-color: white;
    min-width: 208px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: all 0.3s;
}


.submenu li {
    display: block;
    margin: 0;
    padding: 16px 0;
}


.submenu li a {
    color: #555555;
    font-size: 20px;
    display: block;
    padding: 0 12px;
    text-decoration: none;
}

.navbar-toggler {
    display: none;
    cursor: pointer;
}

.offcanvas {
    background-color: rgb(40, 135, 87);
}

.offcanvas-header h5 {
    color: white;
}

.offcanvas .offcanvas-body ul li a {
    color: white;
}

.dropdown-item {
    color: rgb(40, 135, 87) !important;
}

.offcanvas-body ul li:hover {
    background-color: blueviolet;
}

@media (max-width: 1228px) {
    .navbar {
        padding: 1rem;
        height: 6rem;
    }

    .nav-links {
        display: none;
    }

    .navbar-toggler {
        display: block;
        margin-left: auto;
        padding: 16px;
    }

    .login {
        margin: 0 1rem;
    }

    .logo {
        margin-left: 1rem;
    }
}

#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 3.75rem;
    height: 3.75rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}