import os
import re

files = [
    r'D:\cnf\chatbot-canifa-feedback\backend\static\social-inbox\index.html',
    r'D:\cnf\chatbot-canifa-feedback\backend\static\content-composer\index.html',
    r'D:\cnf\chatbot-canifa-feedback\backend\static\content-approval\index.html',
    r'D:\cnf\chatbot-canifa-feedback\backend\static\content-calendar\index.html',
    r'D:\cnf\chatbot-canifa-feedback\backend\static\media-library\index.html'
]

for fpath in files:
    if not os.path.exists(fpath):
        continue
    with open(fpath, 'r', encoding='utf-8') as f:
        content = f.read()
    
    # 1. Remove logo-icon div
    content = re.sub(r'<div class="logo-icon">.*?</div>\s*', '', content, flags=re.DOTALL)
    
    # 2. Update CSS selector for flexbox alignment
    content = content.replace('.topbar h1 { display: flex', 'header h1, .logo h1, .topbar h1 { display: flex')
    
    with open(fpath, 'w', encoding='utf-8') as f:
        f.write(content)
    print(f"Fixed {fpath}")
