/* Popup.jsx — ExitPopup (exit intent) */
(() => {

function HorizonPopup({ show, onClose }) { return null; }

function ExitPopup({ show, onClose }) {
  if (!show) return null;

  const handleCTA = () => {
    onClose();
    const el = document.getElementById("registration");
    if (el) el.scrollIntoView({ behavior: "smooth", block: "center" });
  };

  return (
    <div className="modal-overlay" onClick={e => e.target === e.currentTarget && onClose()}
      style={{ position:"fixed", inset:0, background:"rgba(0,0,0,0.65)", zIndex:1100, display:"flex", alignItems:"center", justifyContent:"center", padding:16 }}>
      <div className="popup-exit-body" style={{ background:"#fff", borderRadius:12, width:"100%", maxWidth:420, overflow:"hidden", boxShadow:"0 8px 40px rgba(0,0,0,0.35)" }}>
        <div style={{ background:"#d32f2f", padding:"16px 20px", position:"relative" }}>
          <button onClick={onClose} style={{ position:"absolute", top:10, right:12, background:"none", border:"none", color:"#fff", fontSize:22, cursor:"pointer", lineHeight:1 }}>×</button>
          <div style={{ color:"#fff", fontWeight:700, fontSize:17, textAlign:"center" }}>
            Bekle! Yerin rezerve edildi
          </div>
        </div>
        <div style={{ padding:"20px", textAlign:"center" }}>
          <div style={{ fontSize:15, color:"#333", marginBottom:16, lineHeight:1.5 }}>
            Binlerce Türk vatandaşı <strong>Baykar</strong> ile gelir elde ediyor. Ücretsiz yerler bugün bitiyor.
          </div>
          <button onClick={handleCTA} style={{ width:"100%", padding:"14px", background:"#f71515", color:"#fff", border:"none", borderRadius:6, fontSize:15, fontWeight:700, cursor:"pointer", marginBottom:10 }}>
            ÜCRETSİZ YERİMİ ALMAK İSTİYORUM
          </button>
          <button onClick={onClose} style={{ background:"none", border:"none", color:"#888", fontSize:13, cursor:"pointer", textDecoration:"underline" }}>
            Hayır, bu fırsatı kaçırmayı tercih ediyorum
          </button>
        </div>
      </div>
    </div>
  );
}

Object.assign(window, { HorizonPopup, ExitPopup });
})();
