file_path = r'c:\MyCode\MyLaravel\tatabatubelitung\resources\views\home.blade.php'

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

old_center_and_right = '''            <!-- CENTER: Logo / Resort Title (Compact Height Container h-10) -->
            <div class="flex items-center justify-center text-center h-10">
                <!-- Hero state (Before Scroll): Emblem logo + subtext -->
                <div x-show="!isScrolled" class="flex flex-col items-center justify-center">
                    <img src="/assets/images/TATABATU-LOGO-WHITE.png" 
                         alt="Tatabatu Belitung Logo" 
                         class="h-6 md:h-7 w-auto object-contain">
                    <span class="mt-0.5 text-[8px] md:text-[9px] tracking-[0.25em] font-light text-white/90 uppercase">
                        TATABATU BELITUNG RESORT
                    </span>
                </div>

                <!-- Scrolled state (After Scroll): Horizontal serif title in Navy Blue -->
                <div x-show="isScrolled" x-cloak class="flex items-center justify-center">
                    <span style="font-family: \'Cormorant Garamond\', serif; color: #0b1d3a;" 
                          class="text-xs md:text-sm tracking-[0.25em] font-semibold uppercase">
                        TATABATU BELITUNG RESORT
                    </span>
                </div>
            </div>

            <!-- RIGHT: SIGN IN & BOOK NOW Buttons -->
            <div class="flex items-center space-x-3 md:space-x-5">
                <a href="#signin" 
                   class="hidden sm:inline-block text-[10px] tracking-[0.2em] font-medium uppercase transition-colors duration-300"
                   :style="isScrolled ? \'color: #0b1d3a;\' : \'color: rgba(255,255,255,0.9);\':">
                    SIGN IN
                </a>

                <a href="#book" 
                   class="inline-flex items-center justify-center px-4 py-1.5 md:px-5 md:py-2 text-[10px] tracking-[0.2em] font-medium uppercase transition-all duration-300 shadow-xs"
                   :style="isScrolled ? \'background-color: #0b1d3a; color: #ffffff;\' : \'background-color: transparent; color: #ffffff; border: 1px solid rgba(255,255,255,0.8);\':">
                    BOOK NOW
                </a>
            </div>'''

new_center_and_right = '''            <!-- CENTER: Logo -->
            <div class="flex items-center justify-center text-center">
                <!-- Hero state (Before Scroll): Enlarged White Logo -->
                <a href="/" x-show="!isScrolled" class="flex items-center justify-center">
                    <img src="/assets/images/TATABATU-LOGO-WHITE.png" 
                         alt="Tatabatu Belitung Logo" 
                         class="h-10 md:h-12 w-auto object-contain transition-all duration-300">
                </a>

                <!-- Scrolled state (After Scroll): Enlarged Original Logo -->
                <a href="/" x-show="isScrolled" x-cloak class="flex items-center justify-center">
                    <img src="/assets/images/TATABATU-LOGO.png" 
                         alt="Tatabatu Belitung Logo" 
                         class="h-10 md:h-12 w-auto object-contain transition-all duration-300">
                </a>
            </div>

            <!-- RIGHT: BOOK NOW Button -->
            <div class="flex items-center space-x-3 md:space-x-5">
                <a href="#book" 
                   class="inline-flex items-center justify-center px-4 py-1.5 md:px-5 md:py-2 text-[10px] tracking-[0.2em] font-medium uppercase transition-all duration-300 shadow-xs"
                   :style="isScrolled ? 'background-color: #0b1d3a; color: #ffffff;' : 'background-color: transparent; color: #ffffff; border: 1px solid rgba(255,255,255,0.8);'">
                    BOOK NOW
                </a>
            </div>'''

if old_center_and_right in content:
    content = content.replace(old_center_and_right, new_center_and_right)
    print("Successfully replaced navbar center and right section!")
else:
    print("Exact match failed, performing regex replacement...")
    import re
    pattern = r'<!-- CENTER: Logo / Resort Title.*?<!-- RIGHT: SIGN IN & BOOK NOW Buttons -->\s*<div class="flex items-center space-x-3 md:space-x-5">.*?</a>\s*<a href="#book"'
    # let's write regex or slice line numbers
    lines = content.splitlines()
    start_idx = None
    end_idx = None
    for i, line in enumerate(lines):
        if '<!-- CENTER: Logo / Resort Title' in line:
            start_idx = i
        if start_idx is not None and '<a href="#book"' in line:
            end_idx = i
            break
    if start_idx is not None and end_idx is not None:
        # We need up to closing </div> of right section
        right_end_idx = end_idx + 6
        print(f"Replacing lines {start_idx} to {right_end_idx}")
        new_lines = lines[:start_idx] + new_center_and_right.splitlines() + lines[right_end_idx:]
        content = '\n'.join(new_lines)
        print("Replaced via line slice!")

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