import React, { useState, useEffect, useRef } from 'react';
import { createRoot } from 'react-dom/client';
// --- Data from the PDF ---
const QUESTIONS = [
{
q: "What does the Saffron colour in our National Flag stand for?",
options: ["Peace and Truth", "Growth and Prosperity", "Strength and Courage", "Duty (Dharma)"],
correct: "Strength and Courage"
},
{
q: "When did India adopt its Constitution (Republic Day)?",
options: ["15 August 1947", "26 January 1950", "2 October 1869", "26 November 1949"],
correct: "26 January 1950"
},
{
q: "What does the Ashoka Chakra in the center of the flag represent?",
options: ["Wealth", "Duty (Dharma)", "Nature", "Victory"],
correct: "Duty (Dharma)"
},
{
q: "Which colour in the flag stands for Growth and Prosperity?",
options: ["Saffron", "White", "Green", "Blue"],
correct: "Green"
},
{
q: "Where are the lions of the National Emblem found in the wild?",
options: ["Sundarbans", "Jim Corbett", "Gir Forests (Gujarat)", "Kaziranga"],
correct: "Gir Forests (Gujarat)"
},
{
q: "What is the National Animal of India?",
options: ["Lion", "Elephant", "Tiger", "Leopard"],
correct: "Tiger"
},
{
q: "What is the National Bird of India?",
options: ["Parrot", "Eagle", "Peacock", "Swan"],
correct: "Peacock"
},
{
q: "Whose image is found on Indian currency notes?",
options: ["Jawaharlal Nehru", "Subhash Chandra Bose", "Mahatma Gandhi", "Sardar Patel"],
correct: "Mahatma Gandhi"
},
{
q: "What symbol on the currency note promotes the 'Clean India Mission'?",
options: ["A Broom", "Spectacles", "A Dustbin", "A Tree"],
correct: "Spectacles"
},
{
q: "What is the world's tallest statue, located in India?",
options: ["Statue of Liberty", "Spring Temple Buddha", "Statue of Unity", "Christ the Redeemer"],
correct: "Statue of Unity"
},
{
q: "What is the 'book of rules' for our country called?",
options: ["The Law Book", "The Constitution", "The Penal Code", "The Rule Book"],
correct: "The Constitution"
},
{
q: "The National Emblem represents Strength, Courage, and...?",
options: ["Confidence", "Peace", "Kindness", "Honesty"],
correct: "Confidence"
},
{
q: "In which state do men traditionally wear a colorful 'Saafa' or 'Pagri'?",
options: ["Kerala", "Rajasthan", "Assam", "Goa"],
correct: "Rajasthan"
},
{
q: "India has the world's largest digital ID system known as...?",
options: ["PAN Card", "Voter ID", "Aadhaar", "Passport"],
correct: "Aadhaar"
},
{
q: "When is Independence Day celebrated in India?",
options: ["26 January", "15 August", "2 October", "14 November"],
correct: "15 August"
}
];
// --- Components ---
const Modal = ({ isOpen, question, onClose, onAnswer }) => {
if (!isOpen || !question) return null;
return (