<script>
(function() {
  // ── CONFIG ──────────────────────────────────────────────────────
  var APPS_SCRIPT_URL = 'https://script.google.com/macros/s/AKfycbyI6rG32ZZznuZjls_UM3YwxeAqJXkv1ufZ0R91oK5A1MMX1xMkU1RaYC4PPirmcKXw3A/exec';
  var WHATSAPP_NUMBER = '919582834894'; // country code + number, no +
  // ────────────────────────────────────────────────────────────────

  function injectStyles() {
    var css = `
      #ub-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.55);
        z-index:99999; display:flex; align-items:center; justify-content:center; }
      #ub-modal { background:#fff; border-radius:14px; padding:28px 24px;
        width:90%; max-width:400px; font-family:sans-serif; box-sizing:border-box; }
      #ub-modal h3 { margin:0 0 4px; font-size:18px; color:#111; font-weight:700; }
      #ub-modal p  { margin:0 0 20px; font-size:13px; color:#666; }
      .ub-field { margin-bottom:14px; }
      .ub-field label { display:block; font-size:13px; font-weight:600;
        color:#333; margin-bottom:5px; }
      .ub-field input { width:100%; box-sizing:border-box; padding:10px 12px;
        border:1.5px solid #ddd; border-radius:8px; font-size:14px; outline:none;
        transition: border-color 0.2s; }
      .ub-field input:focus { border-color:#25D366; }
      #ub-btn-submit { width:100%; padding:13px; background:#25D366;
        color:#fff; border:none; border-radius:8px; font-size:15px;
        font-weight:700; cursor:pointer; margin-top:4px; letter-spacing:0.2px; }
      #ub-btn-submit:hover { background:#1ebe5d; }
      #ub-msg { font-size:12px; color:#e53; margin-top:6px; min-height:16px; }
      #ub-privacy { text-align:center; margin:10px 0 0;
        font-size:11px; color:#bbb; }`;
    var s = document.createElement('style');
    s.textContent = css;
    document.head.appendChild(s);
  }

  function getIP(callback) {
    fetch('https://api.ipify.org?format=json')
      .then(function(r){ return r.json(); })
      .then(function(d){ callback(d.ip); })
      .catch(function(){ callback('unavailable'); });
  }

  function sendToSheet(payload) {
    fetch(APPS_SCRIPT_URL, {
      method: 'POST',
      mode: 'no-cors',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(payload)
    });
  }

  function openWhatsApp(name, pageTitle) {
    var msg = encodeURIComponent(
      'Hi! I\'m ' + name + ', I\'d like to know more about UberBrains.' +
      '\n\nPage I was on: ' + pageTitle
    );
    window.open('https://wa.me/' + WHATSAPP_NUMBER + '?text=' + msg, '_blank');
  }

  function showModal(waHref) {
    var pageTitle = document.title || window.location.href;

    var overlay = document.createElement('div');
    overlay.id = 'ub-overlay';
    overlay.innerHTML = `
      <div id="ub-modal">
        <div style="display:flex;align-items:center;gap:10px;margin-bottom:6px;">
          <div style="width:38px;height:38px;border-radius:50%;background:#25D366;
            display:flex;align-items:center;justify-content:center;flex-shrink:0;">
            <svg width="20" height="20" viewBox="0 0 24 24" fill="white">
              <path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z"/>
              <path d="M12 0C5.373 0 0 5.373 0 12c0 2.089.534 4.049 1.47 5.757L.057 23.5l5.91-1.383A11.945 11.945 0 0012 24c6.627 0 12-5.373 12-12S18.627 0 12 0zm0 21.818a9.796 9.796 0 01-5.031-1.387l-.361-.214-3.737.875.942-3.648-.235-.374A9.77 9.77 0 012.182 12c0-5.419 4.399-9.818 9.818-9.818 5.42 0 9.818 4.399 9.818 9.818 0 5.42-4.398 9.818-9.818 9.818z"/>
            </svg>
          </div>
          <h3>Chat with us on WhatsApp</h3>
        </div>
        <p>Share your details and we'll follow up with you.</p>

        <div class="ub-field">
          <label for="ub-name">Full Name</label>
          <input id="ub-name" type="text" placeholder="e.g. Pankaj Sharma" />
        </div>
        <div class="ub-field">
          <label for="ub-email">Email Address</label>
          <input id="ub-email" type="email" placeholder="e.g. pankaj@email.com" />
        </div>
        <div class="ub-field">
          <label for="ub-phone">Phone Number</label>
          <input id="ub-phone" type="tel" placeholder="e.g. +91 98765 43210" />
        </div>

        <div id="ub-msg"></div>
        <button id="ub-btn-submit">Continue to WhatsApp ↗</button>
        <p id="ub-privacy">🔒 Your details are kept private and never shared.</p>
      </div>`;
    document.body.appendChild(overlay);

    document.getElementById('ub-btn-submit').addEventListener('click', function() {
      var name  = document.getElementById('ub-name').value.trim();
      var email = document.getElementById('ub-email').value.trim();
      var phone = document.getElementById('ub-phone').value.trim();
      var msg   = document.getElementById('ub-msg');

      if (!name || !email || !phone) {
        msg.textContent = '⚠ Please fill in all fields to continue.';
        return;
      }
      if (!/\S+@\S+\.\S+/.test(email)) {
        msg.textContent = '⚠ Please enter a valid email address.';
        return;
      }

      document.getElementById('ub-btn-submit').textContent = 'Sending…';

      var pageUrl = window.location.href;
      getIP(function(ip) {
        sendToSheet({
          name: name,
          email: email,
          phone: phone,
          pageUrl: pageUrl,
          pageTitle: pageTitle,
          ipAddress: ip
        });
        document.body.removeChild(overlay);
        openWhatsApp(name, pageTitle);
      });
    });

    // Close on backdrop click
    overlay.addEventListener('click', function(e) {
      if (e.target === overlay) document.body.removeChild(overlay);
    });
  }

  function init() {
    injectStyles();
    document.addEventListener('click', function(e) {
      var el = e.target.closest('a, button');
      if (!el) return;
      var href = el.getAttribute('href') || '';
      if (href.includes('wa.me') || href.includes('api.whatsapp.com') ||
          el.classList.toString().toLowerCase().includes('whatsapp')) {
        e.preventDefault();
        e.stopPropagation();
        showModal(href);
      }
    }, true);
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', init);
  } else {
    init();
  }
})();
</script>

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//www.uberbrains.com/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://www.uberbrains.com/post-sitemap.xml</loc>
		<lastmod>2024-03-30T07:06:38+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.uberbrains.com/page-sitemap.xml</loc>
		<lastmod>2026-04-07T09:23:47+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.uberbrains.com/attachment-sitemap.xml</loc>
		<lastmod>2026-04-07T13:45:00+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.uberbrains.com/category-sitemap.xml</loc>
		<lastmod>2024-03-30T07:06:38+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.uberbrains.com/post_tag-sitemap.xml</loc>
		<lastmod>2020-04-20T14:05:00+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.uberbrains.com/layout_tag-sitemap.xml</loc>
		<lastmod>2025-12-23T16:59:58+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.uberbrains.com/author-sitemap.xml</loc>
		<lastmod>2020-03-05T17:55:24+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->