"""MTA Subway Station Enums and Constants

This file contains enums and mappings for subway station information.
Generated from MTA_Subway_Stations_20250702.csv
"""

from typing import Dict, List, NamedTuple, Optional


class StationInfo(NamedTuple):
    """Station information structure"""

    name: str
    lines: List[str]


# Comprehensive mapping of GTFS Stop IDs to station information
SUBWAY_STATIONS: Dict[str, StationInfo] = {
    "101": StationInfo("Van Cortlandt Park-242 St", ["1"]),
    "103": StationInfo("238 St", ["1"]),
    "104": StationInfo("231 St", ["1"]),
    "106": StationInfo("Marble Hill-225 St", ["1"]),
    "107": StationInfo("215 St", ["1"]),
    "108": StationInfo("207 St", ["1"]),
    "109": StationInfo("Dyckman St", ["1"]),
    "110": StationInfo("191 St", ["1"]),
    "111": StationInfo("181 St", ["1"]),
    "112": StationInfo("168 St-Washington Hts", ["1"]),
    "113": StationInfo("157 St", ["1"]),
    "114": StationInfo("145 St", ["1"]),
    "115": StationInfo("137 St-City College", ["1"]),
    "116": StationInfo("125 St", ["1"]),
    "117": StationInfo("116 St-Columbia University", ["1"]),
    "118": StationInfo("Cathedral Pkwy (110 St)", ["1"]),
    "119": StationInfo("103 St", ["1"]),
    "120": StationInfo("96 St", ["1", "2", "3"]),
    "121": StationInfo("86 St", ["1"]),
    "122": StationInfo("79 St", ["1"]),
    "123": StationInfo("72 St", ["1", "2", "3"]),
    "124": StationInfo("66 St-Lincoln Center", ["1"]),
    "125": StationInfo("59 St-Columbus Circle", ["1"]),
    "126": StationInfo("50 St", ["1"]),
    "127": StationInfo("Times Sq-42 St", ["1", "2", "3"]),
    "128": StationInfo("34 St-Penn Station", ["1", "2", "3"]),
    "129": StationInfo("28 St", ["1"]),
    "130": StationInfo("23 St", ["1"]),
    "131": StationInfo("18 St", ["1"]),
    "132": StationInfo("14 St", ["1", "2", "3"]),
    "133": StationInfo("Christopher St-Stonewall", ["1"]),
    "134": StationInfo("Houston St", ["1"]),
    "135": StationInfo("Canal St", ["1"]),
    "136": StationInfo("Franklin St", ["1"]),
    "137": StationInfo("Chambers St", ["1", "2", "3"]),
    "138": StationInfo("WTC Cortlandt", ["1"]),
    "139": StationInfo("Rector St", ["1"]),
    "142": StationInfo("South Ferry", ["1"]),
    # Line 2 and 5 stations
    "201": StationInfo("Wakefield-241 St", ["2"]),
    "204": StationInfo("Nereid Av", ["2", "5"]),
    "205": StationInfo("233 St", ["2", "5"]),
    "206": StationInfo("225 St", ["2", "5"]),
    "207": StationInfo("219 St", ["2", "5"]),
    "208": StationInfo("Gun Hill Rd", ["2", "5"]),
    "209": StationInfo("Burke Av", ["2", "5"]),
    "210": StationInfo("Allerton Av", ["2", "5"]),
    "211": StationInfo("Pelham Pkwy", ["2", "5"]),
    "212": StationInfo("Bronx Park East", ["2", "5"]),
    "213": StationInfo("E 180 St", ["2", "5"]),
    "214": StationInfo("West Farms Sq-E Tremont Av", ["2", "5"]),
    "215": StationInfo("174 St", ["2", "5"]),
    "216": StationInfo("Freeman St", ["2", "5"]),
    "217": StationInfo("Simpson St", ["2", "5"]),
    "218": StationInfo("Intervale Av", ["2", "5"]),
    "219": StationInfo("Prospect Av", ["2", "5"]),
    "220": StationInfo("Jackson Av", ["2", "5"]),
    "221": StationInfo("3 Av-149 St", ["2", "5"]),
    "222": StationInfo("149 St-Grand Concourse", ["2", "5"]),
    "224": StationInfo("135 St", ["2", "3"]),
    "225": StationInfo("125 St", ["2", "3"]),
    "226": StationInfo("116 St", ["2", "3"]),
    "227": StationInfo("Central Park North (110 St)", ["2", "3"]),
    "228": StationInfo("Park Place", ["2", "3"]),
    "229": StationInfo("Fulton St", ["2", "3"]),
    "230": StationInfo("Wall St", ["2", "3"]),
    "231": StationInfo("Clark St", ["2", "3"]),
    "232": StationInfo("Borough Hall", ["2", "3"]),
    "233": StationInfo("Hoyt St", ["2", "3"]),
    "234": StationInfo("Nevins St", ["2", "3", "4", "5"]),
    "235": StationInfo("Atlantic Av-Barclays Ctr", ["2", "3", "4", "5"]),
    "236": StationInfo("Bergen St", ["2", "3"]),
    "237": StationInfo("Grand Army Plaza", ["2", "3"]),
    "238": StationInfo("Eastern Pkwy-Brooklyn Museum", ["2", "3"]),
    "239": StationInfo("Franklin Av-Medgar Evers College", ["2", "3", "4", "5"]),
    "241": StationInfo("President St-Medgar Evers College", ["2", "5"]),
    "242": StationInfo("Sterling St", ["2", "5"]),
    "243": StationInfo("Winthrop St", ["2", "5"]),
    "244": StationInfo("Church Av", ["2", "5"]),
    "245": StationInfo("Beverly Rd", ["2", "5"]),
    "246": StationInfo("Newkirk Av-Little Haiti", ["2", "5"]),
    "247": StationInfo("Flatbush Av-Brooklyn College", ["2", "5"]),
    "248": StationInfo("Nostrand Av", ["3"]),
    "249": StationInfo("Kingston Av", ["3"]),
    "250": StationInfo("Crown Hts-Utica Av", ["3", "4"]),
    "251": StationInfo("Sutter Av-Rutland Rd", ["3"]),
    "252": StationInfo("Saratoga Av", ["3"]),
    "253": StationInfo("Rockaway Av", ["3"]),
    "254": StationInfo("Junius St", ["3"]),
    "255": StationInfo("Pennsylvania Av", ["3"]),
    "256": StationInfo("Van Siclen Av", ["3"]),
    "257": StationInfo("New Lots Av", ["3"]),
    "301": StationInfo("Harlem-148 St", ["3"]),
    "302": StationInfo("145 St", ["3"]),
    # Line 4 and 5 stations
    "401": StationInfo("Woodlawn", ["4"]),
    "402": StationInfo("Mosholu Pkwy", ["4"]),
    "405": StationInfo("Bedford Park Blvd-Lehman College", ["4"]),
    "406": StationInfo("Kingsbridge Rd", ["4"]),
    "407": StationInfo("Fordham Rd", ["4"]),
    "408": StationInfo("183 St", ["4"]),
    "409": StationInfo("Burnside Av", ["4"]),
    "410": StationInfo("176 St", ["4"]),
    "411": StationInfo("Mt Eden Av", ["4"]),
    "412": StationInfo("170 St", ["4"]),
    "413": StationInfo("167 St", ["4"]),
    "414": StationInfo("161 St-Yankee Stadium", ["4"]),
    "415": StationInfo("149 St-Grand Concourse", ["4"]),
    "416": StationInfo("138 St-Grand Concourse", ["4", "5"]),
    "418": StationInfo("Fulton St", ["4", "5"]),
    "419": StationInfo("Wall St", ["4", "5"]),
    "420": StationInfo("Bowling Green", ["4", "5"]),
    "423": StationInfo("Borough Hall", ["4", "5"]),
    "501": StationInfo("Eastchester-Dyre Av", ["5"]),
    "502": StationInfo("Baychester Av", ["5"]),
    "503": StationInfo("Gun Hill Rd", ["5"]),
    "504": StationInfo("Pelham Pkwy", ["5"]),
    "505": StationInfo("Morris Park", ["5"]),
    # Line 6 stations
    "601": StationInfo("Pelham Bay Park", ["6"]),
    "602": StationInfo("Buhre Av", ["6"]),
    "603": StationInfo("Middletown Rd", ["6"]),
    "604": StationInfo("Westchester Sq-E Tremont Av", ["6"]),
    "606": StationInfo("Zerega Av", ["6"]),
    "607": StationInfo("Castle Hill Av", ["6"]),
    "608": StationInfo("Parkchester", ["6"]),
    "609": StationInfo("St Lawrence Av", ["6"]),
    "610": StationInfo("Morrison Av-Soundview", ["6"]),
    "611": StationInfo("Elder Av", ["6"]),
    "612": StationInfo("Whitlock Av", ["6"]),
    "613": StationInfo("Hunts Point Av", ["6"]),
    "614": StationInfo("Longwood Av", ["6"]),
    "615": StationInfo("E 149 St", ["6"]),
    "616": StationInfo("E 143 St-St Mary's St", ["6"]),
    "617": StationInfo("Cypress Av", ["6"]),
    "618": StationInfo("Brook Av", ["6"]),
    "619": StationInfo("3 Av-138 St", ["6"]),
    "621": StationInfo("125 St", ["4", "5", "6"]),
    "622": StationInfo("116 St", ["6"]),
    "623": StationInfo("110 St", ["6"]),
    "624": StationInfo("103 St", ["6"]),
    "625": StationInfo("96 St", ["6"]),
    "626": StationInfo("86 St", ["4", "5", "6"]),
    "627": StationInfo("77 St", ["6"]),
    "628": StationInfo("68 St-Hunter College", ["6"]),
    "629": StationInfo("59 St", ["4", "5", "6"]),
    "630": StationInfo("51 St", ["6"]),
    "631": StationInfo("Grand Central-42 St", ["4", "5", "6"]),
    "632": StationInfo("33 St", ["6"]),
    "633": StationInfo("28 St", ["6"]),
    "634": StationInfo("23 St", ["6"]),
    "635": StationInfo("14 St-Union Sq", ["4", "5", "6"]),
    "636": StationInfo("Astor Pl", ["6"]),
    "637": StationInfo("Bleecker St", ["6"]),
    "638": StationInfo("Spring St", ["6"]),
    "639": StationInfo("Canal St", ["6"]),
    "640": StationInfo("Brooklyn Bridge-City Hall", ["4", "5", "6"]),
    # Line 7 stations
    "701": StationInfo("Flushing-Main St", ["7"]),
    "702": StationInfo("Mets-Willets Point", ["7"]),
    "705": StationInfo("111 St", ["7"]),
    "706": StationInfo("103 St-Corona Plaza", ["7"]),
    "707": StationInfo("Junction Blvd", ["7"]),
    "708": StationInfo("90 St-Elmhurst Av", ["7"]),
    "709": StationInfo("82 St-Jackson Hts", ["7"]),
    "710": StationInfo("74 St-Broadway", ["7"]),
    "711": StationInfo("69 St", ["7"]),
    "712": StationInfo("61 St-Woodside", ["7"]),
    "713": StationInfo("52 St", ["7"]),
    "714": StationInfo("46 St-Bliss St", ["7"]),
    "715": StationInfo("40 St-Lowery St", ["7"]),
    "716": StationInfo("33 St-Rawson St", ["7"]),
    "718": StationInfo("Queensboro Plaza", ["7"]),
    "719": StationInfo("Court Sq", ["7"]),
    "720": StationInfo("Hunters Point Av", ["7"]),
    "721": StationInfo("Vernon Blvd-Jackson Av", ["7"]),
    "723": StationInfo("Grand Central-42 St", ["7"]),
    "724": StationInfo("5 Av", ["7"]),
    "725": StationInfo("Times Sq-42 St", ["7"]),
    "726": StationInfo("34 St-Hudson Yards", ["7"]),
    # Shuttle lines
    "901": StationInfo("Grand Central-42 St", ["S"]),
    "902": StationInfo("Times Sq-42 St", ["S"]),
    # A line stations
    "A02": StationInfo("Inwood-207 St", ["A"]),
    "A03": StationInfo("Dyckman St", ["A"]),
    "A05": StationInfo("190 St", ["A"]),
    "A06": StationInfo("181 St", ["A"]),
    "A07": StationInfo("175 St", ["A"]),
    "A09": StationInfo("168 St", ["A", "C"]),
    "A10": StationInfo("163 St-Amsterdam Av", ["C"]),
    "A11": StationInfo("155 St", ["C"]),
    "A12": StationInfo("145 St", ["A", "C"]),
    "A14": StationInfo("135 St", ["B", "C"]),
    "A15": StationInfo("125 St", ["A", "B", "C", "D"]),
    "A16": StationInfo("116 St", ["B", "C"]),
    "A17": StationInfo("Cathedral Pkwy (110 St)", ["B", "C"]),
    "A18": StationInfo("103 St", ["B", "C"]),
    "A19": StationInfo("96 St", ["B", "C"]),
    "A20": StationInfo("86 St", ["B", "C"]),
    "A21": StationInfo("81 St-Museum of Natural History", ["B", "C"]),
    "A22": StationInfo("72 St", ["B", "C"]),
    "A24": StationInfo("59 St-Columbus Circle", ["A", "B", "C", "D"]),
    "A25": StationInfo("50 St", ["C", "E"]),
    "A27": StationInfo("42 St-Port Authority Bus Terminal", ["A", "C", "E"]),
    "A28": StationInfo("34 St-Penn Station", ["A", "C", "E"]),
    "A30": StationInfo("23 St", ["C", "E"]),
    "A31": StationInfo("14 St", ["A", "C", "E"]),
    "A32": StationInfo("W 4 St-Wash Sq", ["A", "C", "E"]),
    "A33": StationInfo("Spring St", ["C", "E"]),
    "A34": StationInfo("Canal St", ["A", "C", "E"]),
    "A36": StationInfo("Chambers St", ["A", "C"]),
    "A38": StationInfo("Fulton St", ["A", "C"]),
    "A40": StationInfo("High St", ["A", "C"]),
    "A41": StationInfo("Jay St-MetroTech", ["A", "C", "F"]),
    "A42": StationInfo("Hoyt-Schermerhorn Sts", ["A", "C", "G"]),
    "A43": StationInfo("Lafayette Av", ["C"]),
    "A44": StationInfo("Clinton-Washington Avs", ["C"]),
    "A45": StationInfo("Franklin Av", ["C"]),
    "A46": StationInfo("Nostrand Av", ["A", "C"]),
    "A47": StationInfo("Kingston-Throop Avs", ["C"]),
    "A48": StationInfo("Utica Av", ["A", "C"]),
    "A49": StationInfo("Ralph Av", ["C"]),
    "A50": StationInfo("Rockaway Av", ["C"]),
    "A51": StationInfo("Broadway Junction", ["A", "C"]),
    "A52": StationInfo("Liberty Av", ["C"]),
    "A53": StationInfo("Van Siclen Av", ["C"]),
    "A54": StationInfo("Shepherd Av", ["C"]),
    "A55": StationInfo("Euclid Av", ["A", "C"]),
    "A57": StationInfo("Grant Av", ["A"]),
    "A59": StationInfo("80 St", ["A"]),
    "A60": StationInfo("88 St", ["A"]),
    "A61": StationInfo("Rockaway Blvd", ["A"]),
    "A63": StationInfo("104 St", ["A"]),
    "A64": StationInfo("111 St", ["A"]),
    "A65": StationInfo("Ozone Park-Lefferts Blvd", ["A"]),
    # F line stations
    "B04": StationInfo("21 St-Queensbridge", ["F"]),
    "B06": StationInfo("Roosevelt Island", ["F"]),
    "B08": StationInfo("Lexington Av/63 St", ["F", "Q"]),
    "B10": StationInfo("57 St", ["F"]),
    "B12": StationInfo("9 Av", ["D"]),
    "B13": StationInfo("Fort Hamilton Pkwy", ["D"]),
    "B14": StationInfo("50 St", ["D"]),
    "B15": StationInfo("55 St", ["D"]),
    "B16": StationInfo("62 St", ["D"]),
    "B17": StationInfo("71 St", ["D"]),
    "B18": StationInfo("79 St", ["D"]),
    "B19": StationInfo("18 Av", ["D"]),
    "B20": StationInfo("20 Av", ["D"]),
    "B21": StationInfo("Bay Pkwy", ["D"]),
    "B22": StationInfo("25 Av", ["D"]),
    "B23": StationInfo("Bay 50 St", ["D"]),
    # D line stations
    "D01": StationInfo("Norwood-205 St", ["D"]),
    "D03": StationInfo("Bedford Park Blvd", ["B", "D"]),
    "D04": StationInfo("Kingsbridge Rd", ["B", "D"]),
    "D05": StationInfo("Fordham Rd", ["B", "D"]),
    "D06": StationInfo("182-183 Sts", ["B", "D"]),
    "D07": StationInfo("Tremont Av", ["B", "D"]),
    "D08": StationInfo("174-175 Sts", ["B", "D"]),
    "D09": StationInfo("170 St", ["B", "D"]),
    "D10": StationInfo("167 St", ["B", "D"]),
    "D11": StationInfo("161 St-Yankee Stadium", ["B", "D"]),
    "D12": StationInfo("155 St", ["B", "D"]),
    "D13": StationInfo("145 St", ["B", "D"]),
    "D14": StationInfo("7 Av", ["B", "D", "E"]),
    "D15": StationInfo("47-50 Sts-Rockefeller Ctr", ["B", "D", "F", "M"]),
    "D16": StationInfo("42 St-Bryant Pk", ["B", "D", "F", "M"]),
    "D17": StationInfo("34 St-Herald Sq", ["B", "D", "F", "M"]),
    "D18": StationInfo("23 St", ["F", "M"]),
    "D19": StationInfo("14 St", ["F", "M"]),
    "D20": StationInfo("W 4 St-Wash Sq", ["B", "D", "F", "M"]),
    "D21": StationInfo("Broadway-Lafayette St", ["B", "D", "F", "M"]),
    "D22": StationInfo("Grand St", ["B", "D"]),
    "D24": StationInfo("Atlantic Av-Barclays Ctr", ["B", "Q"]),
    "D25": StationInfo("7 Av", ["B", "Q"]),
    "D26": StationInfo("Prospect Park", ["B", "Q", "S"]),
    "D27": StationInfo("Parkside Av", ["Q"]),
    "D28": StationInfo("Church Av", ["B", "Q"]),
    "D29": StationInfo("Beverley Rd", ["Q"]),
    "D30": StationInfo("Cortelyou Rd", ["Q"]),
    "D31": StationInfo("Newkirk Plaza", ["B", "Q"]),
    "D32": StationInfo("Avenue H", ["Q"]),
    "D33": StationInfo("Avenue J", ["Q"]),
    "D34": StationInfo("Avenue M", ["Q"]),
    "D35": StationInfo("Kings Hwy", ["B", "Q"]),
    "D37": StationInfo("Avenue U", ["Q"]),
    "D38": StationInfo("Neck Rd", ["Q"]),
    "D39": StationInfo("Sheepshead Bay", ["B", "Q"]),
    "D40": StationInfo("Brighton Beach", ["B", "Q"]),
    "D41": StationInfo("Ocean Pkwy", ["Q"]),
    "D42": StationInfo("W 8 St-NY Aquarium", ["F", "Q"]),
    "D43": StationInfo("Coney Island-Stillwell Av", ["D", "F", "N", "Q"]),
    # E line stations
    "E01": StationInfo("World Trade Center", ["E"]),
    # F line continued
    "F01": StationInfo("Jamaica-179 St", ["F"]),
    "F02": StationInfo("169 St", ["F"]),
    "F03": StationInfo("Parsons Blvd", ["F"]),
    "F04": StationInfo("Sutphin Blvd", ["F"]),
    "F05": StationInfo("Briarwood", ["E", "F"]),
    "F06": StationInfo("Kew Gardens-Union Tpke", ["E", "F"]),
    "F07": StationInfo("75 Av", ["E", "F"]),
    "F09": StationInfo("Court Sq-23 St", ["E", "M"]),
    "F11": StationInfo("Lexington Av/53 St", ["E", "M"]),
    "F12": StationInfo("5 Av/53 St", ["E", "M"]),
    "F14": StationInfo("2 Av", ["F"]),
    "F15": StationInfo("Delancey St-Essex St", ["F"]),
    "F16": StationInfo("East Broadway", ["F"]),
    "F18": StationInfo("York St", ["F"]),
    "F20": StationInfo("Bergen St", ["F", "G"]),
    "F21": StationInfo("Carroll St", ["F", "G"]),
    "F22": StationInfo("Smith-9 Sts", ["F", "G"]),
    "F23": StationInfo("4 Av-9 St", ["F", "G"]),
    "F24": StationInfo("7 Av", ["F", "G"]),
    "F25": StationInfo("15 St-Prospect Park", ["F", "G"]),
    "F26": StationInfo("Fort Hamilton Pkwy", ["F", "G"]),
    "F27": StationInfo("Church Av", ["F", "G"]),
    "F29": StationInfo("Ditmas Av", ["F"]),
    "F30": StationInfo("18 Av", ["F"]),
    "F31": StationInfo("Avenue I", ["F"]),
    "F32": StationInfo("Bay Pkwy", ["F"]),
    "F33": StationInfo("Avenue N", ["F"]),
    "F34": StationInfo("Avenue P", ["F"]),
    "F35": StationInfo("Kings Hwy", ["F"]),
    "F36": StationInfo("Avenue U", ["F"]),
    "F38": StationInfo("Avenue X", ["F"]),
    "F39": StationInfo("Neptune Av", ["F"]),
    # G line stations
    "G05": StationInfo("Jamaica Center-Parsons/Archer", ["E", "J", "Z"]),
    "G06": StationInfo("Sutphin Blvd-Archer Av-JFK Airport", ["E", "J", "Z"]),
    "G07": StationInfo("Jamaica-Van Wyck", ["E"]),
    "G08": StationInfo("Forest Hills-71 Av", ["E", "F", "M", "R"]),
    "G09": StationInfo("67 Av", ["M", "R"]),
    "G10": StationInfo("63 Dr-Rego Park", ["M", "R"]),
    "G11": StationInfo("Woodhaven Blvd", ["M", "R"]),
    "G12": StationInfo("Grand Av-Newtown", ["M", "R"]),
    "G13": StationInfo("Elmhurst Av", ["M", "R"]),
    "G14": StationInfo("Jackson Hts-Roosevelt Av", ["E", "F", "M", "R"]),
    "G15": StationInfo("65 St", ["M", "R"]),
    "G16": StationInfo("Northern Blvd", ["M", "R"]),
    "G18": StationInfo("46 St", ["M", "R"]),
    "G19": StationInfo("Steinway St", ["M", "R"]),
    "G20": StationInfo("36 St", ["M", "R"]),
    "G21": StationInfo("Queens Plaza", ["E", "M", "R"]),
    "G22": StationInfo("Court Sq", ["G"]),
    "G24": StationInfo("21 St", ["G"]),
    "G26": StationInfo("Greenpoint Av", ["G"]),
    "G28": StationInfo("Nassau Av", ["G"]),
    "G29": StationInfo("Metropolitan Av", ["G"]),
    "G30": StationInfo("Broadway", ["G"]),
    "G31": StationInfo("Flushing Av", ["G"]),
    "G32": StationInfo("Myrtle-Willoughby Avs", ["G"]),
    "G33": StationInfo("Bedford-Nostrand Avs", ["G"]),
    "G34": StationInfo("Classon Av", ["G"]),
    "G35": StationInfo("Clinton-Washington Avs", ["G"]),
    "G36": StationInfo("Fulton St", ["G"]),
    # Rockaway A line stations
    "H01": StationInfo("Aqueduct Racetrack", ["A"]),
    "H02": StationInfo("Aqueduct-N Conduit Av", ["A"]),
    "H03": StationInfo("Howard Beach-JFK Airport", ["A"]),
    "H04": StationInfo("Broad Channel", ["A", "S"]),
    "H06": StationInfo("Beach 67 St", ["A"]),
    "H07": StationInfo("Beach 60 St", ["A"]),
    "H08": StationInfo("Beach 44 St", ["A"]),
    "H09": StationInfo("Beach 36 St", ["A"]),
    "H10": StationInfo("Beach 25 St", ["A"]),
    "H11": StationInfo("Far Rockaway-Mott Av", ["A"]),
    "H12": StationInfo("Beach 90 St", ["A", "S"]),
    "H13": StationInfo("Beach 98 St", ["A", "S"]),
    "H14": StationInfo("Beach 105 St", ["A", "S"]),
    "H15": StationInfo("Rockaway Park-Beach 116 St", ["A", "S"]),
    # J and Z line stations
    "J12": StationInfo("121 St", ["J", "Z"]),
    "J13": StationInfo("111 St", ["J"]),
    "J14": StationInfo("104 St", ["J", "Z"]),
    "J15": StationInfo("Woodhaven Blvd", ["J", "Z"]),
    "J16": StationInfo("85 St-Forest Pkwy", ["J"]),
    "J17": StationInfo("75 St-Elderts Ln", ["J", "Z"]),
    "J19": StationInfo("Cypress Hills", ["J"]),
    "J20": StationInfo("Crescent St", ["J", "Z"]),
    "J21": StationInfo("Norwood Av", ["J", "Z"]),
    "J22": StationInfo("Cleveland St", ["J"]),
    "J23": StationInfo("Van Siclen Av", ["J", "Z"]),
    "J24": StationInfo("Alabama Av", ["J", "Z"]),
    "J27": StationInfo("Broadway Junction", ["J", "Z"]),
    "J28": StationInfo("Chauncey St", ["J", "Z"]),
    "J29": StationInfo("Halsey St", ["J"]),
    "J30": StationInfo("Gates Av", ["J", "Z"]),
    "J31": StationInfo("Kosciuszko St", ["J"]),
    # L line stations
    "L01": StationInfo("8 Av", ["L"]),
    "L02": StationInfo("6 Av", ["L"]),
    "L03": StationInfo("14 St-Union Sq", ["L"]),
    "L05": StationInfo("3 Av", ["L"]),
    "L06": StationInfo("1 Av", ["L"]),
    "L08": StationInfo("Bedford Av", ["L"]),
    "L10": StationInfo("Lorimer St", ["L"]),
    "L11": StationInfo("Graham Av", ["L"]),
    "L12": StationInfo("Grand St", ["L"]),
    "L13": StationInfo("Montrose Av", ["L"]),
    "L14": StationInfo("Morgan Av", ["L"]),
    "L15": StationInfo("Jefferson St", ["L"]),
    "L16": StationInfo("DeKalb Av", ["L"]),
    "L17": StationInfo("Myrtle-Wyckoff Avs", ["L"]),
    "L19": StationInfo("Halsey St", ["L"]),
    "L20": StationInfo("Wilson Av", ["L"]),
    "L21": StationInfo("Bushwick Av-Aberdeen St", ["L"]),
    "L22": StationInfo("Broadway Junction", ["L"]),
    "L24": StationInfo("Atlantic Av", ["L"]),
    "L25": StationInfo("Sutter Av", ["L"]),
    "L26": StationInfo("Livonia Av", ["L"]),
    "L27": StationInfo("New Lots Av", ["L"]),
    "L28": StationInfo("East 105 St", ["L"]),
    "L29": StationInfo("Canarsie-Rockaway Pkwy", ["L"]),
    # M line stations
    "M01": StationInfo("Middle Village-Metropolitan Av", ["M"]),
    "M04": StationInfo("Fresh Pond Rd", ["M"]),
    "M05": StationInfo("Forest Av", ["M"]),
    "M06": StationInfo("Seneca Av", ["M"]),
    "M08": StationInfo("Myrtle-Wyckoff Avs", ["M"]),
    "M09": StationInfo("Knickerbocker Av", ["M"]),
    "M10": StationInfo("Central Av", ["M"]),
    "M11": StationInfo("Myrtle Av", ["J", "M", "Z"]),
    "M12": StationInfo("Flushing Av", ["J", "M"]),
    "M13": StationInfo("Lorimer St", ["J", "M"]),
    "M14": StationInfo("Hewes St", ["J", "M"]),
    "M16": StationInfo("Marcy Av", ["J", "M", "Z"]),
    "M18": StationInfo("Delancey St-Essex St", ["J", "M", "Z"]),
    "M19": StationInfo("Bowery", ["J", "Z"]),
    "M20": StationInfo("Canal St", ["J", "Z"]),
    "M21": StationInfo("Chambers St", ["J", "Z"]),
    "M22": StationInfo("Fulton St", ["J", "Z"]),
    "M23": StationInfo("Broad St", ["J", "Z"]),
    # N line stations
    "N02": StationInfo("8 Av", ["N"]),
    "N03": StationInfo("Fort Hamilton Pkwy", ["N"]),
    "N04": StationInfo("New Utrecht Av", ["N"]),
    "N05": StationInfo("18 Av", ["N"]),
    "N06": StationInfo("20 Av", ["N"]),
    "N07": StationInfo("Bay Pkwy", ["N"]),
    "N08": StationInfo("Kings Hwy", ["N"]),
    "N09": StationInfo("Avenue U", ["N"]),
    "N10": StationInfo("86 St", ["N"]),
    # Q line stations
    "Q01": StationInfo("Canal St", ["N", "Q"]),
    "Q03": StationInfo("72 St", ["Q"]),
    "Q04": StationInfo("86 St", ["Q"]),
    "Q05": StationInfo("96 St", ["Q"]),
    # R and W line stations
    "R01": StationInfo("Astoria-Ditmars Blvd", ["N", "W"]),
    "R03": StationInfo("Astoria Blvd", ["N", "W"]),
    "R04": StationInfo("30 Av", ["N", "W"]),
    "R05": StationInfo("Broadway", ["N", "W"]),
    "R06": StationInfo("36 Av", ["N", "W"]),
    "R08": StationInfo("39 Av-Dutch Kills", ["N", "W"]),
    "R09": StationInfo("Queensboro Plaza", ["N", "W"]),
    "R11": StationInfo("Lexington Av/59 St", ["N", "R", "W"]),
    "R13": StationInfo("5 Av/59 St", ["N", "R", "W"]),
    "R14": StationInfo("57 St-7 Av", ["N", "Q", "R", "W"]),
    "R15": StationInfo("49 St", ["N", "R", "W"]),
    "R16": StationInfo("Times Sq-42 St", ["N", "Q", "R", "W"]),
    "R17": StationInfo("34 St-Herald Sq", ["N", "Q", "R", "W"]),
    "R18": StationInfo("28 St", ["R", "W"]),
    "R19": StationInfo("23 St", ["R", "W"]),
    "R20": StationInfo("14 St-Union Sq", ["N", "Q", "R", "W"]),
    "R21": StationInfo("8 St-NYU", ["R", "W"]),
    "R22": StationInfo("Prince St", ["R", "W"]),
    "R23": StationInfo("Canal St", ["R", "W"]),
    "R24": StationInfo("City Hall", ["R", "W"]),
    "R25": StationInfo("Cortlandt St", ["R", "W"]),
    "R26": StationInfo("Rector St", ["R", "W"]),
    "R27": StationInfo("Whitehall St-South Ferry", ["R", "W"]),
    "R28": StationInfo("Court St", ["R"]),
    "R29": StationInfo("Jay St-MetroTech", ["R"]),
    "R30": StationInfo("DeKalb Av", ["B", "Q", "R"]),
    "R31": StationInfo("Atlantic Av-Barclays Ctr", ["D", "N", "R"]),
    "R32": StationInfo("Union St", ["R"]),
    "R33": StationInfo("4 Av-9 St", ["R"]),
    "R34": StationInfo("Prospect Av", ["R"]),
    "R35": StationInfo("25 St", ["R"]),
    "R36": StationInfo("36 St", ["D", "N", "R"]),
    "R39": StationInfo("45 St", ["R"]),
    "R40": StationInfo("53 St", ["R"]),
    "R41": StationInfo("59 St", ["N", "R"]),
    "R42": StationInfo("Bay Ridge Av", ["R"]),
    "R43": StationInfo("77 St", ["R"]),
    "R44": StationInfo("86 St", ["R"]),
    "R45": StationInfo("Bay Ridge-95 St", ["R"]),
    # S line stations (shuttles)
    "S01": StationInfo("Franklin Av", ["S"]),
    "S03": StationInfo("Park Pl", ["S"]),
    "S04": StationInfo("Botanic Garden", ["S"]),
    # Staten Island Railway
    "S09": StationInfo("Tottenville", ["SIR"]),
    "S11": StationInfo("Arthur Kill", ["SIR"]),
    "S13": StationInfo("Richmond Valley", ["SIR"]),
    "S14": StationInfo("Pleasant Plains", ["SIR"]),
    "S15": StationInfo("Prince's Bay", ["SIR"]),
    "S16": StationInfo("Huguenot", ["SIR"]),
    "S17": StationInfo("Annadale", ["SIR"]),
    "S18": StationInfo("Eltingville", ["SIR"]),
    "S19": StationInfo("Great Kills", ["SIR"]),
    "S20": StationInfo("Bay Terrace", ["SIR"]),
    "S21": StationInfo("Oakwood Heights", ["SIR"]),
    "S22": StationInfo("New Dorp", ["SIR"]),
    "S23": StationInfo("Grant City", ["SIR"]),
    "S24": StationInfo("Jefferson Av", ["SIR"]),
    "S25": StationInfo("Dongan Hills", ["SIR"]),
    "S26": StationInfo("Old Town", ["SIR"]),
    "S27": StationInfo("Grasmere", ["SIR"]),
    "S28": StationInfo("Clifton", ["SIR"]),
    "S29": StationInfo("Stapleton", ["SIR"]),
    "S30": StationInfo("Tompkinsville", ["SIR"]),
    "S31": StationInfo("St George", ["SIR"]),
}


def get_station_name(stop_id: str) -> Optional[str]:
    """Get the station name for a stop ID"""
    station = SUBWAY_STATIONS.get(stop_id)
    return station.name if station else None


def get_station_lines(stop_id: str) -> List[str]:
    """Get the lines that serve a station"""
    station = SUBWAY_STATIONS.get(stop_id)
    return station.lines if station else []


def get_station_info(stop_id: str) -> Optional[StationInfo]:
    """Get complete station information for a stop ID"""
    return SUBWAY_STATIONS.get(stop_id)


def is_valid_stop(stop_id: str) -> bool:
    """Check if a stop ID is valid"""
    return stop_id in SUBWAY_STATIONS


def find_stations_by_name(name: str) -> List[str]:
    """Find station IDs by partial name match"""
    name_lower = name.lower()
    matches = []
    for stop_id, station in SUBWAY_STATIONS.items():
        if name_lower in station.name.lower():
            matches.append(stop_id)
    return matches


def get_all_station_ids() -> List[str]:
    """Get all valid station IDs"""
    return list(SUBWAY_STATIONS.keys())
