<?php

namespace Database\Seeders;

use App\Models\Regulation;
use App\Models\State;
use Illuminate\Database\Seeder;

/**
 * India Land Regulations Seeder
 *
 * Seeds national, state, and municipal land development regulations
 * covering all 28 Indian states + Delhi.
 *
 * Regulation types: National | State | Municipal | CRZ | RERA | Heritage
 *
 * Sources: Official gazette notifications, MoHUA publications, state TCP
 * department publications, RERA authority portals, and MoEFCC notifications.
 */
class IndiaRegulationsSeeder extends Seeder
{
    public function run(): void
    {
        // ── National-level regulations (state_id = null) ────────────
        $this->seedNationalRegulations();

        // ── State-level regulations ─────────────────────────────────
        $this->seedStateRegulations();

        // ── Municipal-level regulations ─────────────────────────────
        $this->seedMunicipalRegulations();

        $this->command->info('Regulation seeding complete — '
            . Regulation::count() . ' total regulations.');
    }

    // ================================================================
    //  NATIONAL REGULATIONS
    // ================================================================

    private function seedNationalRegulations(): void
    {
        $regulations = [
            // ── Core National Acts ──────────────────────────────────
            [
                'title'          => 'National Building Code of India (NBC), 2016',
                'type'           => 'National',
                'authority'      => 'Bureau of Indian Standards (BIS)',
                'effective_date' => '2016-01-01',
                'description'    => 'Comprehensive building code covering planning, construction, fire safety, structural design, building services, and sustainability for all building types across India. Part 3 covers Development Control Rules and General Building Requirements.',
            ],
            [
                'title'          => 'Model Building Bye-Laws, 2016',
                'type'           => 'National',
                'authority'      => 'Ministry of Housing and Urban Affairs (MoHUA)',
                'effective_date' => '2016-11-01',
                'description'    => 'Model framework for states/UTs to adopt for building permission, land use, FAR, height, setbacks, parking, and green building norms. Includes provisions for transit-oriented development and ease of doing business.',
            ],
            [
                'title'          => 'Urban and Regional Development Plans Formulation & Implementation (URDPFI) Guidelines, 2014',
                'type'           => 'National',
                'authority'      => 'Ministry of Housing and Urban Affairs (MoHUA)',
                'effective_date' => '2015-01-01',
                'description'    => 'Guidelines for preparation of regional plans, development plans, zonal plans, and local area plans. Covers land use classification, density norms, infrastructure standards, and plan implementation mechanisms.',
            ],
            [
                'title'          => 'The Right to Fair Compensation and Transparency in Land Acquisition, Rehabilitation and Resettlement Act, 2013 (LARR)',
                'type'           => 'National',
                'authority'      => 'Ministry of Rural Development',
                'effective_date' => '2014-01-01',
                'description'    => 'Regulates land acquisition for public purpose and infrastructure projects. Mandates Social Impact Assessment (SIA), consent requirements (70–80% for PPP/private), fair compensation (up to 4x market value in rural areas), and R&R provisions.',
            ],
            [
                'title'          => 'The Transfer of Property Act, 1882',
                'type'           => 'National',
                'authority'      => 'Ministry of Law and Justice',
                'effective_date' => '1882-07-01',
                'description'    => 'Governs transfer of immovable property — sale, mortgage, lease, exchange, and gift. Defines rights and liabilities of parties in property transactions, including registration requirements and restrictions on transfer.',
            ],
            [
                'title'          => 'The Indian Registration Act, 1908',
                'type'           => 'National',
                'authority'      => 'Ministry of Law and Justice',
                'effective_date' => '1908-01-01',
                'description'    => 'Mandates compulsory registration of documents relating to transfer of immovable property, leases exceeding one year, and creation of rights. Covers registration procedures, fees, and maintenance of public records.',
            ],
            [
                'title'          => 'The Indian Stamp Act, 1899',
                'type'           => 'National',
                'authority'      => 'Ministry of Finance',
                'effective_date' => '1899-07-01',
                'description'    => 'Levies stamp duty on instruments of property transfer, conveyances, mortgages, leases, and agreements. States adopt their own schedules with varying duty rates. Key fiscal regulation affecting land transaction costs.',
            ],
            [
                'title'          => 'The Environment Protection Act, 1986',
                'type'           => 'National',
                'authority'      => 'Ministry of Environment, Forest and Climate Change (MoEFCC)',
                'effective_date' => '1986-11-19',
                'description'    => 'Umbrella legislation for environmental protection. Empowers central government to set environmental standards, restrict industrial/development activities in ecologically sensitive areas, and mandate Environmental Impact Assessments (EIA).',
            ],
            [
                'title'          => 'Environmental Impact Assessment (EIA) Notification, 2006 (amended 2020)',
                'type'           => 'National',
                'authority'      => 'Ministry of Environment, Forest and Climate Change (MoEFCC)',
                'effective_date' => '2006-09-14',
                'description'    => 'Mandates prior environmental clearance for development projects exceeding specified thresholds — construction ≥20,000 sq.m built-up area, townships ≥50 ha, industrial areas, infrastructure projects. Requires EIA study, public hearing, and Expert Appraisal Committee review.',
            ],
            [
                'title'          => 'Energy Conservation Building Code (ECBC), 2017',
                'type'           => 'National',
                'authority'      => 'Bureau of Energy Efficiency (BEE)',
                'effective_date' => '2017-06-19',
                'description'    => 'Sets minimum energy performance standards for commercial buildings with connected load ≥100 kW or contract demand ≥120 kVA. Covers building envelope, HVAC, lighting, electrical systems, and renewable energy integration.',
            ],
            [
                'title'          => 'Metro Railways (Construction of Works) Standard Specifications and Code of Practice, 2013',
                'type'           => 'National',
                'authority'      => 'Ministry of Housing and Urban Affairs (MoHUA)',
                'effective_date' => '2013-10-01',
                'description'    => 'Regulates construction within metro rail zones. Defines influence zones, minimum clearances, structural safety requirements for buildings adjacent to metro corridors, and Transit Oriented Development (TOD) norms.',
            ],

            // ── RERA ────────────────────────────────────────────────
            [
                'title'          => 'Real Estate (Regulation and Development) Act, 2016 (RERA)',
                'type'           => 'RERA',
                'authority'      => 'Ministry of Housing and Urban Affairs (MoHUA)',
                'effective_date' => '2016-05-01',
                'description'    => 'Central Act mandating registration of real estate projects (≥500 sq.m or ≥8 units) and real estate agents. Requires disclosure of project details, carpet area, completion timeline, and escrow of 70% project funds. Each state establishes a Real Estate Regulatory Authority and Appellate Tribunal.',
            ],
            [
                'title'          => 'Real Estate (Regulation and Development) General Rules, 2016',
                'type'           => 'RERA',
                'authority'      => 'Ministry of Housing and Urban Affairs (MoHUA)',
                'effective_date' => '2016-10-31',
                'description'    => 'Central rules prescribing application forms, project registration format, quarterly update requirements, complaint filing procedures, and financial audit obligations under RERA.',
            ],

            // ── CRZ ────────────────────────────────────────────────
            [
                'title'          => 'Coastal Regulation Zone (CRZ) Notification, 2019',
                'type'           => 'CRZ',
                'authority'      => 'Ministry of Environment, Forest and Climate Change (MoEFCC)',
                'effective_date' => '2019-01-18',
                'description'    => 'Classifies coastal stretches into CRZ-I (ecologically sensitive), CRZ-II (developed urban), CRZ-III (rural), and CRZ-IV (water area). Regulates development setbacks (50m for CRZ-II, 200m for CRZ-III) and permissible activities. Mandates Coastal Zone Management Plans (CZMP) by states.',
            ],
            [
                'title'          => 'Island Coastal Regulation Zone (ICRZ) Notification, 2019',
                'type'           => 'CRZ',
                'authority'      => 'Ministry of Environment, Forest and Climate Change (MoEFCC)',
                'effective_date' => '2019-01-18',
                'description'    => 'Specific CRZ regulations for Andaman and Nicobar Islands and Lakshadweep, with stricter development controls, 20m–200m setback requirements, and special provisions for tribal habitations.',
            ],

            // ── Heritage ────────────────────────────────────────────
            [
                'title'          => 'The Ancient Monuments and Archaeological Sites and Remains Act, 1958 (AMASR)',
                'type'           => 'Heritage',
                'authority'      => 'Archaeological Survey of India (ASI)',
                'effective_date' => '1959-08-28',
                'description'    => 'Protects monuments of national importance. Prohibits construction within 100m regulated area and restricts construction in 200m prohibited area around ASI-protected monuments. Over 3,600 monuments across India.',
            ],
            [
                'title'          => 'AMASR (Amendment and Validation) Act, 2010',
                'type'           => 'Heritage',
                'authority'      => 'Archaeological Survey of India (ASI)',
                'effective_date' => '2010-03-29',
                'description'    => 'Amends the 1958 Act to establish National Monuments Authority (NMA). Defines prohibited area (100m) and regulated area (200m) around protected monuments. NMA grants permissions for construction in regulated areas with heritage impact assessment.',
            ],
        ];

        foreach ($regulations as $reg) {
            Regulation::firstOrCreate(
                ['title' => $reg['title']],
                array_merge($reg, ['state_id' => null, 'is_active' => true])
            );
        }

        $this->command->info('  ✓ National regulations seeded: ' . count($regulations));
    }

