$content = [System.IO.File]::ReadAllText("sattvaparkcubix_template2.html", [System.Text.Encoding]::UTF8)

# 1. Broad Sweeps (Text)
$content = $content.Replace("Devanahalli", "Guduvanchery")
$content = $content.Replace("North Bengaluru", "South Chennai")
$content = $content.Replace("Bengaluru", "Chennai")
$content = $content.Replace("Karnataka", "Tamil Nadu")
$content = $content.Replace("Airport Road", "GST Road")
$content = $content.Replace("airport corridor", "IT corridor")
$content = $content.Replace("Park Cubix", "Shriram Shankari (Codename The View)")
$content = $content.Replace("Sattva Park Cubix", "Shriram Shankari (Codename The View)")
$content = $content.Replace("Sattva", "Shriram")
$content = $content.Replace("Salarpuria Shriram", "Shriram")
$content = $content.Replace("Salarpuria", "Shriram")
$content = $content.Replace("Shriram Group", "Shriram Properties Limited")
$content = $content.Replace("18 Acres", "36 Acres")
$content = $content.Replace("18-acre", "36-acre")
$content = $content.Replace("1,608", "1,000+")
$content = $content.Replace("79%", "70%")
$content = $content.Replace("88 Lakhs", "48 Lakhs")
$content = $content.Replace("88 L", "48 L")
$content = $content.Replace("1.25 Cr", "60 L")
$content = $content.Replace("1, 2, 2.4, and 3 BHK", "2 BHK and 3 BHK")
$content = $content.Replace("1, 2 & 3 BHK", "2 & 3 BHK")
$content = $content.Replace("13.2557", "12.8398") 
$content = $content.Replace("77.7135", "80.0526")

# Fix Title and Meta
$content = $content -replace '<title>.*?</title>', '<title>Shriram Shankari Codename The View Guduvanchery | Lake-Facing Flats</title>'
$content = $content -replace '<meta name="description".*?>', '<meta name="description" content="Discover Shriram Shankari - Codename The View in Guduvanchery, Chennai. Premium 2 & 3 BHK lake-view apartments across a 36-acre township with 50+ amenities. View real-time pricing and layout plans.">'
$content = $content -replace '<meta name="keywords".*?>', '<meta name="keywords" content="Shriram Shankari Codename The View, Shriram Shankari Guduvanchery, lake facing apartments in Chennai, flats for sale in Guduvanchery, Shriram properties GST road Chennai, ready to move township Chennai.">'

# 2. Image Swaps (Preserving HTML structure)
$content = $content.Replace("park cubix log.jpg", "The-view-logo-transparent.png")
$content = $content.Replace("park cubix bird view.jpg", "Shriram-Shankari -Elevation-2.jpg")
$content = $content.Replace("Park Cubix Entrance.jpg", "Shriram-Shankari -Elevation-2.jpg")
$content = $content.Replace("Salarpuria park cubix location map.jpg", "Shriram-Shankari -Location.jpg")
$content = $content.Replace("Park Cubix amenities.jpg", "Shriram-Shankari -Amenities-01.jpg")

$content = $content.Replace("gallery1.jpg", "Shriram-Shankari -Gallery-1.jpg")
$content = $content.Replace("gallery2.jpg", "Shriram-Shankari -Gallery-2.jpg")
$content = $content.Replace("gallery3.jpg", "Shriram-Shankari -Gallery-3.jpg")
$content = $content.Replace("gallery4.jpg", "Shriram-Shankari -Gallery-4.jpg")
$content = $content.Replace("gallery5.jpg", "Shriram-Shankari -Gallery-5.jpg")
$content = $content.Replace("gallery6.jpg", "Shriram-Shankari -Elevation-2.jpg")

# Replace floor plans images inside the specific divs
$content = $content -replace 'floor1bhk\.jpg', 'Shriram-Shankari -2bhk-Floorplan.jpg'
$content = $content -replace 'floor2bhk\.jpg', 'Shriram-Shankari -2bhk-Floorplan.jpg'
$content = $content -replace 'floor3bhk\.jpg', 'Shriram-Shankari -TOWER PLAN-2.jpg'
$content = $content -replace 'masterplan\.jpg', 'Shriram-Shankari -Tower Plan-1.jpg'


