
import React from 'react';

export default function Modal({show, title, children, onClose}){
  if(!show) return null;
  return (
    <div className="custom-modal-overlay" onClick={onClose} style={{position:'fixed', inset:0, background:'rgba(0,0,0,0.4)', zIndex:999}}>
      <div className="custom-modal" onClick={e => e.stopPropagation()} style={{maxWidth:800, margin:'80px auto', background:'#fff', borderRadius:12, padding:20}}>
        <div style={{display:'flex', justifyContent:'space-between', alignItems:'center'}}>
          <h3>{title}</h3>
          <button onClick={onClose}>Close</button>
        </div>
        <div>{children}</div>
      </div>
    </div>
  )
}
