
:root {
  --primary-color: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary-color: #16a34a;
  --accent-color: #f59e0b;
  --danger-color: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --border-radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.header-content h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-content p {
  margin: 0;
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 300;
}

main {
  flex: 1;
  padding: 2rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

.controls {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

.controls h2 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-color);
  font-size: 1.8rem;
  text-align: center;
}

.controls p {
  margin: 0 0 2rem 0;
  color: var(--gray-500);
  font-size: 1rem;
  text-align: center;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.95rem;
  text-align: left;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: white;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-help {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.visualization {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.map-container, .metrics, .recommendations {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

.map-container h2, .metrics h3, .recommendations h3 {
  margin: 0 0 1rem 0;
  color: var(--primary-color);
  text-align: center;
}

.generate-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.generate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.tips {
  background: var(--gray-50);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--secondary-color);
  margin-top: 2rem;
}

.tips h3 {
  margin: 0 0 1rem 0;
  color: var(--secondary-color);
  font-size: 1.1rem;
}

.tips ul {
  margin: 0;
  padding-left: 1.2rem;
}

.tips li {
  margin-bottom: 0.5rem;
  color: var(--gray-600);
  font-size: 0.9rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.tips-section {
  background: var(--gray-50);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
}

.tips-section h3 {
  margin: 0 0 1rem 0;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.tips-section ul {
  margin: 0;
  padding-left: 1.2rem;
}

.tips-section li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--gray-600);
}


#content {
  flex: 1;
  display: flex;
  padding: 2rem;
  gap: 2rem;
  overflow: hidden;
}

#mapArea {
  flex: 2;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#metricsArea {
  flex: 1;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  min-width: 300px;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2,
.section-header h3 {
  margin: 0;
  color: var(--gray-800);
  font-weight: 600;
}

.section-header h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.section-header h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.city-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
}

.city-stat {
  font-size: 0.9rem;
  color: var(--gray-700);
}

.map-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

#mapCanvas {
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  max-width: 100%;
  max-height: 100%;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

#mapCanvas:hover {
  box-shadow: var(--shadow-md);
}

.map-controls {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.control-btn {
  padding: 0.5rem 1rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.control-btn:hover {
  background: var(--gray-200);
}

#mapLegend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--gray-50);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-700);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid var(--gray-300);
  flex-shrink: 0;
}


#metricsList,
#notesList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#metricsList li,
#notesList li {
  padding: 1rem;
  margin: 0.75rem 0;
  background: var(--gray-50);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-light);
  transition: var(--transition);
  font-size: 0.95rem;
}

#metricsList li:hover,
#notesList li:hover {
  background: var(--gray-100);
  transform: translateX(4px);
}

#notesList li {
  border-left-color: var(--secondary-color);
}

.placeholder-metric,
.placeholder-note {
  color: var(--gray-500);
  font-style: italic;
  text-align: center;
}


footer {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content p {
  margin: 0 0 1rem 0;
  color: var(--gray-600);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.footer-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-light);
}


.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 2rem;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.close {
  color: var(--gray-500);
  float: right;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}

.close:hover {
  color: var(--gray-800);
}


footer {
  background: var(--gray-800);
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  margin-top: 3rem;
}

footer p {
  margin: 0 0 1rem 0;
  opacity: 0.8;
}

footer nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

footer nav a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

footer nav a:hover {
  opacity: 1;
}


.tips {
  background: var(--gray-50);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--secondary-color);
  margin-top: 2rem;
}

.tips h3 {
  margin: 0 0 1rem 0;
  color: var(--secondary-color);
  font-size: 1.1rem;
}

.tips ul {
  margin: 0;
  padding-left: 1.2rem;
}

.tips li {
  margin-bottom: 0.5rem;
  color: var(--gray-600);
  font-size: 0.9rem;
}


@media (max-width: 1200px) {
  .container {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 800px;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  header p {
    font-size: 1rem;
  }

  main {
    padding: 1rem;
  }

  .controls, .map-container, .metrics, .recommendations {
    padding: 1.5rem;
  }

  footer nav {
    flex-direction: column;
    gap: 1rem;
  }
}

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }
  
  .controls, .map-container, .metrics, .recommendations {
    padding: 1rem;
  }
}