const D=SP_DOCTORS.find(x=>x.id===window.SP_PAGE_ID)||SP_DOCTORS[0];
const DX={
  alok:{leads:['braces','aligners','root-canal','cosmetic'],reviews:[0,1,3],cases:['ba-06a','ba-07b'],
    tagline:'Orthodontist and dental surgeon, certified clear aligner provider.',
    eduLines:[['M.D.S. — Orthodontics & Dentofacial Orthopaedics','M.G.M. Dental College and Hospital'],['B.D.S.','Bachelor of Dental Surgery'],['Certified clear aligner provider','Clear aligner treatment in Powai']],
    also:'He is also a consultant Orthodontist at several other leading dental clinics across Mumbai.'},
  rajendra:{leads:['implants','cosmetic'],reviews:[10,11,12],cases:[],
    tagline:'Dentist and implantologist, 47 years in practice.',
    eduLines:[['B.D.S.','University of Bombay']],
    also:'He has practised dentistry in Mumbai for 47 years, and handles implants, crowns, bridges and gum treatment at Smile Plus.'}
}[D.id];
const DREVS=DX.reviews.map(i=>SP_REVIEWS[i]);
const DCASES=DX.cases;
const DLEADS=DX.leads.map(id=>SP_SERVICES.find(s=>s.id===id)).filter(Boolean);
const DOTHER=SP_DOCTORS.find(x=>x.id!==D.id);

