(function() {
  // Fix cores
  document.documentElement.style.setProperty('--background_geral', '#111111');
  document.documentElement.style.setProperty('--carousel-banners', '#111111');
  document.documentElement.style.setProperty('--sidebar-color', '#111111');

  function fixColors() {
    document.querySelectorAll('.bg-base, .navtop-color').forEach(function(el) {
      el.style.setProperty('background-color', '#111111', 'important');
    });
  }

  // Botão suporte
  function addSuporteButton() {
    if (document.getElementById('btn-suporte-custom')) return;
    var botoes = document.querySelectorAll('button[data-v-5003964b]');
    if (botoes.length < 3) return;

    var ultimoBotao = botoes[botoes.length - 1];
    var pai = ultimoBotao.parentElement;
    if (!pai) return;

    var novoBotao = document.createElement('button');
    novoBotao.id = 'btn-suporte-custom';
    novoBotao.className = ultimoBotao.className;
    novoBotao.style.cssText = 'border-radius:0.25rem; justify-content:space-between; padding:5px 10px; margin-top:9px; background-color:var(--sidebar-button-ganhe-background); color:var(--sidebar-button-ganhe-text); width:100%; display:flex; align-items:center;';
    novoBotao.innerHTML = '<div style="display:flex;flex-direction:column;align-items:flex-start;"><span style="font-size:11px;opacity:0.85;">Fale com o</span><span style="font-weight:700;font-size:14px;">Suporte ao Vivo</span></div><span style="font-size:24px;">💬</span>';
    novoBotao.onclick = function() { window.open('#', '_blank'); };
    pai.appendChild(novoBotao);
  }

  document.addEventListener('DOMContentLoaded', fixColors);
  setTimeout(fixColors, 500);
  setTimeout(addSuporteButton, 2000);
  setTimeout(addSuporteButton, 4000);

  var observer = new MutationObserver(function() {
    fixColors();
    addSuporteButton();
  });

  if (document.body) {
    observer.observe(document.body, { childList: true, subtree: true });
  } else {
    document.addEventListener('DOMContentLoaded', function() {
      observer.observe(document.body, { childList: true, subtree: true });
    });
  }
})();