// Major Tech Hubs and Internet Exchange Points
// Cities are sized by their digital infrastructure importance

export const citiesData = {
  "type": "FeatureCollection",
  "features": [
    // Tier 1: Global Tech Capitals (score: 90-100)
    { "type": "Feature", "properties": { "city": "San Francisco", "country": "USA", "importance": 100, "type": "Tech Hub", "connections": 850, "datacenters": 42 }, "geometry": { "type": "Point", "coordinates": [-122.4194, 37.7749] } },
    { "type": "Feature", "properties": { "city": "Seattle", "country": "USA", "importance": 94, "type": "Tech Hub", "connections": 720, "datacenters": 35 }, "geometry": { "type": "Point", "coordinates": [-122.3321, 47.6062] } },
    { "type": "Feature", "properties": { "city": "New York", "country": "USA", "importance": 98, "type": "Internet Exchange", "connections": 920, "datacenters": 48 }, "geometry": { "type": "Point", "coordinates": [-74.0060, 40.7128] } },
    { "type": "Feature", "properties": { "city": "London", "country": "UK", "importance": 97, "type": "Internet Exchange", "connections": 880, "datacenters": 45 }, "geometry": { "type": "Point", "coordinates": [-0.1276, 51.5074] } },
    { "type": "Feature", "properties": { "city": "Singapore", "country": "Singapore", "importance": 96, "type": "Internet Exchange", "connections": 840, "datacenters": 40 }, "geometry": { "type": "Point", "coordinates": [103.8198, 1.3521] } },
    { "type": "Feature", "properties": { "city": "Tokyo", "country": "Japan", "importance": 95, "type": "Tech Hub", "connections": 810, "datacenters": 38 }, "geometry": { "type": "Point", "coordinates": [139.6917, 35.6895] } },
    { "type": "Feature", "properties": { "city": "Amsterdam", "country": "Netherlands", "importance": 93, "type": "Internet Exchange", "connections": 790, "datacenters": 37 }, "geometry": { "type": "Point", "coordinates": [4.9041, 52.3676] } },
    { "type": "Feature", "properties": { "city": "Frankfurt", "country": "Germany", "importance": 92, "type": "Internet Exchange", "connections": 770, "datacenters": 36 }, "geometry": { "type": "Point", "coordinates": [8.6821, 50.1109] } },

    // Tier 2: Major Tech Centers (score: 75-89)
    { "type": "Feature", "properties": { "city": "Beijing", "country": "China", "importance": 89, "type": "Tech Hub", "connections": 650, "datacenters": 32 }, "geometry": { "type": "Point", "coordinates": [116.4074, 39.9042] } },
    { "type": "Feature", "properties": { "city": "Shanghai", "country": "China", "importance": 87, "type": "Tech Hub", "connections": 630, "datacenters": 30 }, "geometry": { "type": "Point", "coordinates": [121.4737, 31.2304] } },
    { "type": "Feature", "properties": { "city": "Shenzhen", "country": "China", "importance": 86, "type": "Tech Hub", "connections": 610, "datacenters": 28 }, "geometry": { "type": "Point", "coordinates": [114.0579, 22.5431] } },
    { "type": "Feature", "properties": { "city": "Seoul", "country": "South Korea", "importance": 88, "type": "Tech Hub", "connections": 640, "datacenters": 31 }, "geometry": { "type": "Point", "coordinates": [126.9780, 37.5665] } },
    { "type": "Feature", "properties": { "city": "Bangalore", "country": "India", "importance": 83, "type": "Tech Hub", "connections": 550, "datacenters": 25 }, "geometry": { "type": "Point", "coordinates": [77.5946, 12.9716] } },
    { "type": "Feature", "properties": { "city": "Boston", "country": "USA", "importance": 85, "type": "Tech Hub", "connections": 580, "datacenters": 27 }, "geometry": { "type": "Point", "coordinates": [-71.0589, 42.3601] } },
    { "type": "Feature", "properties": { "city": "Austin", "country": "USA", "importance": 82, "type": "Tech Hub", "connections": 540, "datacenters": 24 }, "geometry": { "type": "Point", "coordinates": [-97.7431, 30.2672] } },
    { "type": "Feature", "properties": { "city": "Los Angeles", "country": "USA", "importance": 84, "type": "Tech Hub", "connections": 570, "datacenters": 26 }, "geometry": { "type": "Point", "coordinates": [-118.2437, 34.0522] } },
    { "type": "Feature", "properties": { "city": "Chicago", "country": "USA", "importance": 81, "type": "Internet Exchange", "connections": 530, "datacenters": 23 }, "geometry": { "type": "Point", "coordinates": [-87.6298, 41.8781] } },
    { "type": "Feature", "properties": { "city": "Paris", "country": "France", "importance": 86, "type": "Tech Hub", "connections": 600, "datacenters": 29 }, "geometry": { "type": "Point", "coordinates": [2.3522, 48.8566] } },
    { "type": "Feature", "properties": { "city": "Berlin", "country": "Germany", "importance": 79, "type": "Tech Hub", "connections": 500, "datacenters": 21 }, "geometry": { "type": "Point", "coordinates": [13.4050, 52.5200] } },
    { "type": "Feature", "properties": { "city": "Stockholm", "country": "Sweden", "importance": 78, "type": "Tech Hub", "connections": 490, "datacenters": 20 }, "geometry": { "type": "Point", "coordinates": [18.0686, 59.3293] } },
    { "type": "Feature", "properties": { "city": "Tel Aviv", "country": "Israel", "importance": 80, "type": "Tech Hub", "connections": 520, "datacenters": 22 }, "geometry": { "type": "Point", "coordinates": [34.7818, 32.0853] } },
    { "type": "Feature", "properties": { "city": "Toronto", "country": "Canada", "importance": 77, "type": "Tech Hub", "connections": 480, "datacenters": 19 }, "geometry": { "type": "Point", "coordinates": [-79.3832, 43.6532] } },
    { "type": "Feature", "properties": { "city": "Vancouver", "country": "Canada", "importance": 75, "type": "Tech Hub", "connections": 460, "datacenters": 18 }, "geometry": { "type": "Point", "coordinates": [-123.1216, 49.2827] } },
    { "type": "Feature", "properties": { "city": "Sydney", "country": "Australia", "importance": 81, "type": "Internet Exchange", "connections": 525, "datacenters": 23 }, "geometry": { "type": "Point", "coordinates": [151.2093, -33.8688] } },
    { "type": "Feature", "properties": { "city": "Melbourne", "country": "Australia", "importance": 76, "type": "Tech Hub", "connections": 470, "datacenters": 18 }, "geometry": { "type": "Point", "coordinates": [144.9631, -37.8136] } },

    // Tier 3: Emerging Tech Cities (score: 60-74)
    { "type": "Feature", "properties": { "city": "Dublin", "country": "Ireland", "importance": 74, "type": "Tech Hub", "connections": 450, "datacenters": 17 }, "geometry": { "type": "Point", "coordinates": [-6.2603, 53.3498] } },
    { "type": "Feature", "properties": { "city": "Zurich", "country": "Switzerland", "importance": 73, "type": "Tech Hub", "connections": 440, "datacenters": 16 }, "geometry": { "type": "Point", "coordinates": [8.5417, 47.3769] } },
    { "type": "Feature", "properties": { "city": "Copenhagen", "country": "Denmark", "importance": 72, "type": "Tech Hub", "connections": 430, "datacenters": 16 }, "geometry": { "type": "Point", "coordinates": [12.5683, 55.6761] } },
    { "type": "Feature", "properties": { "city": "Helsinki", "country": "Finland", "importance": 71, "type": "Tech Hub", "connections": 420, "datacenters": 15 }, "geometry": { "type": "Point", "coordinates": [24.9384, 60.1695] } },
    { "type": "Feature", "properties": { "city": "Dubai", "country": "UAE", "importance": 78, "type": "Internet Exchange", "connections": 495, "datacenters": 20 }, "geometry": { "type": "Point", "coordinates": [55.2708, 25.2048] } },
    { "type": "Feature", "properties": { "city": "Hong Kong", "country": "Hong Kong", "importance": 85, "type": "Internet Exchange", "connections": 585, "datacenters": 27 }, "geometry": { "type": "Point", "coordinates": [114.1694, 22.3193] } },
    { "type": "Feature", "properties": { "city": "Mumbai", "country": "India", "importance": 76, "type": "Tech Hub", "connections": 475, "datacenters": 19 }, "geometry": { "type": "Point", "coordinates": [72.8777, 19.0760] } },
    { "type": "Feature", "properties": { "city": "Hyderabad", "country": "India", "importance": 74, "type": "Tech Hub", "connections": 455, "datacenters": 17 }, "geometry": { "type": "Point", "coordinates": [78.4867, 17.3850] } },
    { "type": "Feature", "properties": { "city": "Taipei", "country": "Taiwan", "importance": 77, "type": "Tech Hub", "connections": 485, "datacenters": 19 }, "geometry": { "type": "Point", "coordinates": [121.5654, 25.0330] } },
    { "type": "Feature", "properties": { "city": "Kuala Lumpur", "country": "Malaysia", "importance": 70, "type": "Tech Hub", "connections": 410, "datacenters": 14 }, "geometry": { "type": "Point", "coordinates": [101.6869, 3.1390] } },
    { "type": "Feature", "properties": { "city": "Bangkok", "country": "Thailand", "importance": 69, "type": "Tech Hub", "connections": 400, "datacenters": 14 }, "geometry": { "type": "Point", "coordinates": [100.5018, 13.7563] } },
    { "type": "Feature", "properties": { "city": "Jakarta", "country": "Indonesia", "importance": 68, "type": "Tech Hub", "connections": 390, "datacenters": 13 }, "geometry": { "type": "Point", "coordinates": [106.8456, -6.2088] } },
    { "type": "Feature", "properties": { "city": "Manila", "country": "Philippines", "importance": 67, "type": "Tech Hub", "connections": 380, "datacenters": 13 }, "geometry": { "type": "Point", "coordinates": [120.9842, 14.5995] } },
    { "type": "Feature", "properties": { "city": "Sao Paulo", "country": "Brazil", "importance": 73, "type": "Tech Hub", "connections": 445, "datacenters": 16 }, "geometry": { "type": "Point", "coordinates": [-46.6333, -23.5505] } },
    { "type": "Feature", "properties": { "city": "Buenos Aires", "country": "Argentina", "importance": 68, "type": "Tech Hub", "connections": 395, "datacenters": 13 }, "geometry": { "type": "Point", "coordinates": [-58.3816, -34.6037] } },
    { "type": "Feature", "properties": { "city": "Mexico City", "country": "Mexico", "importance": 71, "type": "Tech Hub", "connections": 425, "datacenters": 15 }, "geometry": { "type": "Point", "coordinates": [-99.1332, 19.4326] } },
    { "type": "Feature", "properties": { "city": "Santiago", "country": "Chile", "importance": 69, "type": "Tech Hub", "connections": 405, "datacenters": 14 }, "geometry": { "type": "Point", "coordinates": [-70.6693, -33.4489] } },
    { "type": "Feature", "properties": { "city": "Bogota", "country": "Colombia", "importance": 65, "type": "Tech Hub", "connections": 370, "datacenters": 12 }, "geometry": { "type": "Point", "coordinates": [-74.0721, 4.7110] } },
    { "type": "Feature", "properties": { "city": "Miami", "country": "USA", "importance": 72, "type": "Internet Exchange", "connections": 435, "datacenters": 16 }, "geometry": { "type": "Point", "coordinates": [-80.1918, 25.7617] } },
    { "type": "Feature", "properties": { "city": "Atlanta", "country": "USA", "importance": 70, "type": "Internet Exchange", "connections": 415, "datacenters": 15 }, "geometry": { "type": "Point", "coordinates": [-84.3880, 33.7490] } },
    { "type": "Feature", "properties": { "city": "Dallas", "country": "USA", "importance": 71, "type": "Internet Exchange", "connections": 420, "datacenters": 15 }, "geometry": { "type": "Point", "coordinates": [-96.7970, 32.7767] } },
    { "type": "Feature", "properties": { "city": "Denver", "country": "USA", "importance": 67, "type": "Tech Hub", "connections": 385, "datacenters": 13 }, "geometry": { "type": "Point", "coordinates": [-104.9903, 39.7392] } },
    { "type": "Feature", "properties": { "city": "Washington DC", "country": "USA", "importance": 75, "type": "Internet Exchange", "connections": 465, "datacenters": 18 }, "geometry": { "type": "Point", "coordinates": [-77.0369, 38.9072] } },
    { "type": "Feature", "properties": { "city": "Montreal", "country": "Canada", "importance": 69, "type": "Tech Hub", "connections": 400, "datacenters": 14 }, "geometry": { "type": "Point", "coordinates": [-73.5673, 45.5017] } },

    // Tier 4: Regional Tech Centers (score: 45-59)
    { "type": "Feature", "properties": { "city": "Madrid", "country": "Spain", "importance": 68, "type": "Tech Hub", "connections": 390, "datacenters": 13 }, "geometry": { "type": "Point", "coordinates": [-3.7038, 40.4168] } },
    { "type": "Feature", "properties": { "city": "Barcelona", "country": "Spain", "importance": 66, "type": "Tech Hub", "connections": 375, "datacenters": 12 }, "geometry": { "type": "Point", "coordinates": [2.1734, 41.3851] } },
    { "type": "Feature", "properties": { "city": "Milan", "country": "Italy", "importance": 67, "type": "Tech Hub", "connections": 380, "datacenters": 12 }, "geometry": { "type": "Point", "coordinates": [9.1900, 45.4642] } },
    { "type": "Feature", "properties": { "city": "Rome", "country": "Italy", "importance": 64, "type": "Tech Hub", "connections": 365, "datacenters": 11 }, "geometry": { "type": "Point", "coordinates": [12.4964, 41.9028] } },
    { "type": "Feature", "properties": { "city": "Vienna", "country": "Austria", "importance": 65, "type": "Tech Hub", "connections": 370, "datacenters": 12 }, "geometry": { "type": "Point", "coordinates": [16.3738, 48.2082] } },
    { "type": "Feature", "properties": { "city": "Warsaw", "country": "Poland", "importance": 63, "type": "Tech Hub", "connections": 360, "datacenters": 11 }, "geometry": { "type": "Point", "coordinates": [21.0122, 52.2297] } },
    { "type": "Feature", "properties": { "city": "Prague", "country": "Czech Republic", "importance": 62, "type": "Tech Hub", "connections": 355, "datacenters": 11 }, "geometry": { "type": "Point", "coordinates": [14.4378, 50.0755] } },
    { "type": "Feature", "properties": { "city": "Lisbon", "country": "Portugal", "importance": 61, "type": "Tech Hub", "connections": 350, "datacenters": 10 }, "geometry": { "type": "Point", "coordinates": [-9.1393, 38.7223] } },
    { "type": "Feature", "properties": { "city": "Brussels", "country": "Belgium", "importance": 66, "type": "Tech Hub", "connections": 375, "datacenters": 12 }, "geometry": { "type": "Point", "coordinates": [4.3517, 50.8503] } },
    { "type": "Feature", "properties": { "city": "Oslo", "country": "Norway", "importance": 67, "type": "Tech Hub", "connections": 380, "datacenters": 12 }, "geometry": { "type": "Point", "coordinates": [10.7522, 59.9139] } },
    { "type": "Feature", "properties": { "city": "Moscow", "country": "Russia", "importance": 70, "type": "Tech Hub", "connections": 410, "datacenters": 14 }, "geometry": { "type": "Point", "coordinates": [37.6173, 55.7558] } },
    { "type": "Feature", "properties": { "city": "St Petersburg", "country": "Russia", "importance": 59, "type": "Tech Hub", "connections": 340, "datacenters": 10 }, "geometry": { "type": "Point", "coordinates": [30.3351, 59.9311] } },
    { "type": "Feature", "properties": { "city": "Istanbul", "country": "Turkey", "importance": 64, "type": "Internet Exchange", "connections": 365, "datacenters": 11 }, "geometry": { "type": "Point", "coordinates": [28.9784, 41.0082] } },
    { "type": "Feature", "properties": { "city": "Cairo", "country": "Egypt", "importance": 56, "type": "Tech Hub", "connections": 320, "datacenters": 9 }, "geometry": { "type": "Point", "coordinates": [31.2357, 30.0444] } },
    { "type": "Feature", "properties": { "city": "Cape Town", "country": "South Africa", "importance": 58, "type": "Tech Hub", "connections": 335, "datacenters": 10 }, "geometry": { "type": "Point", "coordinates": [18.4241, -33.9249] } },
    { "type": "Feature", "properties": { "city": "Johannesburg", "country": "South Africa", "importance": 60, "type": "Tech Hub", "connections": 345, "datacenters": 10 }, "geometry": { "type": "Point", "coordinates": [28.0473, -26.2041] } },
    { "type": "Feature", "properties": { "city": "Nairobi", "country": "Kenya", "importance": 53, "type": "Tech Hub", "connections": 305, "datacenters": 8 }, "geometry": { "type": "Point", "coordinates": [36.8219, -1.2921] } },
    { "type": "Feature", "properties": { "city": "Lagos", "country": "Nigeria", "importance": 52, "type": "Tech Hub", "connections": 300, "datacenters": 8 }, "geometry": { "type": "Point", "coordinates": [3.3792, 6.5244] } },
    { "type": "Feature", "properties": { "city": "Accra", "country": "Ghana", "importance": 48, "type": "Tech Hub", "connections": 280, "datacenters": 7 }, "geometry": { "type": "Point", "coordinates": [-0.1870, 5.6037] } },
    { "type": "Feature", "properties": { "city": "Casablanca", "country": "Morocco", "importance": 51, "type": "Tech Hub", "connections": 295, "datacenters": 8 }, "geometry": { "type": "Point", "coordinates": [-7.5898, 33.5731] } },
    { "type": "Feature", "properties": { "city": "Riyadh", "country": "Saudi Arabia", "importance": 63, "type": "Tech Hub", "connections": 360, "datacenters": 11 }, "geometry": { "type": "Point", "coordinates": [46.7219, 24.7136] } },
    { "type": "Feature", "properties": { "city": "Doha", "country": "Qatar", "importance": 60, "type": "Internet Exchange", "connections": 345, "datacenters": 10 }, "geometry": { "type": "Point", "coordinates": [51.5310, 25.2854] } },
    { "type": "Feature", "properties": { "city": "Abu Dhabi", "country": "UAE", "importance": 62, "type": "Tech Hub", "connections": 355, "datacenters": 11 }, "geometry": { "type": "Point", "coordinates": [54.3773, 24.4539] } },
    { "type": "Feature", "properties": { "city": "Auckland", "country": "New Zealand", "importance": 61, "type": "Tech Hub", "connections": 350, "datacenters": 10 }, "geometry": { "type": "Point", "coordinates": [174.7633, -36.8485] } },
    { "type": "Feature", "properties": { "city": "Perth", "country": "Australia", "importance": 57, "type": "Tech Hub", "connections": 325, "datacenters": 9 }, "geometry": { "type": "Point", "coordinates": [115.8605, -31.9505] } },
    { "type": "Feature", "properties": { "city": "Brisbane", "country": "Australia", "importance": 59, "type": "Tech Hub", "connections": 340, "datacenters": 10 }, "geometry": { "type": "Point", "coordinates": [153.0251, -27.4698] } },
    { "type": "Feature", "properties": { "city": "Ho Chi Minh City", "country": "Vietnam", "importance": 58, "type": "Tech Hub", "connections": 330, "datacenters": 9 }, "geometry": { "type": "Point", "coordinates": [106.6297, 10.8231] } },
    { "type": "Feature", "properties": { "city": "Hanoi", "country": "Vietnam", "importance": 54, "type": "Tech Hub", "connections": 310, "datacenters": 8 }, "geometry": { "type": "Point", "coordinates": [105.8342, 21.0285] } },
    { "type": "Feature", "properties": { "city": "Osaka", "country": "Japan", "importance": 72, "type": "Tech Hub", "connections": 430, "datacenters": 16 }, "geometry": { "type": "Point", "coordinates": [135.5023, 34.6937] } },
    { "type": "Feature", "properties": { "city": "Nagoya", "country": "Japan", "importance": 55, "type": "Tech Hub", "connections": 315, "datacenters": 9 }, "geometry": { "type": "Point", "coordinates": [136.9066, 35.1815] } },
    { "type": "Feature", "properties": { "city": "Guangzhou", "country": "China", "importance": 74, "type": "Tech Hub", "connections": 450, "datacenters": 17 }, "geometry": { "type": "Point", "coordinates": [113.2644, 23.1291] } },
    { "type": "Feature", "properties": { "city": "Chengdu", "country": "China", "importance": 65, "type": "Tech Hub", "connections": 370, "datacenters": 12 }, "geometry": { "type": "Point", "coordinates": [104.0668, 30.5728] } },
    { "type": "Feature", "properties": { "city": "Hangzhou", "country": "China", "importance": 70, "type": "Tech Hub", "connections": 410, "datacenters": 14 }, "geometry": { "type": "Point", "coordinates": [120.1551, 30.2741] } },
    { "type": "Feature", "properties": { "city": "Nanjing", "country": "China", "importance": 62, "type": "Tech Hub", "connections": 355, "datacenters": 11 }, "geometry": { "type": "Point", "coordinates": [118.7969, 32.0603] } }
  ]
};

// Helper function to get city size based on importance
export function getCityRadius(importance) {
  return 3 + (importance / 100) * 12;  // 3px to 15px range
}

// Helper function to get city color based on type
export function getCityColor(type) {
  return type === 'Internet Exchange' ? '#ff6b6b' : '#4ecdc4';
}

// Helper to create connection lines between major hubs
export function getConnections() {
  const majorHubs = citiesData.features.filter(f => f.properties.importance >= 85);
  const connections = [];

  for (let i = 0; i < majorHubs.length; i++) {
    for (let j = i + 1; j < majorHubs.length; j++) {
      const hub1 = majorHubs[i];
      const hub2 = majorHubs[j];

      // Create connections between hubs in different regions
      if (hub1.properties.country !== hub2.properties.country) {
        connections.push({
          type: 'Feature',
          properties: {
            from: hub1.properties.city,
            to: hub2.properties.city,
            strength: Math.min(hub1.properties.connections, hub2.properties.connections)
          },
          geometry: {
            type: 'LineString',
            coordinates: [
              hub1.geometry.coordinates,
              hub2.geometry.coordinates
            ]
          }
        });
      }
    }
  }

  return {
    type: 'FeatureCollection',
    features: connections
  };
}
