USE nirvaan;

/* ---------------- SEO for the acquisition routes ---------------- */
INSERT INTO seo_meta (entity_type,entity_id,route,meta_title,meta_desc,robots,
                      answer_summary,sitemap_priority,sitemap_freq)
VALUES
 ('page',0,'/doctors.php','Verified sexual health doctors and counsellors — Nirvaan',
  'Browse every verified doctor and counsellor on Nirvaan. Filter by gender, language and speciality. See per-minute rates before you start.',
  'index,follow',
  'Nirvaan lists every verified practitioner with their qualification, languages, per-minute rate and availability. Patients can filter by doctor gender, language and speciality before starting a consultation.',
  0.9,'daily'),
 ('page',0,'/learn/','Doctor-reviewed sexual health articles — Nirvaan',
  'Plain, accurate writing on sexual health, each piece reviewed by a named doctor. Free to read, no account needed.',
  'index,follow',
  'Every article on Nirvaan carries the name and qualification of the practitioner who reviewed it. Articles are free to read and require no account.',
  0.7,'weekly')
ON DUPLICATE KEY UPDATE meta_title = VALUES(meta_title), meta_desc = VALUES(meta_desc);

/* ---------------- Speciality SEO copy ---------------- */
UPDATE specialities SET
  seo_title = "Men's sexual health — talk to a doctor privately | Nirvaan",
  seo_desc  = 'Consult a verified doctor about your sexual health, anonymously, by chat or call.',
  intro_html = '<p>Most men sit on this for months. The searching gets worse, not better — every result contradicts the last one, and half of them are selling something.</p><p>A doctor can tell you in a few minutes which of the things you have read actually apply to you. Here you ask under a handle you choose, and they never learn your name.</p>'
WHERE slug = 'mens-sexual-health';

UPDATE specialities SET
  seo_title = "Women's sexual health — talk to a doctor privately | Nirvaan",
  seo_desc  = 'Consult a verified doctor about your sexual health, anonymously. Choose a woman doctor if you prefer.',
  intro_html = '<p>Plenty of women have never had a straightforward conversation about this with anyone, including their own doctor. Not because they did not want to — because there was never a moment where it felt possible to bring up.</p><p>This is that moment, without the waiting room. You can set a preference for a woman doctor once and only ever see women.</p>'
WHERE slug = 'womens-sexual-health';

UPDATE specialities SET
  seo_title = 'Performance anxiety and stress — talk to a doctor | Nirvaan',
  seo_desc  = 'When worry starts before anything happens, the problem is often anxiety rather than anything physical.',
  intro_html = '<p>There is a particular pattern people describe: the worry starts before anything has happened, it is different alone than with someone, and it grows every time it is avoided.</p><p>That pattern is worth naming to someone qualified, because it responds well to being talked through and badly to being waited out.</p>'
WHERE slug = 'sexual-anxiety';

UPDATE specialities SET
  seo_title = 'Relationship and intimacy consultations | Nirvaan',
  seo_desc  = 'Talk to a counsellor about intimacy, mismatch in desire, or a conversation you cannot start.',
  intro_html = '<p>Sometimes nothing is medically wrong and the difficulty is entirely between two people — a mismatch in desire, a conversation neither of you can open, resentment that has quietly become the whole climate.</p><p>Counsellors on the panel work with exactly this. You can consult alone; you do not need your partner to agree to anything.</p>'
WHERE slug = 'relationship-intimacy';

UPDATE specialities SET
  seo_title = 'STI concerns and testing advice | Nirvaan',
  seo_desc  = 'Worried after an exposure or a symptom? Talk to a doctor about what testing actually makes sense.',
  intro_html = '<p>The window between worrying and knowing is where people do the most damage to themselves, usually by searching.</p><p>A doctor can tell you which tests are worth doing, when they become accurate, and what the symptom you noticed is more likely to be. That conversation takes minutes.</p>'
WHERE slug = 'sti-concerns';

/* ---------------- City intros ---------------- */
UPDATE geo_cities SET intro_html = '<p>Mumbai has no shortage of clinics. What it has a shortage of is privacy — somebody you know is always two seats away.</p><p>Consulting online removes that entirely, and gives you a wider choice of practitioner than any one neighbourhood offers.</p>' WHERE slug = 'mumbai';
UPDATE geo_cities SET intro_html = '<p>Delhi patients often tell us the same thing: they would rather travel across the city than be seen locally. Online, that trade-off disappears.</p>' WHERE slug = 'delhi';
UPDATE geo_cities SET intro_html = '<p>Bengaluru has plenty of specialists and very little time. Consulting from your desk, in a slot you pick, at a rate you can see beforehand, solves the part that actually stops people.</p>' WHERE slug = 'bengaluru';

