* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --bg: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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

main {
  flex: 1;
}

footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-content a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* Map page */
.map-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.map-container h1 {
  margin-bottom: 1rem;
}

#map {
  width: 100%;
  height: 600px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.maplibregl-popup-content {
  padding: 1rem;
  min-width: 200px;
}

.popup-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.popup-river {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.popup-stats {
  font-size: 0.875rem;
  line-height: 1.6;
}

.popup-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--primary);
  text-decoration: none;
}

.popup-link:hover {
  text-decoration: underline;
}

/* About page */
.about-container {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.about-container h1 {
  margin-bottom: 1.5rem;
}

.about-container h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.about-container h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.about-container p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.about-container ul,
.about-container ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.about-container li {
  line-height: 1.7;
}

.about-container pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.about-container code {
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}

.about-container blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
}

.about-container img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Gauge detail page */
.gauge-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

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

.gauge-header h1 {
  font-size: 1.5rem;
}

.gauge-header .river {
  color: var(--text-muted);
}

#chart {
  width: 100%;
  height: 500px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
}

#chart .dygraph-legend,
#chart .dygraph-axis-label,
#chart .dygraph-xlabel,
#chart .dygraph-ylabel {
  box-sizing: content-box;
}

#chart .dygraph-legend {
  padding: 2px 4px;
}

.download-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.875rem;
}

.download-btn:hover {
  opacity: 0.9;
}