function DoctorPage(){
  return <React.Fragment>
    <SPHead active="Doctors"/>
    <main>
    <section className="sp-decor sp-decor-mark sp-decor-arcs" style={{background:'var(--wash-premium)',borderBottom:'1px solid var(--border-gold)',overflow:'hidden',padding:'clamp(36px,5vw,56px) 0 clamp(44px,6vw,72px)'}}>
      <div className="sp-wrap" style={{display:'grid',gridTemplateColumns:'repeat(auto-fit,minmax(310px,1fr))',gap:'clamp(28px,4vw,56px)',alignItems:'center'}}>
        <div style={{order:1}}>
          <a href="/dentists-powai-chandivali" style={{display:'inline-flex',alignItems:'center',gap:7,fontSize:14,fontFamily:'var(--font-display)',fontWeight:600,marginBottom:18}}>
            <Icon name="arrow-left" size={15} color="var(--brand-primary)"/>All doctors</a>
          <div className="sp-stack" style={{gap:18,alignItems:'flex-start'}}>
            <span className="sp-eyebrow" style={{color:'var(--text-gold)'}}>{D.role}</span>
            <span className="sp-hr-gold" style={{width:64,background:'linear-gradient(90deg,var(--gold-500),var(--gold-300))'}}/>
            <h1 className="sp-display" style={{fontSize:'clamp(32px,4.6vw,60px)'}}>{D.name}</h1>
            <p className="sp-lead" style={{maxWidth:520}}>{DX.tagline} {DX.also}</p>
            <div className="sp-row" style={{gap:40}}>
              <StatBlock value={D.exp} label="Experience" detail={D.expDetail}/>
              <StatBlock value={D.credential} label="Qualification" detail={D.qual}/>
            </div>
            <div className="sp-cta-row">
              <CallBtns/>
              <a className="sp-plain" href="/contact-powai-chandivali-dental-clinic"><Button size="lg" variant="secondary" icon="map-pin">Both branches</Button></a>
            </div>
          </div>
        </div>
        <div style={{order:2}}><Shot src={D.photo} alt={D.name+', '+D.credential+' — '+D.role} ratio="4 / 4.9" gold/></div>
      </div>
    </section>

    <section className="sp-sec" style={{background:'var(--surface-page)'}}>
      <div className="sp-wrap" style={{display:'grid',gridTemplateColumns:'repeat(auto-fit,minmax(290px,1fr))',gap:'clamp(28px,4vw,56px)',alignItems:'start'}}>
        <Reveal className="sp-stack" style={{gap:18}}>
          <span className="sp-eyebrow" style={{color:'var(--text-gold)'}}>In his own practice</span>
          <h2 className="sp-h2">About {D.name}</h2>
          <p className="sp-lead">{D.bio}</p>
        </Reveal>
        <Reveal delay={80} className="sp-stack" style={{gap:20}}>
          <Card padding={26} style={{display:'flex',flexDirection:'column',gap:14}}>
            <span className="sp-eyebrow" style={{color:'var(--text-gold)'}}>Education</span>
            {DX.eduLines.map(([t,d])=><div key={t} className="sp-stack" style={{gap:3,borderBottom:'1px solid var(--border-hairline)',paddingBottom:12}}>
              <span style={{fontFamily:'var(--font-display)',fontWeight:700,fontSize:16,color:'var(--text-heading)'}}>{t}</span>
              <span className="sp-body" style={{fontSize:14.5}}>{d}</span></div>)}
          </Card>
          <Card padding={26} tone="accent" style={{display:'flex',flexDirection:'column',gap:11}}>
            <span className="sp-eyebrow" style={{color:'var(--gold-800)'}}>Memberships</span>
            {D.memberships.map(m=><span key={m} className="sp-bullet" style={{color:'var(--ink-700)'}}><Icon name="award" size={17} color="var(--gold-600)" style={{marginTop:2}}/>{m}</span>)}
          </Card>
        </Reveal>
      </div>
    </section>

    <section className="sp-sec" style={{background:'var(--wash-premium)',borderTop:'1px solid var(--border-gold)',borderBottom:'1px solid var(--border-gold)'}}>
      <div className="sp-wrap sp-stack" style={{gap:32}}>
        <Reveal><SectionHeading rule size="md" eyebrow="Areas of focus" title={'What '+D.name+' treats'}/></Reveal>
        <div className="sp-grid-3">
          {D.focus.map((f,i)=><Reveal key={f} delay={i*50}>
            <Card padding={22} style={{height:'100%',display:'flex',gap:13,alignItems:'flex-start'}}>
              <span style={{width:38,height:38,flex:'none',borderRadius:'var(--radius-md)',background:'var(--teal-100)',display:'flex',alignItems:'center',justifyContent:'center'}}>
                <Icon name="check" size={19} color="var(--teal-700)"/></span>
              <span style={{fontFamily:'var(--font-display)',fontWeight:700,fontSize:16,color:'var(--text-heading)',lineHeight:1.35,alignSelf:'center'}}>{f}</span>
            </Card></Reveal>)}
        </div>
        <Reveal><div className="sp-stack" style={{gap:16}}>
          <span className="sp-eyebrow" style={{color:'var(--text-gold)'}}>Treatments {D.name.split(' ')[1]} leads</span>
          <div className="sp-grid-3">
            {DLEADS.map(s=><a key={s.id} className="sp-plain" href={s.href} style={{display:'block'}}>
              <ServiceCard icon={s.icon} title={s.title} description={s.card} meta={s.meta}/></a>)}
          </div>
        </div></Reveal>
      </div>
    </section>

    {DCASES.length>0&&<section className="sp-sec" style={{background:'var(--surface-page)'}}>
      <div className="sp-wrap sp-stack" style={{gap:30}}>
        <Reveal><SectionHeading rule size="md" eyebrow="Cases" title={'Smiles by '+D.name} description="Both cases are captioned as the clinic labelled them."/></Reveal>
        <div className="sp-grid-2">
          {DCASES.map((id,i)=><Reveal key={id} delay={i*70}><Case id={id}/></Reveal>)}
        </div>
        <div style={{display:'flex',justifyContent:'center'}}><a className="sp-plain" href="/smile-gallery-before-after-powai"><Button variant="emerald" iconRight="arrow-right">Full smile gallery</Button></a></div>
      </div>
    </section>}

    <section className="sp-sec" style={{background:DCASES.length?'var(--wash-premium)':'var(--surface-page)',borderTop:DCASES.length?'1px solid var(--border-gold)':undefined,borderBottom:DCASES.length?'1px solid var(--border-gold)':undefined}}>
      <div className="sp-wrap sp-stack" style={{gap:30}}>
        <Reveal><SectionHeading rule size="md" eyebrow="Patient stories" title={'Patients who were treated by '+D.name}
          description="Verbatim from our Google profile, with the doctor’s own replies."/></Reveal>
        <div className="sp-grid-2" style={{alignItems:'stretch'}}>
          {DREVS.map((r,i)=><Reveal key={i} delay={i*70}><ReviewCard r={r} compact/></Reveal>)}
        </div>
        <div style={{display:'flex',justifyContent:'center'}}><a className="sp-plain" href="/patient-reviews-powai-chandivali"><Button variant="secondary" iconRight="arrow-right">All patient stories</Button></a></div>
      </div>
    </section>

    <section className="sp-sec--compact" style={{background:'var(--surface-page)',padding:'clamp(40px,6vw,64px) 0'}}>
      <div className="sp-wrap sp-grid-2" style={{alignItems:'center'}}>
        <Reveal><Shot src={DOTHER.photo} alt={DOTHER.name+', '+DOTHER.credential+' — '+DOTHER.role} ratio="16 / 10"/></Reveal>
        <Reveal delay={70} className="sp-stack" style={{gap:14,alignItems:'flex-start'}}>
          <span className="sp-eyebrow" style={{color:'var(--text-gold)'}}>Also at Smile Plus</span>
          <h2 className="sp-h2" style={{fontSize:'clamp(22px,2.6vw,32px)'}}>{DOTHER.name}, {DOTHER.credential}</h2>
          <p className="sp-body">{DOTHER.one}</p>
          <a className="sp-plain" href={DOTHER.href}><Button variant="secondary" iconRight="arrow-right">Read the profile</Button></a>
        </Reveal>
      </div>
    </section>

    <CTABand title={'Book a consultation with '+D.name+'.'}/>
    </main>
    <SPFooter/>
  </React.Fragment>;
}
ReactDOM.createRoot(document.getElementById('root')).render(<DoctorPage/>);
