@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Theme: Digital Earth & Antiquity */
  --primary: #A8442E;           /* Deep Terracotta */
  --primary-hover: #8D3421;
  --secondary: #B88E3E;         /* Antique Gold */
  --secondary-hover: #9E7730;
  --text-dark: #202226;         /* Obsidian/Charcoal */
  --text-muted: #5C5E62;
  --bg-main: #FAF8F5;           /* Warm Sand / Linen */
  --bg-card: #FFFFFF;           /* Stone White */
  --border-color: #E6E2DB;      /* Earth Gray */
  
  /* Fonts */
  --font-header: 'Lora', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  /* Design Tokens */
  --radius-lg: 16px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --shadow-sm: 0 4px 12px rgba(32, 34, 38, 0.04);
  --shadow-md: 0 12px 30px rgba(32, 34, 38, 0.08);
  --shadow-lg: 0 20px 40px rgba(32, 34, 38, 0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

/* Reset & Base Styles */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  /* Subtiler Dotted-Grid Hintergrund */
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 24px 24px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--primary);
  border-radius: var(--radius-sm);
}

p {
  margin-bottom: 1.2rem;
  color: var(--text-muted);
}

strong {
  color: var(--text-dark);
  font-weight: 600;
}

a strong {
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Header & Sticky Navigation */
.nav-header {
  position: sticky;
  top: 0;
  background-color: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: 0.75rem 2rem;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-dark);
}

.nav-logo {
  height: 42px;
  border-radius: var(--radius-sm);
}

.nav-title {
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
  align-items: center;
}

.nav-link {
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.nav-link:hover {
  background-color: rgba(168, 68, 46, 0.08);
  color: var(--primary);
  text-decoration: none;
}

/* Main Layout */
main {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 4rem 2rem;
  background: radial-gradient(circle at top right, rgba(184, 142, 62, 0.06), transparent),
              radial-gradient(circle at bottom left, rgba(168, 68, 46, 0.06), transparent);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.hero-logo {
  height: 80px;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
}

/* Grid & Cards */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card h2 {
  margin-bottom: 1.2rem;
}

.card ul {
  list-style: none;
  margin-top: 1rem;
}

.card li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 0.8rem;
  color: var(--text-muted);
}

.card li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* Stat Cards / Hero Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: -1.5rem 0 3rem 0;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--secondary);
}

.stat-number {
  font-family: var(--font-body);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Dashboard Styles */
.dashboard-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 3rem;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.chart-card {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-title {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.chart-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.chart-wrapper {
  position: relative;
  height: 280px;
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  gap: 8px;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #FFFFFF;
}

.btn-secondary {
  background-color: var(--secondary);
  color: #FFFFFF;
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  color: #FFFFFF;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-dark);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: rgba(168, 68, 46, 0.05);
}

.btn-reset {
  background-color: #D32F2F;
  color: #FFFFFF;
}

.btn-reset:hover {
  background-color: #B71C1C;
  color: #FFFFFF;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 1.5rem 0;
}

/* WMA / Leaflet Page Layout */
.wma-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 120px);
  margin: 1rem auto;
  padding: 0 1.5rem;
  max-width: 1600px;
}

.wma-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
}

.wma-panel h2 {
  font-size: 1.4rem;
  margin-bottom: 0;
}

.wma-panel label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  display: block;
  margin-bottom: 4px;
}

.wma-panel select, .wma-panel input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-dark);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.wma-panel select:focus, .wma-panel input:focus {
  border-color: var(--primary);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(168, 68, 46, 0.15);
}

.wma-map-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  height: 100%;
}

.wma-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* References Section */
.references-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-sm);
  margin-top: 3rem;
}

.references-list {
  list-style: none;
  margin-top: 1.5rem;
}

.references-list li {
  margin-bottom: 1.2rem;
  padding-left: 20px;
  text-indent: -20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.references-list i {
  font-style: italic;
}

/* General Layout for Markdown content like Impressum */
.legal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 900px;
  margin: 3rem auto;
}

.legal-content h1, .legal-content h2, .legal-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.legal-content p, .legal-content ul {
  margin-bottom: 1.5rem;
}

.legal-content ul {
  padding-left: 20px;
}

.legal-content li {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

/* Footer */
footer {
  background-color: var(--text-dark);
  color: rgba(255, 255, 255, 0.9) !important;
  text-align: center;
  padding: 2.5rem 1rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}

footer p {
  color: rgba(255, 255, 255, 0.9) !important;
  margin-bottom: 0.75rem;
}

footer p:last-child {
  margin-bottom: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75) !important;
}

footer a {
  color: #FFD275 !important; /* Brighter gold for higher contrast */
  text-decoration: underline;
  font-weight: 700;
  transition: var(--transition);
}

footer a:hover {
  color: #FFFFFF !important; /* Turn white on hover */
  text-decoration: none;
}

/* Ensure all strong elements in footer (such as Google Antigravity) are readable */
footer strong,
footer a strong,
footer p strong {
  color: #FFD275 !important;
  font-weight: 700;
}

footer a:hover strong,
footer a:hover * {
  color: #FFFFFF !important;
}

/* Autocomplete suggestions */
.autocomplete-suggestions {
  position: absolute;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  box-shadow: var(--shadow-md);
}

.autocomplete-suggestion {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  text-align: left;
  transition: var(--transition);
}

.autocomplete-suggestion:hover {
  background-color: var(--bg-main);
  color: var(--primary);
}

.autocomplete-suggestion:last-child {
  border-bottom: none;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .wma-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .wma-panel {
    height: auto;
    max-height: 450px;
  }
  
  .wma-map-container {
    height: 600px;
  }
}

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

  h2 {
    font-size: 1.5rem;
  }

  .nav-container {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .hero-section {
    padding: 2.5rem 1.5rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }
  
  .dashboard-container {
    padding: 1.5rem 1rem;
  }
  
  .chart-wrapper {
    height: 240px;
  }
}
