import re

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

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

# Add media queries for mobile
mobile_css = '''
@media (max-width: 768px) {
    #bible-flip-container {
        width: 220px;
        height: 300px;
    }
    
    #bible-flip-hint {
        font-size: 1.2rem;
        bottom: -45px;
    }

    #bible-reveal-container {
        width: 95%;
        padding: 2rem 1.5rem;
    }

    .bible-quote-text {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .bible-quote-ref {
        font-size: 1.1rem;
    }

    .bible-quote-text::before { top: -10px; left: -15px; font-size: 3rem; }
    .bible-quote-text::after { bottom: -25px; right: -10px; font-size: 3rem; }
    
    #bible-modal-close {
        top: 20px !important;
        right: 20px !important;
        width: 45px !important;
        height: 45px !important;
        font-size: 2rem !important;
    }
    
    #bible-input-container {
        width: 90%;
    }
    
    .bible-input-box {
        width: 100px;
        padding: 0.8rem 1rem;
        font-size: 1.2rem;
    }
    
    .bible-action-btn {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
}
'''

css += mobile_css

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

print("Updated CSS for full responsiveness")