# 3. Floor Plan details mapping
$content = $content -replace '<div class="floor-type">1 BHK Apartments</div>', '<div class="floor-type">1 BHK (Sold Out)</div>'
$content = $content -replace '<div class="floor-type">2.4 BHK Apartments</div>', '<div class="floor-type">2.4 BHK (Sold Out)</div>'
$content = $content -replace '<div class="floor-type">2 BHK Apartments</div>\s*<div class="floor-size">1,009 to 1,029 sq\. ft\.</div>', '<div class="floor-type">2 BHK Apartments</div><div class="floor-size">955 to 1,100 sq. ft.</div>'
$content = $content -replace '<div class="floor-type">3 BHK Apartments</div>\s*<div class="floor-size">1,495 to 1,515 sq\. ft\.</div>', '<div class="floor-type">3 BHK Apartments</div><div class="floor-size">1,180 to 1,490 sq. ft.</div>'


# 4. About Text
$content = $content.Replace("Located just minutes from the Kempegowda International Airport", "Step into a lifestyle of tranquility and unparalleled openness at Shriram Shankari (Codename The View), a flagship 36-acre premium lakeside township crafted by Shriram Properties. Perfectly situated on Nellikuppam Road in the rapidly expanding hub of Guduvanchery, South Chennai")
$content = $content.Replace("Enjoy excellent connectivity, upcoming metro lines, and a peaceful environment away from the city's traffic, yet close to all modern conveniences.", "It features exceptionally spacious 2 BHK and 3 BHK Vaastu-compliant residences engineered with zero space wastage.")


# 5. Pricing grid details
$content = $content -replace '1 BHK\s*<span class="price-size">\(530 - 540 sq\.ft\)</span>\s*</div>\s*<div class="price-value">&#8377; 48 Lakhs\*</div>', '2 BHK <span class="price-size">(955 - 1,100 sq.ft)</span></div><div class="price-value">&#8377; 48 Lakhs*</div>'
$content = $content -replace '2 BHK\s*<span class="price-size">\(1,009 - 1,029 sq\.ft\)</span>\s*</div>\s*<div class="price-value">&#8377; 88 L\*</div>', '3 BHK <span class="price-size">(1,180 - 1,490 sq.ft)</span></div><div class="price-value">&#8377; 60 L*</div>'
$content = $content -replace '2.4 BHK\s*<span class="price-size">\(1,152 - 1,164 sq\.ft\)</span>\s*</div>\s*<div class="price-value">&#8377; 1.05 Cr\*</div>', '2 BHK Premium <span class="price-size">(1,100 sq.ft)</span></div><div class="price-value">&#8377; 58 L*</div>'
$content = $content -replace '3 BHK\s*<span class="price-size">\(1,495 - 1,515 sq\.ft\)</span>\s*</div>\s*<div class="price-value">&#8377; 60 L\*</div>', '3 BHK Premium <span class="price-size">(1,490 sq.ft)</span></div><div class="price-value">&#8377; 75 L*</div>' 


# 6. Highlights (USPs) mapping
$content = $content.Replace("Seamless Connectivity", "Scenic Lakeside Living")
$content = $content.Replace("5 mins to Airport and upcoming Blue Line Metro station", "Direct, uninterrupted panoramic lake-views with beautifully designed lakeside promenade walkways.")

$content = $content.Replace("Integrated Township", "Expansive Layout")
$content = $content.Replace("Live, work, and play in a secure 36-acre master-planned community", "A massive 36-acre mega-township containing 70% wide-open spaces, linear parks, and themed plazas.")

$content = $content.Replace("World-Class Amenities", "Thriving Community")
$content = $content.Replace("Two exclusive clubhouses and 50+ lifestyle facilities for all age groups", "Join a fully established neighborhood with more than 1,000+ families already living on-site.")

$content = $content.Replace("High ROI Potential", "Ready Infrastructure")
$content = $content.Replace("Rapid appreciation due to massive IT and infrastructure growth in Guduvanchery", "All lifestyle amenities, utilities, and a functional medical clinic are completely active and running within the premises.")


