@media (min-width: 1900px) {
    .container {
        width: 1600px;
    }
}

@media (min-width: 1600px) {
    .container {
        width: 1400px;
    }
}

@media screen and (min-width: 992px) and (max-width: 1500px) {
    /* Hero section */
    .hero {
        padding: 20px 60px;
        height: 500px;
    }
    .nav-wrapper {
        margin-right: 0px;
    }

    .hero-text p:first-child {
        font-size: 56px;
    }

    /* Course items */
    .course-item-new {
        width: 22%;
    }

    /* Recommend classes */
    .recommend-classes {
        padding: 100px 0;
    }

    .recommend-classes .course-item-new {
        width: 28%;
        padding: 0 30px;
    }

    .recommend-classes .course-item-new p {
        font-size: 32px;
    }

    /* Card adjustments */
    .cards {
        gap: 3%;
        justify-content: space-between;
    }

    .card {
        width: 30%;
        padding: 16px 20px;
    }

    /* Fixed height cards */
    .news-card, .group-card {
        height: 400px;
        overflow-y: auto;
    }

    /* Scrollbar customization */
    .news-card::-webkit-scrollbar,
    .group-card::-webkit-scrollbar {
        width: 6px;
    }

    .news-card::-webkit-scrollbar-track,
    .group-card::-webkit-scrollbar-track {
        background: #F1F1F1;
        border-radius: 3px;
    }

    .news-card::-webkit-scrollbar-thumb,
    .group-card::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }

    /* Card content */
    .news-card li,
    .group-card li {
        margin-bottom: 16px;
        padding-right: 8px;
    }

    .card-label {
        font-size: 24px;
    }

    .card-info {
        font-size: 14px;
    }

    .card-avatar {
        width: 32px;
        height: 32px;
    }

    .card-avatar-group {
        width: 40px;
        height: 40px;
    }

    .card-rating {
        margin-top: 8px;
    }

    .card-quantity {
        column-gap: 6px;
    }

    .card-quantity img {
        width: 20px;
    }

    .card-title {
        margin-bottom: 16px;
    }

    .pen {
        width: 10px;
        height: 28px;
        margin-right: 12px;
    }

    .card ul {
        margin-top: 12px;
    }

    .group-card .card-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .latest-news .card-info {
        line-height: 1.4;
    }

    /* Font sizes */
    .size-48 {
        font-size: 40px;
    }

    .size-36 {
        font-size: 32px;
    }

    .size-28 {
        font-size: 24px;
    }

    .teacher-card {
        width: 30%;
    }

    .nav-button {
        margin: 16px 24px;
    }
}

/* Tablet (768px - 991px) */
@media screen and (max-width: 991px) {
    .header-left {
        gap: 1rem;
    }

    .main-nav {
        display: none;
    }

    .hero {
        flex-direction: column;
        height: auto;
        padding: 40px 20px;
        text-align: center;
    }

    .hero-text {
        max-width: 100%;
        margin-bottom: 40px;
    }

    .hero-image {
        max-width: 80%;
    }

    .course-item-new {
        width: 45%;
    }

    .cards {
        flex-wrap: wrap;
    }

    .card {
        width: 45%;
        margin-bottom: 20px;
    }

    .recommend-classes {
        padding: 40px 15px;
        margin: 0 auto;
        position: relative; /* Thêm position relative */
    }

    .recommend-classes label {
        font-size: 20px;
        position: absolute;
        top: 20px; /* Điều chỉnh vị trí */
        /* left: 50%; /* Căn giữa */
        */ /* transform: translateX(-50%); /* Căn giữa */ */
        background-color: var(--white);
        padding: 8px 16px;
        border-radius: 30px;
        z-index: 1; /* Đảm bảo hiển thị trên cùng */
    }

    .recommend-classes .course-item-new {
        width: 50%;
        margin: 60px auto 15px; /* Thêm margin-top để tránh đè lên title */
        border-radius: 30px;
        padding: 15px;
    }

    .recommend-classes .course-item-new img {
        border-radius: 20px;
        max-width: 90%; /* Giới hạn kích thước ảnh */
        margin: 0 auto; /* Căn giữa ảnh */
    }

    .recommend-classes .course-item-new p {
        font-size: 20px;
        margin: 10px 0;
    }

    .class-info-new {
        margin: 16px 0;
    }

    .students {
        font-size: 16px;
    }

    .teacher-card {
        width: 30%;
        padding: 16px;
    }

    .teacher-avatar {
        width: 80px;
        border-radius: 50%;
        margin-top: -36px;
    }

    .nav-button {
        margin: 16px 24px;
    }

    .recommended-teachers-section .title {
        top: -26%;
        font-size: 40px;
    }

    .recommended-teachers-section .background div {
        width: 60%;
        height: 100%;
    }

    .recommended-teachers-section .background div:nth-child(4), .recommended-teachers-section .background div:nth-child(5), .recommended-teachers-section .background div:nth-child(6) {
        width: 63%;
    }

    .recommended-teachers-section .background div:nth-child(4) {
        top: -24%;
        left: -22%;
    }

    .recommended-teachers-section .background div:nth-child(5) {
        top: -44%;
    }

    .recommended-teachers-section .background div:nth-child(6) {
        top: -24%;
        right: -22%;
    }
}

