import re

file_path = 'd:/NIKKI/Feedback/final_test.html'
with open(file_path, 'r', encoding='utf-8') as f:
    content = f.read()

# Remove the FontAwesome link
content = re.sub(r'<link[^>]+href=[\'\"].*?font-awesome.*?[\'\"][^>]*>', '', content)

replacements = {
    '<i class="fa-solid fa-server"></i>': '<i class="fa-solid fa-server" style="display:flex; align-items:center; justify-content:center;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor" width="1em" height="1em"><path d="M64 32C28.7 32 0 60.7 0 96v64c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM344 152a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM424 152a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM0 288v64c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V288c0-35.3-28.7-64-64-64H64c-35.3 0-64 28.7-64 64zM344 368a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM424 368a24 24 0 1 1 0-48 24 24 0 1 1 0 48z"/></svg></i>',
    '<i class="fa-regular fa-star"></i>': '<i class="fa-regular fa-star" style="display:flex; align-items:center; justify-content:center;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor" width="1em" height="1em"><path d="M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.7 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6 68.6-141.3C270.3 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2-20.3-119.7c-1.3-7.7 1.3-15.5 6.8-21l85.9-85.1-118.3-17.4c-7.9-1.2-14.7-6.2-18.1-13.3L287.9 79z"/></svg></i>',
    '<i class="fa-regular fa-envelope"></i>': '<i class="fa-regular fa-envelope" style="display:flex; align-items:center; justify-content:center;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor" width="1em" height="1em"><path d="M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"/></svg></i>',
    '<i class="fa-solid fa-shield-halved"></i>': '<i class="fa-solid fa-shield-halved" style="display:flex; align-items:center; justify-content:center;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor" width="1em" height="1em"><path d="M256 0c4.6 0 9.2 1 13.4 2.9L457.7 82.8c22 9.3 38.4 31 38.3 57.2c-.5 99.2-41.3 280.7-213.6 363.2c-16.7 8-36.1 8-52.8 0C57.3 420.7 16.5 239.2 16 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.8 1 251.4 0 256 0zm0 66.8V444.8C394 378 431.1 230.1 432 141.4L256 66.8l0 0z"/></svg></i>',
    '<i class="fa-solid fa-globe"></i>': '<i class="fa-solid fa-globe" style="display:flex; align-items:center; justify-content:center;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor" width="1em" height="1em"><path d="M352 256c0 22.2-1.2 43.6-3.3 64H163.3c-2.2-20.4-3.3-41.8-3.3-64s1.2-43.6 3.3-64H348.7c2.2 20.4 3.3 41.8 3.3 64zm28.8-64H503.9c5.3 20.5 8.1 41.9 8.1 64s-2.8 43.5-8.1 64H380.8c2.1-20.6 3.2-42 3.2-64s-1.1-43.4-3.2-64zm112.6-32H376.7c-10-63.9-29.8-117.4-55.3-151.6c78.3 20.7 142 77.5 171.9 151.6zm-149.1 0H167.7c6.1-36.4 15.5-68.6 27-94.7c10.5-23.6 22.2-40.7 33.5-51.5C239.4 3.2 248.7 0 256 0s16.6 3.2 27.8 13.8c11.3 10.8 23 27.9 33.5 51.5c11.6 26 20.9 58.2 27 94.7zm-209 0H18.6C48.6 85.9 112.2 29.1 190.6 8.4C165.1 42.6 145.3 96.1 135.3 160zM8.1 192H131.2c-2.1 20.6-3.2 42-3.2 64s1.1 43.4 3.2 64H8.1C2.8 299.5 0 278.1 0 256s2.8-43.5 8.1-64zM194.7 446.6c-11.6-26-20.9-58.2-27-94.6H344.3c-6.1 36.4-15.5 68.6-27 94.6c-10.5 23.6-22.2 40.7-33.5 51.5C272.6 508.8 263.3 512 256 512s-16.6-3.2-27.8-13.8c-11.3-10.8-23-27.9-33.5-51.5zM135.3 352c10 63.9 29.8 117.4 55.3 151.6C112.2 482.9 48.6 426.1 18.6 352H135.3zm358.1 0c-30 74.1-93.6 130.9-171.9 151.6c25.5-34.2 45.2-87.7 55.3-151.6H493.4z"/></svg></i>',
    '<i class="fa-solid fa-headset"></i>': '<i class="fa-solid fa-headset" style="display:flex; align-items:center; justify-content:center;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor" width="1em" height="1em"><path d="M256 0C114.6 0 0 114.6 0 256v64c0 35.3 28.7 64 64 64h48c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H35.8C52.4 104.9 145.4 32 256 32c106.6 0 196.2 67.9 217.7 159.2L428.1 228.6c-7.9 15.8-24.1 25.8-41.9 27.4s-34.4-4.8-45.7-17.6l-50.6-56.9c-11.5-12.9-13.9-31.5-6.2-46.8L316.5 68c-17.8-2.6-36.1-4-54.9-4c-62.8 0-122.2 16.5-172.9 45.8c-10.7 6.2-24.1 4.3-32.9-4.5s-10.7-22.3-4.5-32.9C108.6 39.5 178.6 20 256 20c130.3 0 236 105.7 236 236v64c0 35.3-28.7 64-64 64h-32c-17.7 0-32-14.3-32-32V304c0-17.7 14.3-32 32-32h84.2C459.6 405.1 369 480 256 480c-26.6 0-52-4.4-75.6-12.6c-13.7-4.8-29 2.5-33.8 16.2s2.5 29 16.2 33.8C194.2 528.2 224.2 534 256 534c153.5 0 278-124.5 278-278V256C534 114.6 409.5 0 256 0zM112 304v80c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16zM464 304v80c0 8.8-7.2 16-16 16h-32c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16z"/></svg></i>',
    '<i class="far fa-user"></i>': '<i class="far fa-user" style="display:flex; align-items:center; justify-content:center;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor" width="1em" height="1em"><path d="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3z"/></svg></i>',
    '<i class="fas fa-crown"></i>': '<i class="fas fa-crown" style="display:flex; align-items:center; justify-content:center;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor" width="1em" height="1em"><path d="M576 136c0 22.1-17.9 40-40 40c-.2 0-.5 0-.7 0l-50.6 81c1.7 6.7 2.6 13.7 2.6 21c0 48.6-39.4 88-88 88c-30.8 0-58-15.8-73.7-39.8c-11.7 5-24.8 7.8-38.6 7.8s-26.9-2.8-38.6-7.8c-15.7 24-42.9 39.8-73.7 39.8c-48.6 0-88-39.4-88-88c0-7.3 .9-14.3 2.6-21l-50.6-81c-.2 0-.5 0-.7 0c-22.1 0-40-17.9-40-40s17.9-40 40-40c11.9 0 22.6 5.2 29.9 13.5L191.1 94.8c-1.1-5.3-1.7-10.9-1.7-16.6c0-39.8 32.2-72 72-72s72 32.2 72 72c0 5.7-.6 11.3-1.7 16.6l105.7 82.5c7.3-8.3 18-13.5 29.9-13.5c22.1 0 40 17.9 40 40zM48 400h480c26.5 0 48 21.5 48 48s-21.5 48-48 48H48c-26.5 0-48-21.5-48-48s21.5-48 48-48z"/></svg></i>',
    '<i class="fa-solid fa-circle-check"></i>': '<i class="fa-solid fa-circle-check" style="display:flex; align-items:center; justify-content:center;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor" width="1em" height="1em"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg></i>'
}

for old_tag, new_tag in replacements.items():
    content = content.replace(old_tag, new_tag)

with open(file_path, 'w', encoding='utf-8') as f:
    f.write(content)

print('Done')