    // ================================================================
    //  STATE REGULATIONS
    // ================================================================

    private function seedStateRegulations(): void
    {
        $stateRegulations = $this->stateRegulationData();
        $total = 0;

        foreach ($stateRegulations as $code => $regs) {
            $state = State::where('code', $code)->first();
            if (! $state) {
                $this->command->warn("  State [{$code}] not found — skipping.");
                continue;
            }

            foreach ($regs as $reg) {
                Regulation::firstOrCreate(
                    ['title' => $reg['title'], 'state_id' => $state->id],
                    array_merge($reg, ['state_id' => $state->id, 'is_active' => $reg['is_active'] ?? true])
                );
                $total++;
            }

            $this->command->info("  ✓ {$state->name} ({$code}): " . count($regs) . ' regulations');
        }

        $this->command->info("  ✓ State regulations seeded: {$total}");
    }

    // ================================================================
    //  MUNICIPAL REGULATIONS
    // ================================================================

    private function seedMunicipalRegulations(): void
    {
        $municipalRegs = $this->municipalRegulationData();
        $total = 0;

        foreach ($municipalRegs as $code => $regs) {
            $state = State::where('code', $code)->first();
            if (! $state) {
                $this->command->warn("  State [{$code}] not found for municipal regs — skipping.");
                continue;
            }

            foreach ($regs as $reg) {
                Regulation::firstOrCreate(
                    ['title' => $reg['title'], 'state_id' => $state->id],
                    array_merge($reg, ['state_id' => $state->id, 'type' => 'Municipal', 'is_active' => $reg['is_active'] ?? true])
                );
                $total++;
            }
        }

        $this->command->info("  ✓ Municipal regulations seeded: {$total}");
    }

    // ================================================================
    //  STATE REGULATION DATA
    // ================================================================

