/* Màn hình nhỏ (mobile) */
  @media (max-width: 479px) {
    /* Nền gradient cho toàn trang */
    body {
        font-family: Arial, Helvetica, sans-serif;
        background-color: #984063;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start; /* Căn sát lề trên */
        height: auto;
        margin: 0;
        padding-bottom: 120px; /* Chừa khoảng trống để không bị che bởi các nút */
    }

    /* Align menu-toggle and navbar on the same row */
    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0px;
        margin: 5px 0px 5px 0px;
        background-color: none;
    }

    /* Navigation Bar on TOP */
    .navbar {
        padding: 0px;
        flex-grow: 1;
    }

    .navbar ul {
        list-style: none;
        display: flex;
        justify-content: flex-end; /* Align items to the right */
        margin: 0;
        padding: 0;
    }

    .navbar li {
        margin: 0px 3px 0px 3px; /* Default margin */
    }

    .navbar a {
        text-decoration: none;
        color: white;
        background-color: #991c1f;
        font-size: 14px;
        font-weight: bold;
        padding: 8px 12px; /* Adjusted padding */
        border-radius: 5px; /* Rounded corners */
        transition: background 0.3s ease;
    }

    .navbar a:hover {
        background-color: #000000; /* Hover effect */
    }

    .navbar a.active {
        background-color: #cc4e50; /* Highlighted color */
        color: white;
        font-weight: bold;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Elevated effect */
    }

    /* Toggle Menu Styles */
    .menu-toggle {
        position: relative;
        display: inline-block;
        margin-right: 2px;
    }

    #toggleMenuButton {
        background-color: #333;
        color: white;
        border: none;
        padding: 8px 12px;
        font-size: 14px;
        cursor: pointer;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    #toggleMenuButton:hover {
        background-color: #444;
    }

    /* Modal Styles */
    .modal {
        display: none; /* Ẩn modal mặc định */
        z-index: 1000;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Nền bán trong suốt */
        justify-content: center; /* Căn giữa theo chiều ngang */
        align-items:flex-start; /* Căn giữa theo chiều dọc */
        position: fixed; /* Đảm bảo modal cố định trên màn hình */
        top: 20px;
        left: 0;
    }

    .modal-content {
        background-color: #fff;
        padding: 20px;
        border-radius: 10px;
        width: 80%;
        max-width: 400px; /* Giới hạn chiều rộng tối đa */
        margin: 0 auto; /* Căn giữa modal */
        max-height: 80vh; /* Chiều cao tối đa là 80% chiều cao viewport */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        text-align: center;
        position: relative; /* Đảm bảo các phần tử con được định vị tương đối */
        overflow-y: auto; /* Bật cuộn dọc nếu nội dung vượt quá chiều cao */
    }

    .modal-content ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .modal-content ul li {
        margin: 10px 0;
    }

    .modal-content ul li a {
        text-decoration: none;
        color: #333;
        font-size: 14px;
        font-weight: bold;
        padding: 10px 15px;
        display: block;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    .modal-content ul li a:hover {
        background-color: #f0f0f0;
        color: #991c1f;
    }

    .close-button {
        position: absolute;
        top: 10px;
        right: 10px;
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: #333;
        transition: color 0.3s ease;
    }

    .close-button:hover {
        color: #991c1f;
    }

  }

  /* Màn hình trung bình (tablet) */
  @media (min-width: 480px) and (max-width: 767px) {
    /* Nền gradient cho toàn trang */
    body {
        font-family: Arial, Helvetica, sans-serif;
        background-color: #984063;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start; /* Căn sát lề trên */
        height: auto;
        margin: 0;
        padding-bottom: 120px; /* Chừa khoảng trống để không bị che bởi các nút */
    }

    /* Align menu-toggle and navbar on the same row */
    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0px;
        margin: 5px 0px 5px 0px;
        background-color: none;
    }

    /* Navigation Bar on TOP */
    .navbar {
        padding: 0px;
        flex-grow: 1;
    }

    .navbar ul {
        list-style: none;
        display: flex;
        justify-content: flex-end; /* Align items to the right */
        margin: 0;
        padding: 0;
    }

    .navbar li {
        margin: 0px 3px 0px 3px; /* Default margin */
    }

    .navbar a {
        text-decoration: none;
        color: white;
        background-color: #991c1f;
        font-size: 14px;
        font-weight: bold;
        padding: 8px 12px; /* Adjusted padding */
        border-radius: 5px; /* Rounded corners */
        transition: background 0.3s ease;
    }

    .navbar a:hover {
        background-color: #000000; /* Hover effect */
    }

    .navbar a.active {
        background-color: #cc4e50; /* Highlighted color */
        color: white;
        font-weight: bold;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Elevated effect */
    }

    /* Toggle Menu Styles */
    .menu-toggle {
        position: relative;
        display: inline-block;
        margin-right: 2px;
    }

    #toggleMenuButton {
        background-color: #333;
        color: white;
        border: none;
        padding: 8px 12px;
        font-size: 14px;
        cursor: pointer;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    #toggleMenuButton:hover {
        background-color: #444;
    }

    /* Modal Styles */
    .modal {
        display: none; /* Ẩn modal mặc định */
        z-index: 1000;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Nền bán trong suốt */
        justify-content: center; /* Căn giữa theo chiều ngang */
        align-items: flex-start; /* Căn giữa theo chiều dọc */
        position: fixed; /* Đảm bảo modal cố định trên màn hình */
        top: 50px;
        left: 0;
    }

    .modal-content {
        background-color: #fff;
        padding: 20px;
        border-radius: 10px;
        width: 90%;
        max-width: 400px; /* Giới hạn chiều rộng tối đa */
        margin: 0 auto; /* Căn giữa modal */
        max-height: 80vh; /* Chiều cao tối đa là 80% chiều cao viewport */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        text-align: center;
        position: relative; /* Đảm bảo các phần tử con được định vị tương đối */
        overflow-y: auto; /* Bật cuộn dọc nếu nội dung vượt quá chiều cao */
    }

    .modal-content ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .modal-content ul li {
        margin: 10px 0;
    }

    .modal-content ul li a {
        text-decoration: none;
        color: #333;
        font-size: 16px;
        font-weight: bold;
        padding: 10px 15px;
        display: block;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    .modal-content ul li a:hover {
        background-color: #f0f0f0;
        color: #991c1f;
    }

    .close-button {
        position: absolute;
        top: 10px;
        right: 10px;
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: #333;
        transition: color 0.3s ease;
    }

    .close-button:hover {
        color: #991c1f;
    }

  }

  /* Màn hình lớn (tablet) */
  @media (min-width: 768px) and (max-width: 1023px) {
    /* Nền gradient cho toàn trang */
    body {
        font-family: Arial, Helvetica, sans-serif;
        background-color: #984063;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start; /* Căn sát lề trên */
        height: auto;
        margin: 0;
    }

    /* Align menu-toggle and navbar on the same row */
    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0px;
        margin: 5px 0px 5px 0px;
        background-color: none;
    }

    /* Navigation Bar on TOP */
    .navbar {
        padding: 0px;
        flex-grow: 1;
    }

    .navbar ul {
        list-style: none;
        display: flex;
        justify-content: flex-end; /* Align items to the right */
        margin: 0;
        padding: 0;
    }

    .navbar li {
        margin: 0px 3px 0px 3px; /* Default margin */
    }

    .navbar a {
        text-decoration: none;
        color: white;
        background-color: #991c1f;
        font-size: 14px;
        font-weight: bold;
        padding: 8px 12px; /* Adjusted padding */
        border-radius: 5px; /* Rounded corners */
        transition: background 0.3s ease;
    }

    .navbar a:hover {
        background-color: #000000; /* Hover effect */
    }

    .navbar a.active {
        background-color: #cc4e50; /* Highlighted color */
        color: white;
        font-weight: bold;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Elevated effect */
    }

    /* Toggle Menu Styles */
    .menu-toggle {
        position: relative;
        display: inline-block;
        margin-right: 2px;
    }

    #toggleMenuButton {
        background-color: #333;
        color: white;
        border: none;
        padding: 8px 12px;
        font-size: 14px;
        cursor: pointer;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    #toggleMenuButton:hover {
        background-color: #444;
    }

    /* Modal Styles */
    .modal {
        display: none; /* Ẩn modal mặc định */
        z-index: 1000;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Nền bán trong suốt */
        justify-content: center; /* Căn giữa theo chiều ngang */
        align-items: center; /* Căn giữa theo chiều dọc */
        position: fixed; /* Đảm bảo modal cố định trên màn hình */
        top: 0;
        left: 0;
    }

    .modal-content {
        background-color: #fff;
        padding: 20px;
        border-radius: 10px;
        width: 90%;
        max-width: 400px; /* Giới hạn chiều rộng tối đa */
        margin: 0 auto; /* Căn giữa modal */
        max-height: 80vh; /* Chiều cao tối đa là 80% chiều cao viewport */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        text-align: center;
        position: relative; /* Đảm bảo các phần tử con được định vị tương đối */
        overflow-y: auto; /* Bật cuộn dọc nếu nội dung vượt quá chiều cao */
    }

    .modal-content ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .modal-content ul li {
        margin: 10px 0;
    }

    .modal-content ul li a {
        text-decoration: none;
        color: #333;
        font-size: 16px;
        font-weight: bold;
        padding: 10px 15px;
        display: block;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    .modal-content ul li a:hover {
        background-color: #f0f0f0;
        color: #991c1f;
    }

    .close-button {
        position: absolute;
        top: 10px;
        right: 10px;
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: #333;
        transition: color 0.3s ease;
    }

    .close-button:hover {
        color: #991c1f;
    }

  }
  
  /* Màn hình lớn (desktop) */
  @media (min-width: 1024px) {

    /* Nền gradient cho toàn trang */
    body {
        font-family: Arial, Helvetica, sans-serif;
        background-color: #984063;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start; /* Căn sát lề trên */
        height: auto;
        margin: 0;
    }

    /* Align menu-toggle and navbar on the same row */
    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0px;
        margin: 5px 0px 5px 0px;
        background-color: none;
    }

    /* Navigation Bar on TOP */
    .navbar {
        padding: 0px;
        flex-grow: 1;
    }

    .navbar ul {
        list-style: none;
        display: flex;
        justify-content: flex-end; /* Align items to the right */
        margin: 0;
        padding: 0;
    }

    .navbar li {
        margin: 0px 3px 0px 3px; /* Default margin */
    }

    .navbar a {
        text-decoration: none;
        color: white;
        background-color: #991c1f;
        font-size: 14px;
        font-weight: bold;
        padding: 8px 12px; /* Adjusted padding */
        border-radius: 5px; /* Rounded corners */
        transition: background 0.3s ease;
    }

    .navbar a:hover {
        background-color: #000000; /* Hover effect */
    }

    .navbar a.active {
        background-color: #cc4e50; /* Highlighted color */
        color: white;
        font-weight: bold;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Elevated effect */
    }

    /* Toggle Menu Styles */
    .menu-toggle {
        position: relative;
        display: inline-block;
        margin-right: 2px;
    }

    #toggleMenuButton {
        background-color: #333;
        color: white;
        border: none;
        padding: 8px 12px;
        font-size: 14px;
        cursor: pointer;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    #toggleMenuButton:hover {
        background-color: #444;
    }

    /* Modal Styles */
    .modal {
        display: none; /* Ẩn modal mặc định */
        z-index: 1000;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Nền bán trong suốt */
        justify-content: center; /* Căn giữa theo chiều ngang */
        align-items: center; /* Căn giữa theo chiều dọc */
        position: fixed; /* Đảm bảo modal cố định trên màn hình */
        top: 0;
        left: 0;
    }

    .modal-content {
        background-color: #fff;
        padding: 20px;
        border-radius: 10px;
        width: 90%;
        max-width: 400px; /* Giới hạn chiều rộng tối đa */
        margin: 0 auto; /* Căn giữa modal */
        max-height: 80vh; /* Chiều cao tối đa là 80% chiều cao viewport */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        text-align: center;
        position: relative; /* Đảm bảo các phần tử con được định vị tương đối */
        overflow-y: auto; /* Bật cuộn dọc nếu nội dung vượt quá chiều cao */
    }

    .modal-content ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .modal-content ul li {
        margin: 10px 0;
    }

    .modal-content ul li a {
        text-decoration: none;
        color: #333;
        font-size: 16px;
        font-weight: bold;
        padding: 10px 15px;
        display: block;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    .modal-content ul li a:hover {
        background-color: #f0f0f0;
        color: #991c1f;
    }

    .close-button {
        position: absolute;
        top: 10px;
        right: 10px;
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: #333;
        transition: color 0.3s ease;
    }

    .close-button:hover {
        color: #991c1f;
    }

  }


