/* Grundlayout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Roboto Flex", sans-serif;
  font-weight:  Regular 400;
}

body {
  background: linear-gradient(135deg, #3091e6, #9b7ce4, #ff4e50);
  color: #333;
  padding: 20px;
  line-height: 1.5;
}

.container {
  max-width: 800px;
  margin: auto;
  padding: 20px;
}

h1 {
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Karten / Frageboxen */
.question-box, .card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
question-box, .card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.question-box:hover, .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

legend {
  font-weight: Medium 500;
  font-size: 1 em;
  color: #5c0a0a;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: #444;
}

/* Eingabefelder */
.input-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.input-group input, .input-group select {
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #ddd;
  font-size: 1em;
  transition: all 0.3s ease-in-out;
  width: 100%;
}

.input-group input:focus, .input-group select:focus {
  border-color: #ff4e50;
  outline: none;
  box-shadow: 0 0 8px rgba(255,78,80,0.5);
}

.input-group .required {
  color: red;
  margin-left: 4px;
}

/* Buttons */
button, .btn {
  display: inline-block;
  margin-top: 20px;
  background: linear-gradient(135deg, #0d7ee0, #d13382);
  color: #fff;
  font-size: 1.2em;
  font-weight: bold;
  padding: 12px 24px;
  border: 0.5px solid #8a6478;
  border-radius: 12px;
   box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s;
}

button:hover, .btn:hover {
  background: #3367d6;
  transform: scale(1.05);
}

/* Ergebnisbereich */
#result {
  margin-top: 30px;
  padding: 20px;
  background: #fefefe;
  border: 2px solid #ddd;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s, transform 0.5s;
}

#result.visible {
  opacity: 1;
  transform: translateY(0);
}

.result-list {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

.result-list li {
  font-size: 1.1em;
  margin: 6px 0;
  display: flex;
  align-items: center;
}

.result-list li span.icon {
  margin-right: 8px;
  font-size: 1.3em;
  display: inline-block;
  animation: pop 0.3s ease-out;
}
/* Trenner */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, #aaa, #aaa, #aaa);
  opacity: 0.25;  
  margin: 1.5em 0;
}

/* Antwortmöglichkeiten */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.options label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fafafa;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, transform 0.2s, box-shadow 0.2s;
}

/* Hover-Animation */
.options label:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  background: #e0f7fa;
  border-color: #2e7d32;
}

/* Radio-Button Auswahlanimation */
.options input[type="radio"] {
  transform: scale(1.4);
  accent-color: #2e7d32;
  cursor: pointer;
}

.options input[type="radio"]:checked + span {
  animation: selected 0.3s ease-out forwards;
}

@keyframes selected {
  0% { transform: scale(1); background-color: transparent; }
  50% { transform: scale(1.15); background-color: #c8e6c9; }
  100% { transform: scale(1.05); background-color: #e0f7fa; }
}

/* Emoji Pop-Animation */
.options label span.icon {
  display: inline-block;
  transition: transform 0.2s, filter 0.2s;
}

.options label:hover span.icon {
  transform: rotate(-10deg) scale(1.2);
  filter: drop-shadow(0 0 4px #2e7d32);
}

/* Emoji Ergebnis Pop */
@keyframes pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Mobile Optimierung */
@media (max-width: 860px) {
  body {
    font-size: 16px;
    padding: 10px;
  }

  .container {
    padding: 10px;
    max-width: 860px;
    margin: auto;
  }

  h1 {
    font-size: 29px;
    margin-top: 0; /* Setzt den oberen Abstand zurück, da der Abstand vom Switcher kommt */
  }

  .question-box, .card {
    padding: 15px;
  }

  .options label {
    font-size: 16px;
    padding: 12px;
  }

  button, .btn {
    width: 100%;
    font-size: 18px;
    padding: 16px;
  }

  input, select {
    font-size: 16px;
    padding: 12px;
  }

  .page-header {
    flex-direction: column; /* Stellt sicher, dass die Elemente untereinander sind */
    margin-bottom: 20px; /* Abstand zum Formular */
  }

  .theme-switcher {
    position: static; /* Positionierung für mobilen Fluss anpassen */
    order: -1; /* Platziert den Switcher an den Anfang des Headers */
  }
}

/* === Theme Switcher === */
.theme-switcher {
  position: absolute;
  top: 15px;
  right: 20px;
  display: flex;
  align-items: center;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.sun-icon, .moon-icon {
  font-size: 1.5rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* === Blau/Grün Theme === */
body.blue-theme {
  background: linear-gradient(135deg, #007991, #78ffd6);
  color: #004d40;
}

body.blue-theme h1 {
  color: #fff;
}

body.blue-theme .btn {
  background: linear-gradient(135deg, #00796b, #004d40);
}

body.blue-theme .btn:hover {
  background: linear-gradient(135deg, #004d40, #00251a);
}

body.blue-theme input[type="radio"] {
  accent-color: #00796b;
}

/* Layout-Anpassung: Theme-Switcher oberhalb der Überschrift zentrieren */
.page-header {
  gap: 10px;
}

.theme-switcher {
  position: static;
  justify-content: center;
  margin-bottom: 0;
}
