import re

with open('css/bible-widget.css', 'r', encoding='utf-8') as f:
    css = f.read()

# Fix the close button
new_close = '''#bible-modal-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: #ffffff;
    font-size: 3rem;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#bible-modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: #e6c888;
    color: #4a2a18;
    border-color: #e6c888;
}'''

css = re.sub(r'#bible-modal-close\s*\{[^}]*\}', new_close[:new_close.find('#bible-modal-close:hover')], css, flags=re.DOTALL)
css = re.sub(r'#bible-modal-close:hover\s*\{[^}]*\}', new_close[new_close.find('#bible-modal-close:hover'):], css, flags=re.DOTALL)

# Fix the flip hint
new_hint = '''#bible-flip-hint {
    position: absolute;
    right: -250px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    text-align: center;
    color: #ffffff;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    animation: pulse 1.5s infinite;
}'''
css = re.sub(r'#bible-flip-hint\s*\{[^}]*\}', new_hint, css, flags=re.DOTALL)

with open('css/bible-widget.css', 'w', encoding='utf-8') as f:
    f.write(css)

print("Fixed close button and flip hint CSS")
