/* Grundlayout */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #111;
  color: white;
  min-height: 100vh;
  position: relative;
  z-index: 0;
  overflow-x: hidden; /* verhindert horizontales Scrollen */
}

/* Dark Mode */
body.dark {
  background-color: #000;
  color: #ddd;
}

/* Navigation oben fixiert */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  background: #222;
  padding: 1rem;
  box-shadow: 0 0 10px black;
}

nav a,
nav button {
  color: white;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  margin: 0.3rem;
  padding: 0.6rem 1rem;
  transition: background 0.2s;
}

nav a:hover,
nav button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Inhaltsbereich mit Abstand zur fixierten Navbar */
main {
  padding: 6rem 1rem 2rem;
  z-index: 1;
  position: relative;
}

/* Kartenraster */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  padding: 1rem 0;
}

/* Kartenlayout */
.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  transition: background 0.3s;
}

.card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.card img {
  max-width: 100%;
  border-radius: 6px;
  margin-top: 0.5rem;
}

/* Animierter Sternenhintergrund */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../img/asfalt-light.png') repeat;
  background-size: cover;
  animation: moveStars 100s linear infinite;
  opacity: 0.15;
  z-index: -1;
}

@keyframes moveStars {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 10000px 5000px;
  }
}

/* Statistik-Layout */
.stat-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 1rem;
  margin-top: 1rem;
}

.stat-block {
  flex: 1 1 200px;
  background: rgba(255, 255, 255, 0.85);
  color: #111;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  transition: background 0.3s ease, transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-block:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-3px);
}

body.dark .stat-block {
  background: #1e1e1e;
  color: #eee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .stat-block:hover {
  background: #2a2a2a;
}

/* Codeblöcke mobil anpassen */
pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
}

/* ☰ Mobile Menü Toggle */
.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  z-index: 1001;
}

/* Menücontainer – Standard sichtbar */
.nav-links {
  display: flex;
  gap: 0.5rem;
}

/* Responsive Anpassung */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu-toggle {
    display: block;
    margin-bottom: 0.5rem;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: #222;
    width: 100%;
    padding: 0.5rem 1rem;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a,
  .nav-links button {
    padding: 0.8rem;
    width: 100%;
    text-align: left;
    border-top: 1px solid #444;
    font-size: 1.1rem;
  }
}