# 7. Amenities mapping
$content = $content.Replace("Outdoor Sports", "Health & Fitness")
$content = $content.Replace("Tennis courts, basketball, cricket pitch, and skating rink", "Fully-equipped gymnasium, sprawling outdoor pool, and safe jogging/cycling loops")

$content = $content.Replace("Relaxation Zones", "Convenience & Safety")
$content = $content.Replace("Meditation pavilion, butterfly garden, and landscaped seating areas", "In-house supermarket, creche facility, 24/7 security, and piped gas lines")

$content = $content.Replace("Family & Kids", "Sports & Leisure")
$content = $content.Replace("Dedicated toddlers play area, sand pits, and pet parks", "Indoor gaming room, multipurpose halls, and kids play areas with sand pits")

$content = $content.Replace("Clubhouse Features", "Power & Tech")
$content = $content.Replace("State-of-the-art gym, indoor badminton, TT, and multipurpose halls", "Reputed modular fittings, split AC points, and structured partial power backup")


# 8. Location Proximity mapping
$content = $content.Replace("Kempegowda International Airport", "Kilambakkam Bus Terminus")
$content = $content.Replace("~10 mins", "20 mins")

$content = $content.Replace("NH-207 (GST Road)", "GST Road")
$content = $content.Replace("~2 mins", "5 mins")

$content = $content.Replace("Shell Technology Centre", "Outer Ring Road (ORR)")
$content = $content.Replace("~15 mins", "10 mins")

$content = $content.Replace("KIADB IT Park", "Estancia IT Park")
$content = $content.Replace("~12 mins", "7 km")

$content = $content.Replace("Decathlon Anantapur", "Shriram The Gateway IT")
$content = $content.Replace("~18 mins", "14 km")

$content = $content.Replace("Akash International School", "Velammal Vidhyashram")
$content = $content.Replace("~8 mins", "2 km")

$content = $content.Replace("Manipal Hospital (Upcoming)", "SRM Public School")
$content = $content.Replace("~10 mins", "3 km")

$content = $content.Replace("Aster CMI Hospital", "SRM University Campus")
$content = $content.Replace("~30 mins", "8.9 km")

$content = $content.Replace("Retail & Leisure", "Educational Hubs")
$content = $content.Replace("Esteem Mall", "VIT Chennai Campus")


# 9. FAQ Mapping (avoid en-dashes and parenthesis issues)
$content = $content.Replace("Where is Shriram Shankari (Codename The View) located?", "Is Shriram Shankari Codename The View ready to move in?")

# Replace the text inside the answer safely
$content = $content -replace '(?s)<div class="faq-answer">\s*<p>.*?just minutes from Kempegowda International Airport.*?<\/p>\s*<\/div>', '<div class="faq-answer"><p>Yes, Shriram Shankari (Codename The View) is a fully completed, ready-to-move-in township project. Hundreds of families are already residing within the gated community, and all major clubhouse amenities are fully functional.</p></div>'

$content = $content.Replace("What apartment configurations are available at Shriram Shankari (Codename The View)?", "What are the apartment sizes available at Shriram Shankari Guduvanchery?")
$content = $content -replace '(?s)<div class="faq-answer">\s*<p>.*?catering to all family sizes and budgets\.<\/p>\s*<\/div>', '<div class="faq-answer"><p>The project offers spacious, Vaastu-compliant flats. 2 BHK units range from 955 to 1,100 sq. ft., while 3 BHK configurations range from 1,180 to 1,490 sq. ft.</p></div>'


$content = $content.Replace("Is Shriram Shankari (Codename The View) RERA registered?", "What are the closest landmark hubs to the project?")
$content = $content -replace '(?s)<div class="faq-answer">\s*<p>.*?ensuring legal compliance and buyer protection\.<\/p>\s*<\/div>', '<div class="faq-answer"><p>The township is situated on Nellikuppam Road in Perumattunallur, right next to a natural lake. Key landmarks nearby include Velammal Vidhyashram school (2 km) and the Estancia IT Park (7 km) off GST Road.</p></div>'


[System.IO.File]::WriteAllText("index.html", $content, [System.Text.Encoding]::UTF8)
