html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  background-image: url("images/hintergrund.jpg");
  background-repeat: repeat;
  background-size: auto;
  background-position: 0 0;
  -webkit-overflow-scrolling: touch;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
  flex-direction: column;
}

.container-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(var(--vh, 1vh) * 100); /* 100% der sichtbaren Fensterhöhe */
  padding: 1rem;
  box-sizing: border-box;
}

.container {
  max-height: calc(var(--vh, 1vh) * 90); /* maximal 90% der Fensterhöhe */
  overflow-y: auto;                      /* scrollt bei Bedarf */
  width: 100%;
  max-width: 480px;
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(255,255,255,0.02); /* optional für Abgrenzung */
  border-radius: 0.5rem;
}
      
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999;
  background: rgba(255,255,255,0.9);
  text-align: center;
  font-size: 0.7rem;
  opacity: 0.5;
  padding: 0.5rem 1rem;
  box-shadow: 0 -1px 2px rgba(0,0,0,0.04);
  pointer-events: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a {
  text-decoration: none;
}
      
footer * {
  pointer-events: auto;
}


body.dark-mode footer {
      background: rgba(0,0,0,0.9);
      color: #ccc;
    }

body.dark-mode footer a {
      color: #aaa;
    }

.file-label, button {
      display: block;
      width: 100%;
      box-sizing: border-box;
    }

body.dark-mode #ergebnis {
      color: #eee;
    }

.shake {
      animation: shake 0.4s ease;
    }

    @keyframes shake {
      0% { transform: translateX(0); }
      20% { transform: translateX(-5px) translateY(-5px); }
      40% { transform: translateX(5px); }
      60% { transform: translateX(-5px); }
      80% { transform: translateX(5px)translateY(-5px); }
      100% { transform: translateX(0); }
    }

.bounce {
      animation: bounce 0.7s ease;
    }

    @keyframes bounce {
      0%   { transform: scale(1); }
      50%  { transform: scale(1.05); }
      100% { transform: scale(1); }
    }
      


.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}



.container {
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 0.5);
  border: 4px solid white;
  text-align: center;
  box-sizing: border-box;
  overflow-y: auto;
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* Internet Explorer/Edge (alt) */
}

@media (min-width: 768px) {
  .container {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

.container::-webkit-scrollbar {
  display: none;                /* Chrome, Safari, Edge (neu) */
}

.container.grün {
  background-color: rgba(150, 231, 154, 0.1);
  border-color: #2e8b57;
/*  animation: greenGlow 2s ease-in-out infinite alternate; */
}

.container.rot {
  background-color: rgba(245, 198, 198, 0.5);
  border-color: #c00;
/*  animation: redGlow 2s ease-in-out infinite alternate; */
}

.container.grau {
  background-color: rgba(220, 220, 220, 0.5);
  border-color: white;
/*  animation: grayGlow 2s ease-in-out infinite alternate; */
}

h2 {
  margin-bottom: 1.5rem;
  color: #333;
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border-radius: 0.6rem;
  border: 1px solid #ccc;
  font-size: 1rem;
  box-sizing: border-box;
  text-align: center;
}

::placeholder {
  color: #999;
}

button,
.file-label {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 0.75rem;
  background-color: #0078d4;
  color: white;
  border-radius: 0.6rem;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  margin-bottom: 0.5rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button:hover,
.file-label:hover {
  background-color: #005fa3;
}

.dateiname {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 1rem;
  word-break: break-word;
}

#ergebnis {
  margin-top: 1rem;
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

#weitereAusweise {
  margin-top: 1.5rem;
  text-align: left;
  display: none;
}

#weitereAusweise ul {
  list-style-type: none;
  padding-left: 0;
}

#weitereAusweise li {
  margin-bottom: 0.3rem;
}

#weitereAusweise li small {
  font-size: 0.85em;
  display: block;
  margin-top: 2px;
}

.gueltig {
  color: green;
}

.ungueltig {
  color: red;
}

.link-area {
  margin-top: 2rem;
  font-size: 0.95rem;
}

.link-area a {
  color: #0078d4;
  text-decoration: none;
}

.link-area a:hover {
  text-decoration: underline;
}

/* Dark Mode */
body.dark-mode {
  background-image: url("images/hintergrund-dark.jpg") !important;
  background-color: #121212;
  color: #ffffff;
}

body.dark-mode h2,
body.dark-mode .dateiname,
body.dark-mode ::placeholder,
body.dark-mode #weitereAusweise li,
body.dark-mode .link-area,
body.dark-mode .copyright {
  color: #ffffff;
}

body.dark-mode input {
  background-color: #2a2a2a;
  color: #ffffff;
  border: 1px solid #555;
}

body.dark-mode button,
body.dark-mode .file-label {
  background-color: #002b5c;
  color: #eee;
  border: 1px solid #555;
}

body.dark-mode .container {
  background-color: rgba(30, 30, 30, 0.5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

body.dark-mode .container.grün {
  background-color: rgba(0, 139, 0, 0.25);
}

body.dark-mode .container.rot {
  background-color: rgba(139, 0, 0, 0.25);
}

/* Animationen */
@keyframes greenGlow {
  0% { box-shadow: 0 0 10px rgba(46,139,87,0.3); }
  100% { box-shadow: 0 0 50px rgba(46,139,87,0.9); }
}

@keyframes redGlow {
  0% { box-shadow: 0 0 10px rgba(204,0,0,0.3); }
  100% { box-shadow: 0 0 50px rgba(204,0,0,0.9); }
}

@keyframes grayGlow {
  0% { box-shadow: 0 0 10px rgba(255,255,255,0.3); }
  100% { box-shadow: 0 0 50px rgba(255,255,255,0.9); }
}

@media screen and (max-width: 480px) {
  html {
    font-size: 90%;
  }
  .container {
    padding: 1rem;
    max-width: 90vw;
  }
  h2 {
    font-size: 1.2rem;
  }
  .file-label, button, input[type="text"] {
    font-size: 0.95rem;
    padding: 0.6rem;
  }
  .dateiname {
    font-size: 0.85rem;
  }
}

.loader-message {
  background: rgba(0,0,0,0.4);
  color: #ffffff;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: bold;
  animation: bounceFade 1s infinite alternate;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes bounceFade {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.05); opacity: 0.8; }
}

.spinner {
  border: 4px solid #ccc;       /* Grauer Hintergrund */
  border-top: 4px solid white;  /* Weißer Vordergrund */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

.leicht-bounce {
  animation: leichtBounce 0.6s ease;
}

@keyframes leichtBounce {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

body.no-effects .container {
  backdrop-filter: none !important;
  animation: none !important;
  box-shadow: none !important;
}

.copyright {
  text-align: center;
  font-size: 0.7rem;
  opacity: 0.5;
  margin-top: 3rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOutOverlay {
  from { opacity: 1; }
  to { opacity: 0; }
}

.fade-in {
  animation: fadeInOverlay 0.4s ease forwards;
}

.fade-out {
  animation: fadeOutOverlay 0.8s ease forwards;
}

@keyframes bounceEffect {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.1); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.bounce-confirmation {
  animation: bounceEffect 0.5s ease-in-out;
}