/* ---------------- FAQ scoped to city pages ---------------- */
INSERT INTO cms_faqs (scope,question,answer_html,sort_order) VALUES
 ('city:mumbai','Is there a Nirvaan clinic in Mumbai?','<p>No. Every consultation is online, by chat, voice or video. That is deliberate — it is what removes the waiting room and the chance of being seen. Our practitioners are spread across India, so you get a wider choice than any single clinic offers.</p>',10),
 ('city:mumbai','Can I get a prescription that a Mumbai pharmacy will accept?','<p>A Registered Medical Practitioner on the panel can issue a digital prescription under the Telemedicine Practice Guidelines, 2020, where they consider it appropriate. Those are valid nationwide, including at pharmacies in Mumbai.</p>',20);

/* ---------------- One reviewed article so /learn/ is not empty ---------------- */
INSERT INTO cms_posts
  (slug,title,excerpt,body_html,category_id,reviewed_by_doctor_id,reviewed_at,is_published,published_at)
SELECT
  'why-people-wait-years-before-asking',
  'Why people wait years before asking, and what it costs them',
  'The average gap between noticing something and asking a doctor about it is measured in years, not weeks. Here is what is usually going on in that gap.',
  '<p>Ask practitioners who work in this area what surprises them most and they tend to give the same answer: not what patients describe, but how long they waited before describing it.</p>
   <h2>The gap is mostly about the room, not the doctor</h2>
   <p>When people explain the delay, they rarely say they were afraid of the medical part. They describe the receptionist. The waiting room. The possibility of being recognised. The question of what to write on the form.</p>
   <p>That is worth noticing, because it means the barrier is logistical and social rather than clinical — and logistical barriers can be removed.</p>
   <h2>What the waiting actually costs</h2>
   <ul>
     <li><b>The searching gets worse.</b> Search results on this subject are dominated by people selling something. Weeks of reading usually leaves someone more anxious and less informed than when they started.</li>
     <li><b>Avoidance compounds.</b> Whatever the original difficulty, avoiding situations because of it tends to make the anxiety around it larger over time.</li>
     <li><b>Simple explanations get missed.</b> A meaningful share of what people worry about turns out to relate to sleep, alcohol, medication they are already taking, or stress from something unrelated. Those are quick to identify and often quick to address — but only once somebody asks the right questions.</li>
   </ul>
   <h2>What a first conversation usually looks like</h2>
   <p>Shorter than people expect. A practitioner will generally ask when it started, whether it is constant or situational, what else changed around the same time, and what medication you take. Those four answers narrow things down considerably.</p>
   <p>Nobody needs a speech prepared. "I have been worried about something and I have never asked anyone" is a complete opening.</p>
   <h2>If you take one thing from this</h2>
   <p>The discomfort of asking is front-loaded — it is worst in the minute before, and it drops sharply once the conversation is underway. Almost everyone says afterwards that the waiting was harder than the asking.</p>',
  (SELECT id FROM cms_categories WHERE slug = 'myths'),
  (SELECT id FROM doctors WHERE public_slug = 'dr-a-sharma'),
  CURDATE(), 1, NOW()
WHERE NOT EXISTS (SELECT 1 FROM cms_posts WHERE slug = 'why-people-wait-years-before-asking');

INSERT INTO seo_meta (entity_type,entity_id,route,meta_title,meta_desc,robots,answer_summary,sitemap_priority,sitemap_freq)
VALUES ('post',0,'/learn/why-people-wait-years-before-asking',
  'Why people wait years before asking about sexual health — Nirvaan',
  'The gap between noticing something and asking a doctor is measured in years. What is going on in that gap, and what the delay costs.',
  'index,follow',
  'People delay sexual health consultations for years mainly because of the clinic setting rather than fear of the medical conversation. The delay compounds anxiety, exposes people to sales-driven misinformation, and postpones identifying common contributing factors such as sleep, alcohol, medication and stress.',
  0.7,'monthly')
ON DUPLICATE KEY UPDATE meta_title = VALUES(meta_title);

/* ---------------- Header menu now that these pages exist ---------------- */
UPDATE cms_menu SET url = '/doctors.php' WHERE location = 'header' AND label = 'Doctors';
INSERT INTO cms_menu (location,label,url,sort_order) VALUES
 ('footer_1','Browse all doctors','/doctors.php',40),
 ('footer_2','Sexologist in Mumbai','/sexologist/mumbai',30),
 ('footer_2','Sexologist in Delhi','/sexologist/delhi',40)
ON DUPLICATE KEY UPDATE url = VALUES(url);
