// Base Norte Hub Imobiliário Demo — embeds the navigable React prototype
// (built from the Figma file and served from /basenorte/) inside a Chrome-style browser frame.

const BNChrome = ({ url, title, children }) => (
  <div style={{width:'100%',height:'100%',display:'flex',flexDirection:'column',background:'#dadce0',fontFamily:'Inter,sans-serif'}}>
    {/* Top bar with tab */}
    <div style={{height:32,background:'#dadce0',display:'flex',alignItems:'flex-end',padding:'0 8px',gap:0,flexShrink:0}}>
      <div style={{height:28,background:'#fff',borderTopLeftRadius:8,borderTopRightRadius:8,padding:'0 12px',display:'flex',alignItems:'center',gap:8,minWidth:200,maxWidth:300}}>
        <img src="/basenorte/figma/brand/logo-header-small.svg" alt="" style={{width:14,height:16,flexShrink:0}} />
        <div style={{fontSize:11,color:'#3c4043',whiteSpace:'nowrap',overflow:'hidden',textOverflow:'ellipsis',flex:1}}>{title}</div>
        <div style={{fontSize:14,color:'#5f6368',cursor:'pointer',lineHeight:1}}>×</div>
      </div>
      <div style={{width:24,height:28,display:'flex',alignItems:'center',justifyContent:'center',color:'#5f6368',fontSize:14}}>+</div>
    </div>
    {/* URL bar */}
    <div style={{height:36,background:'#fff',borderBottom:'1px solid #dadce0',display:'flex',alignItems:'center',padding:'0 12px',gap:8,flexShrink:0}}>
      <div style={{display:'flex',gap:6,color:'#5f6368'}}>
        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>
        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>
        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
      </div>
      <div style={{flex:1,height:22,background:'#f1f3f4',borderRadius:11,display:'flex',alignItems:'center',padding:'0 10px',gap:6,fontSize:11,color:'#3c4043',minWidth:0}}>
        <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
        <span style={{overflow:'hidden',textOverflow:'ellipsis',whiteSpace:'nowrap'}}>{url}</span>
      </div>
      <a href="/basenorte/" target="_blank" rel="noreferrer" title="Open prototype in a new tab"
        style={{display:'flex',alignItems:'center',gap:4,fontSize:11,color:'#0997c3',textDecoration:'none',fontWeight:600,whiteSpace:'nowrap'}}>
        <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
        Full screen
      </a>
    </div>
    {/* App content */}
    <div style={{flex:1,minHeight:0,position:'relative',background:'#fff'}}>{children}</div>
  </div>
);

// ─── Component ──────────────────────────────────────────────────────
const BaseNorteDemo = () => (
  <BNChrome url="basenortehub.com.br" title="Base Norte Hub Imobiliário">
    <iframe
      src="/basenorte/"
      title="Base Norte Hub Imobiliário — navigable prototype"
      style={{width:'100%',height:'100%',border:0,display:'block'}}
    />
  </BNChrome>
);

Object.assign(window, { BaseNorteDemo });