    private function stateRegulationData(): array
    {
        return [
            // ── Andhra Pradesh ──────────────────────────────────────
            'AP' => [
                [
                    'title'          => 'Andhra Pradesh Town Planning Act, 1920 (as amended)',
                    'type'           => 'State',
                    'authority'      => 'AP Directorate of Town & Country Planning',
                    'effective_date' => '1920-01-01',
                    'description'    => 'Primary town planning legislation for AP. Empowers constitution of planning authorities, preparation of master plans, zoning regulations, and development permission systems for urban areas.',
                ],
                [
                    'title'          => 'AP Building Rules (G.O. Ms. No. 119), 2017',
                    'type'           => 'State',
                    'authority'      => 'AP Municipal Administration & Urban Development Dept.',
                    'effective_date' => '2017-04-01',
                    'description'    => 'Comprehensive building rules covering plot coverage, FAR/FSI, height restrictions, setbacks, parking norms, fire safety, and rain water harvesting. Applies to all urban local bodies. Introduces online building permission system (eBPAS).',
                ],
                [
                    'title'          => 'AP Capital Region Development Authority (CRDA) Zoning Development Regulations, 2022',
                    'type'           => 'State',
                    'authority'      => 'APCRDA',
                    'effective_date' => '2022-01-01',
                    'description'    => 'Zoning regulations for the Amaravati Capital Region covering land use classification, zone-wise development controls, FAR norms, height limits, and special provisions for government, institutional, and affordable housing zones.',
                ],
                [
                    'title'          => 'AP Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'AP Real Estate Regulatory Authority',
                    'effective_date' => '2017-07-28',
                    'description'    => 'State rules implementing RERA 2016 — project registration thresholds, promoter obligations, allottee rights, complaint mechanisms, and quarterly progress disclosure requirements for AP.',
                ],
                [
                    'title'          => 'AP Land Revenue Code (AP Record of Rights in Land and Pattadar Pass Books Act), 1971',
                    'type'           => 'State',
                    'authority'      => 'AP Revenue Department',
                    'effective_date' => '1971-01-01',
                    'description'    => 'Governs land ownership records, mutation of titles, land classification (agricultural / non-agricultural conversion), and revenue administration for all land in Andhra Pradesh.',
                ],
            ],

            // ── Arunachal Pradesh ───────────────────────────────────
            'AR' => [
                [
                    'title'          => 'Arunachal Pradesh (Town Planning & Country Development) Act, 2008',
                    'type'           => 'State',
                    'authority'      => 'Dept. of Town Planning, Govt. of Arunachal Pradesh',
                    'effective_date' => '2008-01-01',
                    'description'    => 'Establishes town planning framework for Arunachal Pradesh including preparation of development plans, zoning regulations, and building permission systems for scheduled areas.',
                ],
                [
                    'title'          => 'Itanagar Capital Region Building Bye-Laws, 2019',
                    'type'           => 'State',
                    'authority'      => 'Itanagar Capital Region Planning Board',
                    'effective_date' => '2019-01-01',
                    'description'    => 'Building regulation covering FAR, ground coverage, setbacks, height restrictions, and parking norms for the Itanagar capital region, adapted from National Building Code 2016 for hilly terrain.',
                ],
                [
                    'title'          => 'AP (Arunachal Pradesh) Land Revenue & Land Reforms Act, 2000',
                    'type'           => 'State',
                    'authority'      => 'Revenue Department, Govt. of Arunachal Pradesh',
                    'effective_date' => '2000-01-01',
                    'description'    => 'Governs land ownership, customary community land rights, conversion of land use, and revenue records in Arunachal Pradesh. Special provisions for scheduled tribe land protection.',
                ],
            ],

            // ── Assam ───────────────────────────────────────────────
            'AS' => [
                [
                    'title'          => 'Assam Town and Country Planning Act, 1959',
                    'type'           => 'State',
                    'authority'      => 'Assam Town and Country Planning Department',
                    'effective_date' => '1959-01-01',
                    'description'    => 'Primary planning legislation for Assam. Provides for preparation of master plans, zonal development plans, and development permission systems for urban and rural areas.',
                ],
                [
                    'title'          => 'Guwahati Metropolitan Development Authority (Building Construction) Rules, 2021',
                    'type'           => 'State',
                    'authority'      => 'GMDA',
                    'effective_date' => '2021-01-01',
                    'description'    => 'Development control regulations for Guwahati Metropolitan Area covering FAR, height restrictions, setbacks, parking, fire safety, road-width-based norms, and special provisions for flood-prone and hill zone areas.',
                ],
                [
                    'title'          => 'Assam Land and Revenue Regulation, 1886',
                    'type'           => 'State',
                    'authority'      => 'Assam Revenue & Disaster Management Department',
                    'effective_date' => '1886-01-01',
                    'description'    => 'Foundational land revenue regulation governing settlement of land, land-use classification, mutation of ownership records, and agricultural land conversion procedures in Assam.',
                ],
            ],

            // ── Bihar ───────────────────────────────────────────────
            'BR' => [
                [
                    'title'          => 'Bihar Town Planning and Improvement Trust Act, 1951',
                    'type'           => 'State',
                    'authority'      => 'Bihar Urban Development Department',
                    'effective_date' => '1951-01-01',
                    'description'    => 'Establishes Town Planning Improvement Trusts in major Bihar cities. Empowers preparation of town planning schemes, land acquisition for development, and development control within trust jurisdictions.',
                ],
                [
                    'title'          => 'Bihar Building Bye-Laws, 2014',
                    'type'           => 'State',
                    'authority'      => 'Bihar Urban Development Department',
                    'effective_date' => '2014-01-01',
                    'description'    => 'Comprehensive building regulations covering land use, FAR (1.5 to 3.0), height restrictions, setbacks, parking norms, fire safety, and green building provisions for all urban local bodies in Bihar.',
                ],
                [
                    'title'          => 'Bihar Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Bihar RERA',
                    'effective_date' => '2017-07-01',
                    'description'    => 'State RERA rules covering project registration, agent registration, disclosure requirements, advance collection limits, and complaint resolution procedures for real estate projects in Bihar.',
                ],
                [
                    'title'          => 'Bihar Land Reforms (Fixation of Ceiling Area and Acquisition of Surplus Land) Act, 1961',
                    'type'           => 'State',
                    'authority'      => 'Bihar Revenue & Land Reforms Department',
                    'effective_date' => '1961-01-01',
                    'description'    => 'Fixes ceiling on landholding for agricultural and homestead land in Bihar. Governs acquisition of surplus land and redistribution. Maximum ceiling: 15 acres irrigated / 30 acres un-irrigated.',
                ],
            ],

            // ── Chhattisgarh ────────────────────────────────────────
            'CG' => [
                [
                    'title'          => 'Chhattisgarh Nagar Tatha Gram Nivesh Adhiniyam, 1973 (as adapted from MP)',
                    'type'           => 'State',
                    'authority'      => 'CG Town & Country Planning Department',
                    'effective_date' => '2000-11-01',
                    'description'    => 'Planning legislation adapted from Madhya Pradesh after state bifurcation. Covers preparation of development plans, zoning plans, and development permission for all settlements in Chhattisgarh.',
                ],
                [
                    'title'          => 'Chhattisgarh Building Bye-Laws (Bhavan Nirmaan Niyam), 2019',
                    'type'           => 'State',
                    'authority'      => 'CG Urban Administration & Development Department',
                    'effective_date' => '2019-01-01',
                    'description'    => 'Building control regulations covering FAR, ground coverage, height restrictions, setbacks, road-width norms, parking, fire safety, and special provisions for industrial and commercial zones.',
                ],
                [
                    'title'          => 'Chhattisgarh Land Revenue Code, 1959 (as adapted)',
                    'type'           => 'State',
                    'authority'      => 'CG Revenue Department',
                    'effective_date' => '2000-11-01',
                    'description'    => 'Land revenue administration covering land records, mutation, diversion of agricultural land, land classification, and revenue collection, inherited from MP Land Revenue Code.',
                ],
            ],

            // ── Delhi ───────────────────────────────────────────────
            'DL' => [
                [
                    'title'          => 'Delhi Development Act, 1957',
                    'type'           => 'State',
                    'authority'      => 'Delhi Development Authority (DDA)',
                    'effective_date' => '1957-12-30',
                    'description'    => 'Primary planning legislation for Delhi. Establishes DDA and empowers it to prepare Master Plans, zonal plans, and layout plans. Governs land acquisition, development, disposal, and building regulation in the National Capital Territory.',
                ],
                [
                    'title'          => 'Master Plan for Delhi (MPD) 2041',
                    'type'           => 'State',
                    'authority'      => 'Delhi Development Authority (DDA)',
                    'effective_date' => '2021-12-01',
                    'description'    => 'Comprehensive master plan covering land use zoning for entire NCT of Delhi. Defines residential, commercial, industrial, recreational, transportation, and green zone norms. Sets FAR, density, height, and ground coverage standards. Includes TOD policy and mixed-use norms.',
                ],
                [
                    'title'          => 'Unified Building Bye-Laws for Delhi, 2016',
                    'type'           => 'State',
                    'authority'      => 'Delhi Development Authority (DDA)',
                    'effective_date' => '2016-01-01',
                    'description'    => 'Consolidated building rules for all local bodies (DDA, MCD, NDMC, DCB). Covers FAR ranges (1.5–3.5), height based on road width, setbacks, parking norms, green building mandates (GRIHA/IGBC rating for >5000 sqm), fire safety, structural stability, and barrier-free accessibility.',
                ],
                [
                    'title'          => 'Delhi Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Delhi RERA',
                    'effective_date' => '2017-12-01',
                    'description'    => 'Delhi state RERA rules covering project registration, real estate agent registration, buyer protection mechanisms, and tribunal provisions for Delhi NCT.',
                ],
            ],

            // ── Goa ────────────────────────────────────────────────
            'GA' => [
                [
                    'title'          => 'The Goa Town and Country Planning Act, 1974',
                    'type'           => 'State',
                    'authority'      => 'Goa Town & Country Planning Department',
                    'effective_date' => '1974-01-01',
                    'description'    => 'Primary planning legislation for Goa. Empowers preparation of regional plans, outline development plans (ODP), comprehensive development plans, and development permissions with special provisions for eco-sensitive zones.',
                ],
                [
                    'title'          => 'Goa Land Development and Building Construction Regulations, 2010 (amended 2022)',
                    'type'           => 'State',
                    'authority'      => 'Goa TCP Department',
                    'effective_date' => '2010-11-01',
                    'description'    => 'Building regulations covering FAR (0.75 to 2.0), ground coverage (40-60%), height restrictions, setbacks, parking, and special controls for CRZ areas, eco-sensitive zones, and heritage precincts (Old Goa, Fontainhas).',
                ],
                [
                    'title'          => 'Regional Plan for Goa 2021 (extended to 2031)',
                    'type'           => 'State',
                    'authority'      => 'Goa TCP Department',
                    'effective_date' => '2011-01-01',
                    'description'    => 'Regional land use plan for North Goa and South Goa districts covering settlement zones, no-development zones, agricultural zones, forest zones, eco-sensitive zones, and coastal regulation zone mapping.',
                ],
                [
                    'title'          => 'Goa, Daman and Diu Land Revenue Code, 1968',
                    'type'           => 'State',
                    'authority'      => 'Goa Revenue Department',
                    'effective_date' => '1968-01-01',
                    'description'    => 'Land revenue legislation covering comunidade (community land) traditions unique to Goa, land mutation, classification, conversion of agricultural to non-agricultural land, and revenue record maintenance.',
                ],
            ],

            // ── Gujarat ─────────────────────────────────────────────
            'GJ' => [
                [
                    'title'          => 'Gujarat Town Planning and Urban Development Act (GTPUDA), 1976',
                    'type'           => 'State',
                    'authority'      => 'Gujarat Urban Development & Urban Housing Department',
                    'effective_date' => '1976-02-01',
                    'description'    => 'Primary planning legislation for Gujarat. Establishes Area Development Authorities and Urban Development Authorities. Empowers preparation of development plans, town planning schemes (TP schemes), and development permission regulations.',
                ],
                [
                    'title'          => 'Gujarat General Development Control Regulations (GDCR), 2017',
                    'type'           => 'State',
                    'authority'      => 'Gujarat Urban Development & Urban Housing Department',
                    'effective_date' => '2017-09-01',
                    'description'    => 'Comprehensive development control regulations covering FAR (1.2–4.0 based on road width and zone), height (no limit for >30m road), ground coverage (40-60%), setbacks, parking, fire safety, affordable housing incentive FSI, TOD norms, and green building mandates.',
                ],
                [
                    'title'          => 'Gujarat Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Gujarat RERA (GujRERA)',
                    'effective_date' => '2017-05-01',
                    'description'    => 'Gujarat RERA rules with online registration portal (GujRERA), project quarterly updates, allottee registration, agent registration, and complaint adjudication procedures.',
                ],
                [
                    'title'          => 'Gujarat Land Revenue Code, 1879 (as amended)',
                    'type'           => 'State',
                    'authority'      => 'Gujarat Revenue Department',
                    'effective_date' => '1879-01-01',
                    'description'    => 'Land revenue administration covering land tenure, mutation, non-agricultural (NA) land conversion approval from Collector, land ceiling, and village form (VF-7/12 extract) record systems.',
                ],
            ],

            // ── Haryana ─────────────────────────────────────────────
            'HR' => [
                [
                    'title'          => 'Haryana Development and Regulation of Urban Areas Act, 1975',
                    'type'           => 'State',
                    'authority'      => 'Haryana Town & Country Planning Department',
                    'effective_date' => '1975-09-17',
                    'description'    => 'Regulates colonization and development of urban areas in Haryana. Requires license for developing colonies, establishes FAR/density norms, and mandates infrastructure development by colonizers. Key regulation for Gurugram real estate development.',
                ],
                [
                    'title'          => 'Haryana Building Code, 2017',
                    'type'           => 'State',
                    'authority'      => 'Haryana Town & Country Planning Department',
                    'effective_date' => '2017-01-01',
                    'description'    => 'Building control regulations covering FAR (1.5–3.5), height based on road width and zone, setbacks, parking (ECS norms), fire safety, green building provisions, and special norms for IT/ITES zones and group housing.',
                ],
                [
                    'title'          => 'Haryana Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Haryana RERA (HRERA)',
                    'effective_date' => '2017-07-28',
                    'description'    => 'Haryana RERA rules with two offices — Gurugram and Panchkula. Project registration, buyer protection, carpet area disclosure mandates, completion timeline enforcement, and adjudication procedures.',
                ],
                [
                    'title'          => 'Haryana Punjab Scheduled Roads and Controlled Areas Restriction of Unregulated Development Act, 1963',
                    'type'           => 'State',
                    'authority'      => 'Haryana Town & Country Planning Department',
                    'effective_date' => '1963-01-01',
                    'description'    => 'Restricts unauthorized construction along scheduled roads and in controlled areas around urban centers. Mandates permission for development within controlled area limits. Critical for peri-urban development control.',
                ],
            ],

            // ── Himachal Pradesh ────────────────────────────────────
            'HP' => [
                [
                    'title'          => 'Himachal Pradesh Town and Country Planning Act, 1977',
                    'type'           => 'State',
                    'authority'      => 'HP Town and Country Planning Department',
                    'effective_date' => '1977-01-01',
                    'description'    => 'Planning legislation covering preparation of development plans, zoning regulations, and building permissions. Special provisions for hill area development, landslide-prone zones, and ridge protection.',
                ],
                [
                    'title'          => 'Himachal Pradesh Building Bye-Laws (TCP Rules), 2014',
                    'type'           => 'State',
                    'authority'      => 'HP Town and Country Planning Department',
                    'effective_date' => '2014-01-01',
                    'description'    => 'Hill-area specific building regulations covering FAR (1.0–2.5), height restrictions (max 4 storeys in most areas), setbacks adjusted for terrain slope, parking on slope, retaining wall requirements, and earthquake-resistant construction mandates (Seismic Zone IV-V).',
                ],
                [
                    'title'          => 'HP Tenancy and Land Reforms Act, 1972',
                    'type'           => 'State',
                    'authority'      => 'HP Revenue Department',
                    'effective_date' => '1972-01-01',
                    'description'    => 'Regulates land ownership and tenancy in Himachal Pradesh. Places restrictions on sale of agricultural land to non-agriculturists. Land ceiling provisions and protection of tribal land rights in scheduled areas.',
                ],
                [
                    'title'          => 'HP Section 118 — Restriction on Land Transfer',
                    'type'           => 'State',
                    'authority'      => 'HP Revenue Department',
                    'effective_date' => '1972-01-01',
                    'description'    => 'Section 118 of HP Tenancy Act restricts transfer of land to non-agriculturists in rural/agricultural areas. Government permission is required. Key regulation affecting real estate development by outsiders in HP.',
                ],
            ],

            // ── Jharkhand ───────────────────────────────────────────
            'JH' => [
                [
                    'title'          => 'Jharkhand Building Bye-Laws, 2016',
                    'type'           => 'State',
                    'authority'      => 'Jharkhand Urban Development Department',
                    'effective_date' => '2016-01-01',
                    'description'    => 'Building control regulations covering FAR (1.5–3.0), height, setbacks, ground coverage, parking, fire safety, and green building norms for all urban local bodies in Jharkhand.',
                ],
                [
                    'title'          => 'Ranchi Regional Development Authority (Building Permission) Rules, 2018',
                    'type'           => 'State',
                    'authority'      => 'RRDA, Jharkhand',
                    'effective_date' => '2018-01-01',
                    'description'    => 'Development control regulations for Ranchi Regional Development Authority area covering land use zoning, development permission process, FAR norms, and infrastructure requirements for building approvals.',
                ],
                [
                    'title'          => 'Chhotanagpur Tenancy Act, 1908',
                    'type'           => 'State',
                    'authority'      => 'Jharkhand Revenue Department',
                    'effective_date' => '1908-01-01',
                    'description'    => 'Protects tribal land rights in Chhotanagpur region. Restricts sale and transfer of tribal land to non-tribals. Section 49 and 71A are critical provisions that affect real estate transactions and land feasibility in large parts of Jharkhand.',
                ],
                [
                    'title'          => 'Santhal Parganas Tenancy (Supplementary Provisions) Act, 1949',
                    'type'           => 'State',
                    'authority'      => 'Jharkhand Revenue Department',
                    'effective_date' => '1949-01-01',
                    'description'    => 'Additional protections for tribal land in Santhal Parganas division. Prohibits transfer of Adivasi land to non-Adivasis. Affects land acquisition and development in Dumka, Deoghar, Godda, Pakur, Sahibganj, and Jamtara districts.',
                ],
            ],

            // ── Karnataka ───────────────────────────────────────────
            'KA' => [
                [
                    'title'          => 'Karnataka Town and Country Planning Act, 1961 (KTCP Act)',
                    'type'           => 'State',
                    'authority'      => 'Karnataka Town & Country Planning Department',
                    'effective_date' => '1961-01-01',
                    'description'    => 'Primary planning legislation authorizing preparation of outline development plans, comprehensive development plans, and zonal regulations for all planning areas in Karnataka.',
                ],
                [
                    'title'          => 'Karnataka Revised Master Plan 2031 — Zoning Regulations',
                    'type'           => 'State',
                    'authority'      => 'Bangalore Development Authority (BDA)',
                    'effective_date' => '2015-01-01',
                    'description'    => 'Zoning regulations for Bangalore Metropolitan Area covering residential, commercial, industrial, public & semi-public, parks, and transportation zones with FAR, height, setback, and ground coverage norms.',
                ],
                [
                    'title'          => 'Karnataka Land Revenue Act, 1964',
                    'type'           => 'State',
                    'authority'      => 'Karnataka Revenue Department',
                    'effective_date' => '1964-01-01',
                    'description'    => 'Land revenue legislation covering land classification, mutation records, agricultural to non-agricultural land conversion (Section 95), land tenure system, and revenue records (RTC/Pahani) maintenance.',
                ],
                [
                    'title'          => 'Karnataka Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Karnataka RERA (K-RERA)',
                    'effective_date' => '2017-07-10',
                    'description'    => 'Karnataka RERA rules governing project registration, agent registration, quarterly disclosure, carpet area definition, completion timelines, and regulatory authority constitution with offices in Bangalore.',
                ],
                [
                    'title'          => 'Karnataka Land Reforms Act, 1961',
                    'type'           => 'State',
                    'authority'      => 'Karnataka Revenue Department',
                    'effective_date' => '1961-01-01',
                    'description'    => 'Land ceiling legislation: 10 acres irrigated / 54 acres dry. Restricts non-agriculturist purchase of agricultural land. Section 79A and 79B govern land conversion and are critical for real estate feasibility.',
                ],
            ],

            // ── Kerala ──────────────────────────────────────────────
            'KL' => [
                [
                    'title'          => 'Kerala Town Planning Act, 2016',
                    'type'           => 'State',
                    'authority'      => 'Kerala Town & Country Planning Department',
                    'effective_date' => '2016-12-01',
                    'description'    => 'Modern planning legislation replacing the 1108 (ME) Act. Covers preparation of master plans, detailed town planning schemes, development permissions, and special area development plans. Integrates GIS-based planning and online building permission.',
                ],
                [
                    'title'          => 'Kerala Municipality Building Rules (KMBR), 2019',
                    'type'           => 'State',
                    'authority'      => 'Kerala Local Self Government Department',
                    'effective_date' => '2019-07-24',
                    'description'    => 'Building rules for municipal areas covering plot size, road width-based FAR (1.5–4.0), height restrictions, setbacks, parking, fire safety, plastic waste management room, and rainwater harvesting mandates. Categorizes buildings into 7 occupancy groups.',
                ],
                [
                    'title'          => 'Kerala Panchayat Building Rules, 2019',
                    'type'           => 'State',
                    'authority'      => 'Kerala Local Self Government Department',
                    'effective_date' => '2019-07-24',
                    'description'    => 'Building rules for panchayat areas with slightly relaxed norms compared to municipalities. Coverage and FAR based on road access width and locality classification.',
                ],
                [
                    'title'          => 'Kerala Real Estate (Regulation and Development) Rules, 2018',
                    'type'           => 'RERA',
                    'authority'      => 'Kerala RERA (K-RERA)',
                    'effective_date' => '2018-01-01',
                    'description'    => 'Kerala RERA rules covering project registration through K-RERA portal, agent registration, quarterly progress updates, financial audit, buyer complaint redressal, and appellate tribunal.',
                ],
                [
                    'title'          => 'Kerala Land Reforms Act, 1963',
                    'type'           => 'State',
                    'authority'      => 'Kerala Revenue Department',
                    'effective_date' => '1964-04-01',
                    'description'    => 'One of India\'s most comprehensive land reform laws. Ceiling: 15 acres per family for food crops, 7.5 acres for other crops. Governs tenancy rights, land conversion permissions, and purchase of paddy land restrictions.',
                ],
            ],

            // ── Madhya Pradesh ──────────────────────────────────────
            'MP' => [
                [
                    'title'          => 'Madhya Pradesh Nagar Tatha Gram Nivesh Adhiniyam (Town & Country Planning Act), 1973',
                    'type'           => 'State',
                    'authority'      => 'MP Town & Country Planning Department',
                    'effective_date' => '1973-01-01',
                    'description'    => 'Main planning legislation for Madhya Pradesh. Provides for development plans, zoning, and development permissions for all cities and major settlements. Establishes Town and Country Development Authority for each region.',
                ],
                [
                    'title'          => 'Madhya Pradesh Bhumi Vikas Niyam (Land Development Rules), 2012',
                    'type'           => 'State',
                    'authority'      => 'MP Urban Development & Housing Department',
                    'effective_date' => '2012-09-01',
                    'description'    => 'Comprehensive building rules covering FAR (1.0–3.0), height restrictions, setbacks, ground coverage, parking norms based on road width, fire safety, and special provisions for group housing, commercial complexes, and institutional buildings.',
                ],
                [
                    'title'          => 'Madhya Pradesh Land Revenue Code, 1959',
                    'type'           => 'State',
                    'authority'      => 'MP Revenue Department',
                    'effective_date' => '1959-10-02',
                    'description'    => 'Land revenue administration covering Bhu-Adhikar (land rights), land records (Khasra, B-1), land-use diversion, mutation, and revenue collection. Online land records through Bhulekh portal.',
                ],
                [
                    'title'          => 'MP Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'MP RERA',
                    'effective_date' => '2017-09-01',
                    'description'    => 'MP RERA rules governing project registration, promoter obligations, allottee protection, quarterly update disclosure, complaint redressal, and appellate tribunal provisions.',
                ],
            ],

            // ── Maharashtra ─────────────────────────────────────────
            'MH' => [
                [
                    'title'          => 'Maharashtra Regional and Town Planning (MRTP) Act, 1966',
                    'type'           => 'State',
                    'authority'      => 'Maharashtra Town Planning & Valuation Department',
                    'effective_date' => '1966-12-23',
                    'description'    => 'Primary planning legislation for Maharashtra. Empowers preparation of regional plans, development plans, town planning schemes, and development control regulations. Constitutes planning authorities including MMRDA, CIDCO, and municipal corporations as planning authorities.',
                ],
                [
                    'title'          => 'Unified Development Control and Promotion Regulations (UDCPR) for Maharashtra, 2020',
                    'type'           => 'State',
                    'authority'      => 'Maharashtra Urban Development Department',
                    'effective_date' => '2020-12-03',
                    'description'    => 'Unified DCR for entire Maharashtra (except Mumbai and MHADA areas). Standardizes FAR, TDR, premium FSI, height, setback, parking, and affordable housing incentive norms across all municipal corporations, councils, and nagar panchayats.',
                ],
                [
                    'title'          => 'Maharashtra Real Estate (Regulation and Development) (Registration of Real Estate Projects, Registration of Real Estate Agents, Rates of Interest and Disclosures on Website) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'MahaRERA',
                    'effective_date' => '2017-04-26',
                    'description'    => 'Maharashtra RERA rules — first state to fully implement RERA with active MahaRERA portal. Project registration, agent registration, carpet area disclosures, quarterly updates, complaint filing, and conciliation forum provisions.',
                ],
                [
                    'title'          => 'Maharashtra Land Revenue Code, 1966',
                    'type'           => 'State',
                    'authority'      => 'Maharashtra Revenue Department',
                    'effective_date' => '1966-08-11',
                    'description'    => 'Land revenue legislation governing occupancy rights, land tenure, mutation (ferfar), agricultural to non-agricultural land conversion (Section 44), land ceiling, and revenue records (7/12 extract, mutation entry).',
                ],
                [
                    'title'          => 'Maharashtra Gunthewari Developments (Regularisation, Upgradation and Control) Act, 2001',
                    'type'           => 'State',
                    'authority'      => 'Maharashtra Urban Development Department',
                    'effective_date' => '2001-01-01',
                    'description'    => 'Regularization of unauthorized constructions (gunthewari) developed on NA-converted agricultural land in peri-urban areas. Provides for upgradation of infrastructure and regularization of layout permissions for such developments.',
                ],
            ],

            // ── Manipur ─────────────────────────────────────────────
            'MN' => [
                [
                    'title'          => 'Manipur Town and Country Planning Act, 1975',
                    'type'           => 'State',
                    'authority'      => 'Manipur Town Planning Department',
                    'effective_date' => '1975-01-01',
                    'description'    => 'Planning legislation for Manipur covering development plans, zoning regulations, and building permission for urban areas in the Imphal valley and hill district headquarters.',
                ],
                [
                    'title'          => 'Manipur Building Bye-Laws, 2018',
                    'type'           => 'State',
                    'authority'      => 'Manipur Urban Development Department',
                    'effective_date' => '2018-01-01',
                    'description'    => 'Building regulations adapted from Model Building Bye-Laws covering FAR, ground coverage, setbacks, height limits, parking, and seismic design requirements (Zone V) for buildings in Manipur.',
                ],
                [
                    'title'          => 'Manipur Land Revenue and Land Reforms Act, 1960',
                    'type'           => 'State',
                    'authority'      => 'Manipur Revenue Department',
                    'effective_date' => '1960-01-01',
                    'description'    => 'Land revenue and reform legislation with special provisions for hill areas and tribal land protection. Governs land classification, mutation, land ceiling, and settlement operations.',
                ],
            ],

            // ── Meghalaya ───────────────────────────────────────────
            'ML' => [
                [
                    'title'          => 'Meghalaya Town and Country Planning Act, 1973',
                    'type'           => 'State',
                    'authority'      => 'Meghalaya Urban Affairs Department',
                    'effective_date' => '1973-01-01',
                    'description'    => 'Planning legislation covering development plans and building regulations for urban areas in Meghalaya. Special considerations for tribal autonomous district council areas and community-owned land (ri-bhoi).',
                ],
                [
                    'title'          => 'Shillong Building Bye-Laws (amended 2020)',
                    'type'           => 'State',
                    'authority'      => 'Shillong Municipal Board / Meghalaya Urban Affairs',
                    'effective_date' => '2020-01-01',
                    'description'    => 'Building regulations for Shillong covering FAR, height (max 5 storeys generally), setbacks, parking, seismic safety (Zone V), retaining walls for slopes, and heritage zone protection for colonial-era buildings.',
                ],
                [
                    'title'          => 'Meghalaya Transfer of Land (Regulation) Act, 1971',
                    'type'           => 'State',
                    'authority'      => 'Meghalaya Revenue Department',
                    'effective_date' => '1971-01-01',
                    'description'    => 'Restricts transfer of land owned by tribal persons to non-tribals. Governs community land ownership (Khasi Hills, Jaintia Hills, Garo Hills). Specific permissions required from Autonomous District Councils for land transactions.',
                ],
            ],

            // ── Mizoram ─────────────────────────────────────────────
            'MZ' => [
                [
                    'title'          => 'Mizoram Urban and Regional Development Act, 1990',
                    'type'           => 'State',
                    'authority'      => 'Mizoram Urban Development & Poverty Alleviation Department',
                    'effective_date' => '1990-01-01',
                    'description'    => 'Planning legislation for Mizoram covering the Aizawl Development Authority, preparation of development plans, and building permission for Aizawl and other urban settlements.',
                ],
                [
                    'title'          => 'Aizawl Development Authority Building Bye-Laws, 2018',
                    'type'           => 'State',
                    'authority'      => 'Aizawl Development Authority (ADA)',
                    'effective_date' => '2018-01-01',
                    'description'    => 'Building regulations for the Aizawl Master Plan area covering FAR, height limits, setbacks, ground coverage, retaining walls for steep terrain, parking, fire safety, and seismic zone V design requirements.',
                ],
                [
                    'title'          => 'Mizoram (Land Revenue) Act, 2013',
                    'type'           => 'State',
                    'authority'      => 'Mizoram Revenue Department',
                    'effective_date' => '2013-01-01',
                    'description'    => 'Modern land revenue legislation governing land settlement, periodic patta (LSC - Land Settlement Certificate), mutation, and land-use classification in Mizoram. Replaces jhumming / shifting cultivation land tenure systems.',
                ],
            ],

            // ── Nagaland ────────────────────────────────────────────
            'NL' => [
                [
                    'title'          => 'Nagaland Building Bye-Laws and Regulations, 2011',
                    'type'           => 'State',
                    'authority'      => 'Nagaland Town Planning Department',
                    'effective_date' => '2011-01-01',
                    'description'    => 'Building regulations covering FAR, height, setbacks, ground coverage, parking, and fire safety for urban areas of Nagaland. Adapted from NBC 2005 with provisions for hilly terrain and seismic zone V requirements.',
                ],
                [
                    'title'          => 'Nagaland Town and Country Planning Act, 1966',
                    'type'           => 'State',
                    'authority'      => 'Nagaland Town Planning Department',
                    'effective_date' => '1966-01-01',
                    'description'    => 'Planning legislation covering Kohima and Dimapur master plans, development permissions, and zoning regulations. Coordinates with tribal village councils for development in peri-urban areas.',
                ],
                [
                    'title'          => 'Nagaland — Customary Land Laws',
                    'type'           => 'State',
                    'authority'      => 'Nagaland Revenue Department / Village Councils',
                    'effective_date' => '1963-12-01',
                    'description'    => 'Land in rural Nagaland is governed by customary laws of each tribe. Land is largely community-owned with individual \'patta\' in urban areas only. Article 371(A) protects customary land rights. Critical constraint for land feasibility in most of Nagaland.',
                ],
            ],

            // ── Odisha ──────────────────────────────────────────────
            'OD' => [
                [
                    'title'          => 'Odisha Development Authorities Act, 1982',
                    'type'           => 'State',
                    'authority'      => 'Odisha Housing & Urban Development Department',
                    'effective_date' => '1982-01-01',
                    'description'    => 'Establishes Development Authorities (BDA, CDA, BDPA, etc.) for master plan preparation, development permission, and urban land management. Covers zoning regulations, FAR norms, and infrastructure development.',
                ],
                [
                    'title'          => 'Odisha Building Rules (Comprehensive Development Plan — Building Regulations), 2020',
                    'type'           => 'State',
                    'authority'      => 'Odisha Housing & Urban Development Department',
                    'effective_date' => '2020-01-01',
                    'description'    => 'Updated building regulations covering FAR (1.5–3.0), height based on road width, setbacks, ground coverage, parking norms, fire safety, green building mandates (for >5000 sqm), and online building approval (SUJOG platform).',
                ],
                [
                    'title'          => 'Odisha Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Odisha RERA',
                    'effective_date' => '2017-09-01',
                    'description'    => 'Odisha RERA rules covering project and agent registration, disclosure mandates, quarterly updates, complaint redressal, and penalty provisions for Odisha.',
                ],
                [
                    'title'          => 'Odisha Land Reforms Act, 1960',
                    'type'           => 'State',
                    'authority'      => 'Odisha Revenue Department',
                    'effective_date' => '1960-10-01',
                    'description'    => 'Land ceiling legislation and tribal land protection. Ceiling: 10-33 acres depending on land type. Scheduled area land restrictions under OSATIP. Conversion of agricultural land requires Tahasildar permission.',
                ],
            ],

            // ── Punjab ──────────────────────────────────────────────
            'PB' => [
                [
                    'title'          => 'Punjab Regional and Town Planning and Development Act, 1995',
                    'type'           => 'State',
                    'authority'      => 'Punjab Urban Planning & Development Authority',
                    'effective_date' => '1995-01-01',
                    'description'    => 'Planning legislation for Punjab covering regional plans, master plans, zoning, development permissions, and special regulations for the Punjab periphery of Chandigarh and SAS Nagar (Mohali).',
                ],
                [
                    'title'          => 'Punjab Building Rules, 2018',
                    'type'           => 'State',
                    'authority'      => 'Punjab Local Government Department',
                    'effective_date' => '2018-01-01',
                    'description'    => 'Building regulations covering FAR (1.5–3.0), height, setbacks, ground coverage, parking, fire safety, and green building norms for all municipal bodies in Punjab.',
                ],
                [
                    'title'          => 'Punjab Apartment and Property Regulation Act, 1995',
                    'type'           => 'State',
                    'authority'      => 'Punjab Housing & Urban Development Department',
                    'effective_date' => '1995-01-01',
                    'description'    => 'Regulates promotion and sale of apartments and plotted development colonies in Punjab. Requires registration of projects, defines builder obligations, and provides for buyer dispute resolution.',
                ],
                [
                    'title'          => 'Punjab Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Punjab RERA',
                    'effective_date' => '2017-12-01',
                    'description'    => 'Punjab RERA rules covering project registration, agent regulation, mandatory disclosures, complaint adjudication, and monetary penalty provisions for non-compliance.',
                ],
            ],

            // ── Rajasthan ───────────────────────────────────────────
            'RJ' => [
                [
                    'title'          => 'Rajasthan Urban Improvement Act, 1959',
                    'type'           => 'State',
                    'authority'      => 'Rajasthan Urban Development & Housing Department',
                    'effective_date' => '1959-01-01',
                    'description'    => 'Establishes Urban Improvement Trusts (UIT) for major cities. Covers development schemes, town planning schemes, building regulation, and land acquisition for urban improvement.',
                ],
                [
                    'title'          => 'Rajasthan Nagar Vikas Niyam (Building Regulations), 2020',
                    'type'           => 'State',
                    'authority'      => 'Rajasthan Urban Development & Housing Department',
                    'effective_date' => '2020-01-01',
                    'description'    => 'Comprehensive building regulations covering FAR (1.33–3.0 based on road width and zone), height (based on zone and road width), setbacks, ground coverage (50-70%), parking, fire safety, and heritage zone special provisions (Jaipur Walled City, Jodhpur Blue City).',
                ],
                [
                    'title'          => 'Rajasthan Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Rajasthan RERA (RAJ-RERA)',
                    'effective_date' => '2017-09-01',
                    'description'    => 'Rajasthan RERA rules covering project registration, disclosure requirements, buyer protection, agent registration, quarterly progress updates, and conciliation platform.',
                ],
                [
                    'title'          => 'Rajasthan Tenancy Act, 1955',
                    'type'           => 'State',
                    'authority'      => 'Rajasthan Revenue Department',
                    'effective_date' => '1955-01-01',
                    'description'    => 'Land tenure and tenancy legislation. Governs khatedar rights, land-use conversion (agricultural to residential/commercial), mutation, and land ceiling (18–136 bigha depending on class). Critical for land use change feasibility.',
                ],
            ],

            // ── Sikkim ──────────────────────────────────────────────
            'SK' => [
                [
                    'title'          => 'Sikkim Building Construction Rules, 2011',
                    'type'           => 'State',
                    'authority'      => 'Sikkim Urban Development & Housing Department',
                    'effective_date' => '2011-01-01',
                    'description'    => 'Building regulations for Sikkim covering FAR, height (generally 4 storeys max in Gangtok), setbacks, ground coverage, parking, seismic zone IV compliance, and special slope-based construction rules for hilly terrain.',
                ],
                [
                    'title'          => 'Sikkim Regulation of Transfer of Land Act, 2020',
                    'type'           => 'State',
                    'authority'      => 'Sikkim Revenue Department',
                    'effective_date' => '2020-01-01',
                    'description'    => 'Restricts sale and transfer of land belonging to Sikkimese Bhutia-Lepcha communities. Revenue Order No. 1 (1917) protects Bhutia-Lepcha land rights. Critical constraint for land feasibility in protected areas of Sikkim.',
                ],
                [
                    'title'          => 'Gangtok Municipal Corporation Building Bye-Laws, 2018',
                    'type'           => 'State',
                    'authority'      => 'Gangtok Municipal Corporation',
                    'effective_date' => '2018-01-01',
                    'description'    => 'Municipal building regulations for Gangtok covering development permissions, construction safety on slopes, heritage zone preservation, and eco-friendly construction norms for the capital city.',
                ],
            ],

            // ── Tamil Nadu ──────────────────────────────────────────
            'TN' => [
                [
                    'title'          => 'Tamil Nadu Town and Country Planning Act, 1971',
                    'type'           => 'State',
                    'authority'      => 'TN Directorate of Town and Country Planning (DTCP)',
                    'effective_date' => '1971-01-01',
                    'description'    => 'Primary planning legislation for Tamil Nadu. Empowers preparation of regional plans, master plans, detailed development plans, and new town development plans. Establishes DTCP as nodal planning authority for all urban and regional plans.',
                ],
                [
                    'title'          => 'Tamil Nadu Combined Development and Building Rules (TNCDBR), 2019',
                    'type'           => 'State',
                    'authority'      => 'TN Housing & Urban Development Department',
                    'effective_date' => '2019-02-02',
                    'description'    => 'Comprehensive building rules covering FSI (1.5–3.0), height based on road width, setbacks, ground coverage, parking (ECS norms), fire safety, rainwater harvesting (mandatory), solar energy (mandatory for >500 sqm), and special norms for multi-storey, group development, and IT parks.',
                ],
                [
                    'title'          => 'Tamil Nadu Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'TN RERA (TNRERA)',
                    'effective_date' => '2017-06-22',
                    'description'    => 'Tamil Nadu RERA rules with online TNRERA portal for project/agent registration, quarterly updates, complaint filing, and adjudication procedures.',
                ],
                [
                    'title'          => 'Tamil Nadu Land Reforms (Fixation of Ceiling on Land) Act, 1961',
                    'type'           => 'State',
                    'authority'      => 'TN Revenue Department',
                    'effective_date' => '1961-01-01',
                    'description'    => 'Land ceiling: 15 standard acres. Governs agricultural land ceiling, surplus land acquisition, and exemptions for industrial/educational purposes. Land conversion from agricultural to non-agricultural requires DTCP / Revenue permission.',
                ],
            ],

            // ── Telangana ───────────────────────────────────────────
            'TS' => [
                [
                    'title'          => 'Telangana Building Rules — TS-bPASS (Building Permission Approval and Self-Certification System), 2020',
                    'type'           => 'State',
                    'authority'      => 'Telangana Municipal Administration & Urban Development Dept.',
                    'effective_date' => '2020-11-16',
                    'description'    => 'Revolutionary online building permission system with instant approval for plots ≤600 sqm (residential) through self-certification. For larger buildings: FAR (1.5–3.0), height based on road width, setbacks, parking, fire safety. One of India\'s most reformed building permission systems.',
                ],
                [
                    'title'          => 'Hyderabad Metropolitan Development Authority (HMDA) Zoning Regulations, 2021',
                    'type'           => 'State',
                    'authority'      => 'HMDA',
                    'effective_date' => '2021-01-01',
                    'description'    => 'Zoning regulations for Hyderabad Metropolitan Region covering residential, commercial, industrial, conservation, and recreational zones with development controls. Special zones for HITECH City IT corridor, Genome Valley, and Pharma City.',
                ],
                [
                    'title'          => 'Telangana Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Telangana RERA (TS-RERA)',
                    'effective_date' => '2017-07-31',
                    'description'    => 'Telangana RERA rules covering online project registration, agent registration, quarterly disclosures, complaint redressal, and appellate tribunal. Integrated with TS-bPASS for permission verification.',
                ],
                [
                    'title'          => 'Telangana Rights in Land and Pattadar Pass Books Act, 1971 (adopted from AP)',
                    'type'           => 'State',
                    'authority'      => 'Telangana Revenue Department',
                    'effective_date' => '2014-06-02',
                    'description'    => 'Land records legislation adopted after state bifurcation from AP. Governs land ownership records (Dharani portal), mutation, agricultural to non-agricultural land conversion, and revenue administration through digital land records.',
                ],
            ],

            // ── Tripura ─────────────────────────────────────────────
            'TR' => [
                [
                    'title'          => 'Tripura Town and Country Planning Act, 1975',
                    'type'           => 'State',
                    'authority'      => 'Tripura Town & Country Planning Department',
                    'effective_date' => '1975-01-01',
                    'description'    => 'Planning legislation for Tripura covering development plans and building permission for Agartala and other urban areas.',
                ],
                [
                    'title'          => 'Tripura Building Construction Rules, 2004 (amended 2018)',
                    'type'           => 'State',
                    'authority'      => 'Tripura Urban Development Department',
                    'effective_date' => '2018-01-01',
                    'description'    => 'Building regulations covering FAR, height, setbacks, ground coverage, parking, and seismic zone V design requirements for buildings in Tripura.',
                ],
                [
                    'title'          => 'Tripura Land Revenue and Land Reforms Act, 1960',
                    'type'           => 'State',
                    'authority'      => 'Tripura Revenue Department',
                    'effective_date' => '1960-01-01',
                    'description'    => 'Land revenue legislation covering land settlement, mutation, land-use conversion, and tribal land protection in Scheduled Tribe areas of Tripura (Tripura Tribal Areas Autonomous District Council jurisdiction).',
                ],
            ],

            // ── Uttar Pradesh ───────────────────────────────────────
            'UP' => [
                [
                    'title'          => 'Uttar Pradesh Urban Planning and Development Act, 1973',
                    'type'           => 'State',
                    'authority'      => 'UP Housing & Urban Planning Department',
                    'effective_date' => '1973-01-01',
                    'description'    => 'Primary planning legislation for UP. Establishes Development Authorities (LDA, GDA, NOIDA, Greater NOIDA, Yamuna Expressway Industrial Development Authority). Covers master plans, zoning, and building permission regulations.',
                ],
                [
                    'title'          => 'UP Building Services Rules (Combined Building Bye-Laws), 2021',
                    'type'           => 'State',
                    'authority'      => 'UP Housing & Urban Planning Department',
                    'effective_date' => '2021-01-01',
                    'description'    => 'Comprehensive building rules covering FAR (up to 3.5 in metro cities), height based on road width, setbacks, ground coverage, parking norms, fire safety, green building mandates, and online approval through NIVESH MITRA portal.',
                ],
                [
                    'title'          => 'UP Real Estate (Regulation and Development) Rules, 2016',
                    'type'           => 'RERA',
                    'authority'      => 'UP RERA',
                    'effective_date' => '2016-10-28',
                    'description'    => 'UP RERA rules — one of the first states to implement RERA. Covers project registration, allottee-promoter agreement, completion timelines, escrow monitoring, complaints, and penalty provisions. Active in NOIDA, Greater NOIDA, Lucknow.',
                ],
                [
                    'title'          => 'UP Revenue Code, 2006',
                    'type'           => 'State',
                    'authority'      => 'UP Revenue Department',
                    'effective_date' => '2006-01-01',
                    'description'    => 'Consolidation of land revenue laws in UP. Governs khatauni (land records), mutation, land-use conversion, land ceiling, and revenue courts. Online land records through Bhulekh portal.',
                ],
            ],

            // ── Uttarakhand ─────────────────────────────────────────
            'UK' => [
                [
                    'title'          => 'Uttarakhand Urban and Country Planning and Development Act, 1973 (as adapted from UP)',
                    'type'           => 'State',
                    'authority'      => 'Uttarakhand Urban Development Department',
                    'effective_date' => '2000-11-09',
                    'description'    => 'Planning legislation adapted from UP Act after state creation. Covers MDDA (Dehradun), HDDA (Haridwar), and other development authorities. Master plan preparation, zoning, and building permission regulation.',
                ],
                [
                    'title'          => 'Uttarakhand Building Bye-Laws, 2018',
                    'type'           => 'State',
                    'authority'      => 'Uttarakhand Urban Development Department',
                    'effective_date' => '2018-01-01',
                    'description'    => 'Hill-area adapted building regulations covering FAR (1.0–2.5), height based on road width and terrain, setbacks, slope-specific construction norms, parking on slope, and seismic Zone IV-V design mandates.',
                ],
                [
                    'title'          => 'Uttarakhand Real Estate (Regulation and Development) Rules, 2017',
                    'type'           => 'RERA',
                    'authority'      => 'Uttarakhand RERA',
                    'effective_date' => '2017-10-01',
                    'description'    => 'Uttarakhand RERA rules covering project registration, transparency disclosures, agent registration, buyer protection, and complaint redressal for real estate projects.',
                ],
                [
                    'title'          => 'Uttarakhand Land (Ceiling and Regulation) Act, 1972 — Section 154 Restriction',
                    'type'           => 'State',
                    'authority'      => 'Uttarakhand Revenue Department',
                    'effective_date' => '1972-01-01',
                    'description'    => 'Land transaction restriction on outsiders in Uttarakhand hills. Section 154 of UP Zamindari Abolition Act (as applicable) requires permission for non-local buyers acquiring agricultural land. Similar to HP Section 118.',
                ],
            ],

            // ── West Bengal ─────────────────────────────────────────
            'WB' => [
                [
                    'title'          => 'West Bengal Town and Country (Planning and Development) Act, 1979',
                    'type'           => 'State',
                    'authority'      => 'WB Town and Country Planning Department',
                    'effective_date' => '1979-01-01',
                    'description'    => 'Primary planning legislation for West Bengal. Empowers preparation of development plans, land use plans, and building regulation for all planning areas. Establishes planning authorities including KMA, NKDA, SJDA, and HIDCO.',
                ],
                [
                    'title'          => 'West Bengal Building (Planning, Development, and Standardization of Building and Allied) Rules, 2020',
                    'type'           => 'State',
                    'authority'      => 'WB Urban Development & Municipal Affairs Department',
                    'effective_date' => '2020-01-01',
                    'description'    => 'Comprehensive building rules covering FAR (2.0–4.0 in KMA), height based on road width, setbacks, ground coverage (40-60%), parking, fire safety, green building mandates, rainwater harvesting, and online approval (e-Nagar Sewa).',
                ],
                [
                    'title'          => 'West Bengal Real Estate (Regulation and Development) Rules, 2021',
                    'type'           => 'RERA',
                    'authority'      => 'WB HIRA (Housing Industry Regulatory Authority)',
                    'effective_date' => '2021-06-01',
                    'description'    => 'West Bengal\'s real estate regulatory rules under WB HIRA (the state has its own housing regulation act rather than directly implementing central RERA). Project registration, promoter obligations, allottee protection, and complaint resolution.',
                ],
                [
                    'title'          => 'West Bengal Land Reforms Act, 1955',
                    'type'           => 'State',
                    'authority'      => 'WB Land & Land Reforms Department',
                    'effective_date' => '1955-01-01',
                    'description'    => 'Land reform legislation covering land ceiling (raiyati land: 7 hectares), bargadar (sharecropper) protection, agricultural land classification, conversion (Section 4A/4C), and homestead tenancy. Online mutation through Bhumi portal.',
                ],
            ],
        ];
    }

