/**
 * ButtonsCLI Shameless Plug Snippet
 * Injects the ad banner into any page that has a .buttons-ad-section placeholder
 */

(function() {
  const AD_HTML = `
    <div class="buttons-ad-wrapper">
      <span class="buttons-ad-badge">Shameless Plug</span>
      <div class="buttons-ad-content">
        <a href="https://buttonscli.com" target="_blank" rel="noopener">
          <p class="buttons-ad-pitch">While we're deep-diving into complex CLI tools... let's be honest. Are you tired of feeling like nerds are trying to gatekeep the terminal life by having you memorize 30 key combos just to do basic stuff? Do you lie awake at night dreading the moment you have to edit a cryptic dotfile just to change a font size? Same. It's the AI age, we can have a crazy UI on top of the terminal with shameless amounts of AI built in to do things for you. We can even have AI nudge stalled coding agents for you when they stop for no reason.</p>
          <div class="buttons-ad-tagline">
            <strong>ButtonsCLI</strong>: The terminal for <span class="buttons-ad-rotator"></span>
          </div>
        </a>
      </div>
    </div>
    <p style="text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: var(--space-md); font-style: italic;">(Alright, ad over. Back to the serious technical analysis.)</p>
  `;

  document.addEventListener('DOMContentLoaded', () => {
    const adSections = document.querySelectorAll('.buttons-ad-section');
    adSections.forEach(section => {
      // Only inject if the section is empty (has no .buttons-ad-wrapper yet)
      if (!section.querySelector('.buttons-ad-wrapper')) {
        section.innerHTML = AD_HTML;
      }
    });
  });
})();
