/* "Courses & Mentorship" on the front page. Content comes from GET /api/home (`courses`), edited in
   Admin → Front page & notices → Courses; `courses: null` means the admin hid the section.
   BUILT_IN is only used when the server cannot be reached. */
const BUILT_IN={badge:'GO BEYOND FREE',heading:'Courses &',headingAccent:'Mentorship',
intro:'When you’re ready for structure: full self-prep courses for CAT and IPMAT, or one-on-one mentoring to sharpen the prep you’re already doing.',
cards:[
{tag:'CAT 2027',icon:'🎓',title:'CAT Self Prep Comprehensive Course',desc:'The complete concept-to-conquest cycle: recorded classes followed by lecture tests, then topic tests, then full mock tests — with live advanced sessions for the hardest areas.',points:['Recorded classes for VARC, Quant & DILR','Lecture test → topic test → full mock ladder','Live advanced sessions','Detailed video solutions & analytics'],link:'https://learn.scorebuddy.in/courses',button:'Join Now',featured:true,featuredLabel:'MOST POPULAR'},
{tag:'IPMAT 2027',icon:'🎯',title:'IPMAT Self Prep Comprehensive Course',desc:'The same testing ladder built for IPMAT Indore, Rohtak and JIPMAT — recorded lectures, sectional tests and full mocks matched to each exam’s pattern.',points:['Covers IPMAT Indore, Rohtak & JIPMAT patterns','Quant (SA + MCQ), VA and LR modules','Full-length mocks on the real interface','Live advanced sessions'],link:'https://learn.scorebuddy.in/courses',button:'Join Now'},
{tag:'MENTORSHIP',icon:'🧭',title:'Personalized Mentoring',desc:'Book mentoring on its own — a personal planner, strategy making, and SWOT analysis built from your own mocks and tests, one-on-one with a mentor.',points:['One-on-one mentor sessions','Personal study planner & strategy','SWOT analysis through mocks and tests','Works alongside any prep you already do'],link:'https://learn.scorebuddy.in/coaching/IPMAT-Personalized-Mentoring-6a5930a383aae35b3b595097',button:'Join Now'}]};
function PaidCourses(){
const {Badge,Button}=window.ScorebuddyDesignSystem_ee75f2;
const e=React.createElement;
const [c,setC]=React.useState(undefined); /* undefined = loading */
React.useEffect(()=>{
let on=true;
if(!window.__sbHome)window.__sbHome=fetch('/api/home',{credentials:'same-origin'}).then(r=>r.ok?r.json():null).catch(()=>null);
window.__sbHome.then(d=>{if(on)setC(d&&('courses' in d)?d.courses:BUILT_IN);});
return ()=>{on=false;};
},[]);
if(!c||!(c.cards||[]).length)return null;
/* same-site pages open in this tab, outside links in a new one */
const ext=href=>/^https?:\/\//i.test(href)&&!href.startsWith(location.origin);
return e('section',{className:'sb-buy',style:{padding:'72px 48px',background:'var(--navy-900)'}},
e('div',{style:{maxWidth:1180,margin:'0 auto'}},
e('div',{style:{textAlign:'center',marginBottom:36}},
c.badge?e(Badge,{tone:'accent'},c.badge):null,
(c.heading||c.headingAccent)?e('h2',{style:{fontFamily:'var(--font-display)',fontWeight:800,fontSize:30,color:'var(--on-dark)',margin:'16px 0 10px'}},c.heading,c.heading&&c.headingAccent?' ':null,c.headingAccent?e('span',{style:{color:'var(--brand-accent)'}},c.headingAccent):null):null,
c.intro?e('p',{style:{fontFamily:'var(--font-body)',fontSize:15.5,color:'var(--text-on-inverse)',maxWidth:640,margin:'0 auto',lineHeight:1.6}},c.intro):null),
e('div',{style:{display:'grid',gridTemplateColumns:'repeat(auto-fit,minmax(300px,1fr))',gap:20}},
c.cards.map((k,i)=>e('div',{key:i,style:{background:'var(--white)',borderRadius:'var(--radius-lg)',padding:'26px 28px',display:'flex',flexDirection:'column',boxShadow:'var(--shadow-lg)',border:k.featured?'2px solid var(--brand-accent)':'2px solid transparent',position:'relative'}},
k.featured&&k.featuredLabel?e('span',{style:{position:'absolute',top:-12,left:24,background:'var(--brand-accent)',color:'var(--text-on-brand)',fontFamily:'var(--font-body)',fontWeight:700,fontSize:11,letterSpacing:'.06em',padding:'4px 12px',borderRadius:'var(--radius-pill)'}},k.featuredLabel):null,
(k.icon||k.tag)?e('div',{style:{display:'flex',alignItems:'center',gap:10,marginBottom:12}},
k.icon?e('span',{style:{fontSize:24}},k.icon):null,
k.tag?e('span',{style:{fontFamily:'var(--font-body)',fontWeight:700,fontSize:11,letterSpacing:'.08em',color:'var(--navy-700)',background:'var(--navy-100)',padding:'4px 10px',borderRadius:'var(--radius-pill)'}},k.tag):null):null,
e('h3',{style:{fontFamily:'var(--font-display)',fontWeight:700,fontSize:18.5,color:'var(--text-heading)',margin:'0 0 8px'}},k.title),
k.desc?e('p',{style:{fontFamily:'var(--font-body)',fontSize:14,color:'var(--text-body)',lineHeight:1.55,margin:'0 0 14px'}},k.desc):null,
e('ul',{style:{listStyle:'none',padding:0,margin:'0 0 20px',display:'flex',flexDirection:'column',gap:8,flex:1}},
(k.points||[]).map((p,j)=>e('li',{key:j,style:{display:'flex',gap:8,fontFamily:'var(--font-body)',fontSize:13.5,color:'var(--text-body)'}},e('span',{style:{color:'var(--red-500)',fontWeight:700}},'✓'),p))),
e('a',ext(k.link)?{href:k.link,target:'_blank',rel:'noopener'}:{href:k.link},e(Button,{variant:k.featured?'primary':'secondary',size:'md'},(k.button||'Join Now')+' →')))))));
}
window.PaidCourses=PaidCourses;