    // ================================================================
    //  MUNICIPAL REGULATION DATA
    // ================================================================

    private function municipalRegulationData(): array
    {
        return [
            // ── Maharashtra — Mumbai ────────────────────────────────
            'MH' => [
                [
                    'title'          => 'Development Control and Promotion Regulations (DCPR) for Greater Mumbai, 2034',
                    'type'           => 'Municipal',
                    'authority'      => 'Municipal Corporation of Greater Mumbai (MCGM)',
                    'effective_date' => '2018-09-11',
                    'description'    => 'Mumbai-specific DCR covering FSI (1.0 base + premium up to 3.0 in island city), height based on road width (no limit for >30m road), TDR (heritage, slum, road, reservation), fungible FSI, parking (basement mandated for >4 floors), fire safety, coastal regulation, and TOD norms near metro/rail stations.',
                ],
                [
                    'title'          => 'Navi Mumbai Development Control Regulations, 2019',
                    'type'           => 'Municipal',
                    'authority'      => 'CIDCO (City and Industrial Development Corporation)',
                    'effective_date' => '2019-01-01',
                    'description'    => 'Development control regulations for CIDCO nodes of Navi Mumbai covering FSI, height, setback, parking, and land use regulations for residential, commercial, and industrial nodes (Vashi, Nerul, Belapur, Kharghar, Panvel).',
                ],
                [
                    'title'          => 'Pune Municipal Corporation Development Control Rules, 2017',
                    'type'           => 'Municipal',
                    'authority'      => 'Pune Municipal Corporation (PMC)',
                    'effective_date' => '2017-01-01',
                    'description'    => 'Pune city development control rules covering FSI (1.0–2.5), height, setback norms, parking, TDR provisions, affordable housing incentive FSI, and heritage conservation areas (Shaniwar Wada precinct).',
                    'is_active'      => false,
                ],
            ],

            // ── Delhi ───────────────────────────────────────────────
            'DL' => [
                [
                    'title'          => 'Delhi Master Plan 2041 — Zonal Development Plans',
                    'type'           => 'Municipal',
                    'authority'      => 'Delhi Development Authority (DDA)',
                    'effective_date' => '2022-01-01',
                    'description'    => 'Zone-level plans under MPD-2041 covering detailed land use, density, FAR, height, green area, community facilities, and infrastructure provisions for each of Delhi\'s 15 planning zones.',
                ],
                [
                    'title'          => 'New Delhi Municipal Council (NDMC) Building Regulations, 2019',
                    'type'           => 'Municipal',
                    'authority'      => 'New Delhi Municipal Council (NDMC)',
                    'effective_date' => '2019-01-01',
                    'description'    => 'Building regulations specific to Lutyens\' Delhi / NDMC area—the most heritage-sensitive zone of Delhi. Strict height limits (max 15m–21m in most areas), Bungalow Zone restrictions, and heritage conservation norms for colonial-era buildings.',
                ],
            ],

            // ── Karnataka — Bangalore ───────────────────────────────
            'KA' => [
                [
                    'title'          => 'BBMP (Bruhat Bengaluru Mahanagara Palike) Building Bye-Laws, 2020',
                    'type'           => 'Municipal',
                    'authority'      => 'BBMP',
                    'effective_date' => '2020-01-01',
                    'description'    => 'Building regulations for Bangalore city covering FAR (1.75–3.25), height, setbacks, ground coverage, parking norms, Sakala-based online approvals, fire safety for high-rises, and special provisions for IT/BT zone (Whitefield, Electronic City, Outer Ring Road).',
                ],
                [
                    'title'          => 'BDA (Bangalore Development Authority) Master Plan 2031 — Land Use Regulation',
                    'type'           => 'Municipal',
                    'authority'      => 'BDA',
                    'effective_date' => '2015-06-01',
                    'description'    => 'Land use plan for Bangalore Metropolitan Area (1307 sq.km), covering 152 villages. Zones: residential (R), commercial (C), industrial (I), public & semi-public (P&SP), parks (P), transportation (T), and unclassified.',
                ],
            ],

            // ── Tamil Nadu — Chennai ────────────────────────────────
            'TN' => [
                [
                    'title'          => 'Chennai Second Master Plan (SMP) — Development Regulations, 2026',
                    'type'           => 'Municipal',
                    'authority'      => 'Chennai Metropolitan Development Authority (CMDA)',
                    'effective_date' => '2008-09-02',
                    'description'    => 'Master plan for Chennai Metropolitan Area (1189 sq.km) covering land use zoning, FSI (1.5 base, premium FSI up to 3.5), height, setbacks, road-width norms, CRZ provisions for East Coast, and special development zones (IT Corridor, SEZ, Harbour Area).',
                ],
                [
                    'title'          => 'Greater Chennai Corporation (GCC) Building Rules',
                    'type'           => 'Municipal',
                    'authority'      => 'Greater Chennai Corporation',
                    'effective_date' => '2019-02-02',
                    'description'    => 'City-level building permission rules for Greater Chennai covering plot approval, building plan sanction, FSI computation, height approval from Airport Authority for airport funnel zones, and special heritage area provisions (George Town, Mylapore).',
                ],
            ],

            // ── Telangana — Hyderabad ───────────────────────────────
            'TS' => [
                [
                    'title'          => 'GHMC (Greater Hyderabad Municipal Corporation) Building Permission Rules, 2020',
                    'type'           => 'Municipal',
                    'authority'      => 'GHMC',
                    'effective_date' => '2020-11-16',
                    'description'    => 'TS-bPASS integrated building permission rules for GHMC area. Instant approval for residential ≤600 sqm, 21-day timeline for others. FAR, height, setbacks, parking, fire safety, and heritage zone provisions for Charminar/Old City precinct.',
                ],
            ],

            // ── Gujarat — Ahmedabad ─────────────────────────────────
            'GJ' => [
                [
                    'title'          => 'Ahmedabad Urban Development Authority (AUDA) Development Control Regulations, 2021',
                    'type'           => 'Municipal',
                    'authority'      => 'AUDA',
                    'effective_date' => '2021-01-01',
                    'description'    => 'Development control regulations for AUDA area covering GDCR adoption, TP scheme-based development, heritage conservation (UNESCO Walled City of Ahmedabad), riverfront development zone norms, and GIFT City special economic zone regulations.',
                ],
                [
                    'title'          => 'Surat Municipal Corporation (SMC) Development Control Regulations, 2017',
                    'type'           => 'Municipal',
                    'authority'      => 'Surat Municipal Corporation',
                    'effective_date' => '2017-09-01',
                    'description'    => 'GDCR-based development control regulations for Surat covering FSI (up to 4.0 with premium in textile/diamond market areas), height, setback, parking, flood-zone restrictions (Tapi River), and diamond bourse area special norms.',
                ],
            ],

            // ── West Bengal — Kolkata ────────────────────────────────
            'WB' => [
                [
                    'title'          => 'Kolkata Municipal Corporation Building Rules, 2009 (amended 2020)',
                    'type'           => 'Municipal',
                    'authority'      => 'Kolkata Municipal Corporation (KMC)',
                    'effective_date' => '2020-01-01',
                    'description'    => 'Building regulations for KMC area covering FAR (3.0–4.0), height based on road width, setbacks, parking, fire safety, heritage conservation (BBD Bagh, Park Street precinct), and special provisions for waterlogged and low-lying areas.',
                ],
                [
                    'title'          => 'HIDCO New Town Kolkata Development Regulations',
                    'type'           => 'Municipal',
                    'authority'      => 'West Bengal Housing Infrastructure Development Corporation (HIDCO)',
                    'effective_date' => '2015-01-01',
                    'description'    => 'Land use and development regulations for New Town (Rajarhat) planned township covering Action Areas I, II, III, IT hub zone, eco-park zone, commercial strip, and residential sector norms.',
                ],
            ],

            // ── Uttar Pradesh — NOIDA / Lucknow ─────────────────────
            'UP' => [
                [
                    'title'          => 'NOIDA (New Okhla Industrial Development Authority) Building Regulations, 2019',
                    'type'           => 'Municipal',
                    'authority'      => 'NOIDA Authority',
                    'effective_date' => '2019-01-01',
                    'description'    => 'Building regulations for NOIDA sectors covering FAR (2.75–3.5), height, setbacks, group housing norms, IT/ITES zone special provisions, commercial centre norms, and green building mandates for projects >10,000 sqm.',
                ],
                [
                    'title'          => 'Greater NOIDA Master Plan 2021 — Building Regulations',
                    'type'           => 'Municipal',
                    'authority'      => 'Greater NOIDA Industrial Development Authority',
                    'effective_date' => '2021-01-01',
                    'description'    => 'Development control regulations for Greater NOIDA covering institutional, commercial, residential, and industrial zone norms. Special sectors: Knowledge Park, Integrated Industrial Township, and YEIDA Integration zones.',
                ],
                [
                    'title'          => 'Lucknow Development Authority (LDA) Building Bye-Laws',
                    'type'           => 'Municipal',
                    'authority'      => 'Lucknow Development Authority (LDA)',
                    'effective_date' => '2017-01-01',
                    'description'    => 'Building regulations for Lucknow metropolitan area covering FAR, height, setbacks, parking, heritage zone provisions (Husainabad heritage zone, La Martiniere precinct), and special norms for Gomti Riverfront development area.',
                ],
            ],

            // ── Rajasthan — Jaipur ──────────────────────────────────
            'RJ' => [
                [
                    'title'          => 'Jaipur Development Authority (JDA) Building Bye-Laws, 2020',
                    'type'           => 'Municipal',
                    'authority'      => 'Jaipur Development Authority',
                    'effective_date' => '2020-01-01',
                    'description'    => 'Building regulations for Jaipur covering FAR (1.33–2.25), height, setbacks, parking, and special UNESCO World Heritage Site provisions for the Walled City of Jaipur (max 9m height, traditional facade requirements, pink colour mandatory).',
                ],
            ],

            // ── Haryana — Gurugram ──────────────────────────────────
            'HR' => [
                [
                    'title'          => 'Gurugram Metropolitan Development Authority (GMDA) Master Plan 2031',
                    'type'           => 'Municipal',
                    'authority'      => 'GMDA / Haryana TCP',
                    'effective_date' => '2012-02-01',
                    'description'    => 'Master plan for Gurugram covering sector-based land use, FAR norms (up to 3.5 for group housing), commercial zone provisions (Cyber City, Udyog Vihar), highway commercial norms (NH-48, SPR, Dwarka Expressway), and affordable housing zones.',
                ],
            ],

            // ── Andhra Pradesh — Visakhapatnam ──────────────────────
            'AP' => [
                [
                    'title'          => 'VMRDA (Visakhapatnam Metropolitan Region Development Authority) Master Plan 2021 — Building Regulations',
                    'type'           => 'Municipal',
                    'authority'      => 'VMRDA',
                    'effective_date' => '2021-01-01',
                    'description'    => 'Development regulations for Visakhapatnam Metropolitan Region covering land use zoning, FAR norms, height restrictions (airport funnel zone), CRZ provisions for coastal areas, and special provisions for Vizag Port Industrial area and IT SEZ zone.',
                ],
            ],

            // ── Odisha — Bhubaneswar ────────────────────────────────
            'OD' => [
                [
                    'title'          => 'Bhubaneswar Development Authority (BDA) Comprehensive Development Plan Building Rules, 2020',
                    'type'           => 'Municipal',
                    'authority'      => 'BDA',
                    'effective_date' => '2020-01-01',
                    'description'    => 'Development rules for Bhubaneswar covering FAR, height, setbacks, parking, temple heritage zone provisions (Lingaraj, Mukteswar precinct — ASI + State protected monuments), and smart city area special regulations.',
                ],
            ],

            // ── Kerala — Kochi ──────────────────────────────────────
            'KL' => [
                [
                    'title'          => 'GCDA (Greater Cochin Development Authority) Master Plan 2031 — Building Regulations',
                    'type'           => 'Municipal',
                    'authority'      => 'GCDA',
                    'effective_date' => '2017-01-01',
                    'description'    => 'Development control regulations for the Greater Cochin area covering FAR, height, setbacks, special heritage provisions for Fort Kochi / Mattancherry, CRZ compliance for backwater and coastal areas, and Kochi Metro TOD zone norms.',
                ],
            ],

            // ── Punjab — Chandigarh periphery ───────────────────────
            'PB' => [
                [
                    'title'          => 'Greater Mohali Area Development Authority (GMADA) Masterplan Building Regulations',
                    'type'           => 'Municipal',
                    'authority'      => 'GMADA',
                    'effective_date' => '2018-01-01',
                    'description'    => 'Development regulations for New Chandigarh, Mohali, and surrounding areas covering sector plan norms, FAR, height restrictions (airport funnel proximity to Chandigarh Airport), group housing, IT City zone, and commercial belt norms.',
                ],
            ],
        ];
    }
}
