/* Reset & Grundlayout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
}
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  /* Fallback-Farbe, falls das Bild mal nicht lädt: */
  background-color: #585858;

  /* Das eigentliche Hintergrundbild */
  background-image: url("/hintergrund.jpg");

  /* Bild zentriert skalieren und den gesamten Container füllen */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 80px; /* Platz für fixierten Header */
}

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 1000;
}
.site-header .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 80px;
}
.site-header .logo img {
  max-height: 50px;
  height: auto;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}
.main-nav a {
  color: #0055a5;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.3s;
}
.main-nav a:hover,
.main-nav a.active {
  background: rgba(0,85,165,0.1);
}

/* Icon / Label Umschaltung */
.main-nav .icon {
  display: none;
}
.main-nav .label {
  display: inline;
}

/* Content Wrapper */
main#view {
  flex: 1;
  padding: 2rem;
  background: #fff;
  margin: 1rem auto;
  width: 90%;
  max-width: 1000px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Footer full-width Hintergrund */
footer {
  width: 100%;
  background: #fff;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.1);
}
/* Inhalt zentriert */
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: #666;
}
.footer-left,
.footer-center,
.footer-right {
  flex: 1;
}
.footer-left   { text-align: left;  }
.footer-center { text-align: center; }
.footer-right  { text-align: right; }

.footer-inner a {
  margin: 0 0.5rem;
  color: #0055a5;
  text-decoration: none;
  font-weight: 600;
}
.footer-inner a:hover {
  text-decoration: underline;
}

/* Mobile-First Anpassungen */
@media (max-width: 800px) {
  /* Header umschichten */
  .site-header .container {
    flex-direction: column;
    height: auto;
    padding: 0.5rem 1rem;
  }
  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  /* Icons zeigen, Labels verstecken */
  .main-nav .label {
    display: none;
  }
  .main-nav .icon {
    display: inline;
    font-size: 1.4rem;
    vertical-align: middle;
  }

  /* Content */
  main#view {
    width: 95%;
    margin: 0.5rem auto;
    padding: 1rem;
  }

  /* Footer untereinander */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  .footer-left,
  .footer-center,
  .footer-right {
    width: 100%;
    flex: none;
  }
}


/* Export/Import-Buttons im Header */
.header-export {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;       /* schiebt die Buttons ans rechte Ende */
}

.header-export button {
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.header-export button:hover {
  opacity: 0.7;
}

/* Header & Footer beim Drucken ausblenden */
@media print {
  header.site-header,
  footer,
  .header-export {            /* dein Export/Import-Bereich */
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  #view {
    margin: 0 !important;
  }
}



/* ==== Kompakter Footer auf Mobile ==== */
@media (max-width: 800px) {
  footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.95);
    box-shadow: 0 -1px 4px rgba(0,0,0,0.1);
    z-index: 900;
    backdrop-filter: blur(6px); /* nice-to-have */
  }

  /* Platz für den fixierten Footer schaffen */
  body { padding-bottom: 48px; } /* anpassen, wenn höher */

  .footer-inner {
    flex-direction: row;          /* NICHT stapeln */
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    padding: .35rem .6rem;
    font-size: .75rem;
    overflow-x: auto;             /* falls es doch zu lang wird */
    white-space: nowrap;
  }

  .footer-left,
  .footer-center,
  .footer-right,
  .footer-actions {
    flex: 0 0 auto;
    text-align: center;
  }

  .footer-inner a {
    margin: 0 .35rem;
    font-weight: 500;
  }

  /* Optional: Labels ausblenden, Icons zeigen */
  .footer-center .label { display: none; }
  .footer-center .icon  { display: inline; font-size: 1.2rem; }

  /* Buttons noch kleiner */
  .footer-actions button {
    font-size: .75rem;
    padding: 0 .3rem;
  }
}

/* ===== MOBILE: Header 1-Zeile, Logo = Buttonhöhe ===== */
@media (max-width: 800px){

  /* Zielhöhe für Logo & Buttons */
  :root{ --hdr-item: 34px; }

  /* Container NICHT stapeln */
  .site-header .container{
    flex-direction: row;          /* override */
    align-items: center;
    justify-content: space-between;
    height: var(--hdr-item);
    padding: 0 .5rem;
    margin-top:0.5rem;
   margin-botton: 0.5rem;
    gap: .5rem;
  }

  /* Logo verkleinern */
  .site-header .logo img{
    max-height: var(--hdr-item);
    width: auto;
  }

  /* Nav: einzeilig, scrollbar falls zu lang */
  .main-nav ul{
    flex-wrap: nowrap;
    gap: .35rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Nur Icon zeigen */
  .main-nav .label{ display: none; }
  .main-nav .icon{
    display: inline;
    font-size: 1.35rem;
    line-height: 1;
  }

  /* Buttons kompakt, gleiche Höhe wie Logo */
  .main-nav a{
    padding: 0 .45rem;
    height: var(--hdr-item);
    line-height: var(--hdr-item);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
  }

  /* Body-Padding an neue Headerhöhe anpassen */
  body{ padding-top: var(--hdr-item); }
}