/* Mobile (< 768px) */
@media screen and (max-width: 767px) {
    .size-48 {
        font-size: 32px;
    }

    .size-36 {
        font-size: 28px;
    }

    .size-28 {
        font-size: 20px;
    }

    .size-24 {
        font-size: 18px;
    }

    .size-22 {
        font-size: 16px;
    }

    .size-20 {
        font-size: 14px;
    }

    .header-right {
        gap: 1rem;
    }

    .search-box input {
        width: 160px;
    }

    .hero-text p:first-child {
        font-size: 36px;
        margin: 16px 0;
    }

    .hero-text button {
        font-size: 32px;
        margin-top: 48px;
    }

    .courses {
        padding: 32px 20px;
    }

    .course-item-new {
        width: 100%;
    }

    .card {
        width: 100%;
    }

    .teacher-card {
        width: 100%;
        margin-bottom: 36px;
    }

    .footer {
        padding: 32px 20px;
    }

    .footer-content {
        flex-direction: column;
    }

    .footer .logo {
        max-width: 50%;
        margin: 0 auto 20px;
    }

    .recommend-classes {
        padding: 30px 10px;
    }

    .recommend-classes label {
        font-size: 18px;
        top: 15px;
        padding: 6px 14px;
    }

    .recommend-classes .course-item-new {
        width: 85%;
        margin: 50px auto 12px; /* Điều chỉnh margin cho phù hợp */
        padding: 12px;
        border-radius: 25px;
    }

    .recommend-classes .course-item-new img {
        max-width: 85%;
    }

    .recommend-classes .course-item-new p {
        font-size: 18px;
        margin: 8px 0;
    }

    .recommend-classes .join-button {
        font-size: 18px;
        padding: 6px 20px;
        margin: 8px 0 24px;
    }

    .nav-button {
        width: 35px;
        height: 50px;
    }


    .recommended-teachers-section .background div {
        width: 60%;
        height: 50%;
    }

    .recommended-teachers-section .background div:first-child {
        top: -10%;
    }

    .recommended-teachers-section .background div:nth-child(2) {
        top: -20%;
    }

    .recommended-teachers-section .background div:nth-child(3) {
        top: -10%;
    }

    .recommended-teachers-section .background div:nth-child(4) {
        top: -12%;
    }

    .recommended-teachers-section .background div:nth-child(5) {
        top: -22%;
    }

    .recommended-teachers-section .background div:nth-child(6) {
        top: -12%;
    }

    .recommended-teachers-section .title {
        top: -10%;
        font-size: 28px;
        max-width: 200px;
    }
}

/* Mobile nhỏ (< 576px) */
@media screen and (max-width: 575px) {
    .logo img {
        margin-left: 15px;
    }
    .header {
        padding: 2px 8px;
    }
    .flex-responsive {
            flex-direction: column;
    }
    .highschool .course-detail-bottom {
        flex-direction: column
    }
    .search-box {
        display: none;
    }

    .nav-icons {
        gap: 1rem;
    }

    .hero-text p:first-child {
        font-size: 32px;
    }

    .hero-text button {
        font-size: 28px;
        padding: 8px 24px;
    }

    .recommend-classes {
        padding: 20px 8px;
    }

    .recommend-classes label {
        font-size: 16px;
        top: 12px;
        padding: 5px 12px;
    }

    .recommend-classes .course-item-new {
        width: 90%;
        margin: 45px auto 10px; /* Điều chỉnh margin cho phù hợp */
        padding: 10px;
        border-radius: 20px;
    }

    .recommend-classes .course-item-new img {
        max-width: 80%;
        border-radius: 15px;
    }

    .recommend-classes .course-item-new p {
        font-size: 16px;
        margin: 6px 0;
    }

    .recommend-classes .join-button {
        font-size: 16px;
        padding: 5px 16px;
        margin: 6px 0 20px;
    }

    .class-info-new {
        margin: 12px 0;
        flex-direction: column;
        gap: 10px;
    }

    .recommended-teachers-section {
        margin-top: 150px;
    }

    .recommended-teachers-section .background div {
        width: 60%;
        height: 30%;
    }

    .recommended-teachers-section .background div:first-child {
        top: -5%;
    }

    .recommended-teachers-section .background div:nth-child(2) {
        top: -12%;
    }

    .recommended-teachers-section .background div:nth-child(3) {
        top: -5%;
    }

    .recommended-teachers-section .background div:nth-child(4) {
        top: -7%;
    }

    .recommended-teachers-section .background div:nth-child(5) {
        top: -14%;
    }

    .recommended-teachers-section .background div:nth-child(6) {
        top: -7%;
    }

    .recommended-teachers-section .title {
        top: -50px;
    }
}