/* Global CSS variables for light mode (default) */
:root {
  --background-color-main: #f4f4f4;
  --background-color-container: #ffffff;
  --background-color-section: #f9f9f9;
  --text-color-primary: #333;
  --text-color-secondary: #555;
  --text-color-hint: gray;
  --border-color-light: #ccc;
  --border-color-medium: #ddd;
  --border-color-dotted: #eee;
  --input-background: #fdfdfd;
  --button-background-primary: #007bff;
  --button-background-hover: #0056b3;
  --button-text: #ffffff;
  --box-shadow-light: rgba(0, 0, 0, 0.1);
  --box-shadow-medium: rgba(0, 0, 0, 0.2);
  --highlight-color: orange;
  --highlight-background: #fffaf0;
  /* Neue Variablen fï¿½r Header-Buttons */
  --primary-color: #007bff;
  /* Fï¿½r Icons */
  --background-color-secondary: #f0f0f0;
  /* Fï¿½r Button-Hintergrund im Light Mode */
  --background-color-tertiary: #e8e8e8;
  /* Fï¿½r Button-Hover im Light Mode */
  --white-color: #ffffff;
  /* Fï¿½r Text-Buttons */
  --border-radius-small: 8px;
  /* Fï¿½r runde Ecken */
  --shadow-small: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dark mode variables: Applied when the 'dark-mode' class is active */
.dark-mode {
  --background-color-main: #1a1a2e;
  --background-color-container: #2e2e4e;
  --background-color-section: #3a3a5a;
  --text-color-primary: #e0e0e0;
  --text-color-secondary: #c0c0c0;
  --text-color-hint: #a0a0a0;
  --border-color-light: #555;
  --border-color-medium: #444;
  --border-color-dotted: #333;
  --input-background: #3a3a5a;
  --button-background-primary: #0056b3;
  --button-background-hover: #003d80;
  --button-text: #ffffff;
  --box-shadow-light: rgba(0, 0, 0, 0.3);
  --box-shadow-medium: rgba(0, 0, 0, 0.4);
  --highlight-color: #ffa500;
  --highlight-background: #3a3a5a;
  /* Dark Mode Farben fï¿½r Header-Buttons */
  --background-color-secondary: #4a4a6e;
  --background-color-tertiary: #5a5a7a;
  --primary-color: #90b8f8;
}

html {
  width: 100%;
  overflow-x: hidden;
  /* Fixiert den horizontalen Strich */
}

body {
  font-family: sans-serif;
  margin: 0;
  padding: 20px;
  background-color: var(--background-color-main);
  color: var(--text-color-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  text-align: left;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  width: 90%;
  margin: 0 auto;
  background-color: var(--background-color-container);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px var(--box-shadow-light);
  display: flex;
  flex-direction: row;
  /* Ã„ndert die Standardrichtung auf Zeile */
  gap: 40px;
  margin-top: 20px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  flex-wrap: wrap;
  /* Beibehalten, um Umbruch zu ermÃ¶glichen */
}

/* --- KORRIGIERTER HEADER BEREICH --- */
.header-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color-medium);
}

/* Container fï¿½r alle Buttons und den User-Namen */
.header-controls {
  display: flex;
  /* Wichtig fï¿½r die nebeneinander liegenden Buttons */
  align-items: center;
  gap: 0.75rem;
  /* Abstand zwischen den Steuerelementen */
}

/* Stil fï¿½r den Benutzernamen, wenn eingeloggt */
.user-display {
  font-weight: 600;
  color: var(--text-color-primary);
}

/* Basisstil fï¿½r alle Header-Buttons */
.user-icon-btn,
.dark-mode-toggle,
.card-icon-btn {
  /* Setzt die gleichen Maï¿½e fï¿½r alle kleinen Buttons */
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--border-radius-small);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  /* Verhindert, dass die Buttons schrumpfen */
  font-size: 1rem;
  padding: 0;
}

/* Stil fï¿½r den User-Icon-Button */
.card-icon-btn,
.user-icon-btn {
  background-color: var(--background-color-secondary);
  color: var(--primary-color);
  box-shadow: var(--shadow-small);
}

/* Hover-Effekte */
.user-icon-btn:hover {
  background-color: var(--background-color-tertiary);
  box-shadow: var(--shadow-medium);
}

/* Stil fï¿½r das SVG-Icon im Button */
.user-icon-btn svg {
  stroke: currentColor;
  width: 1.25rem;
  height: 1.25rem;
}

.cart-footer #wishlist-message {
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  display: none;
  /* versteckt standardmäßig */
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* sichtbar */
.cart-footer #wishlist-message.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Erfolgsfarbe */
.cart-footer #wishlist-message.success {
  background-color: #e6ffed;
  color: #2d7a2d !important;
  /* Dunkelgrün */
  border: 1px solid #2d7a2d;
}

/* Fehlerfarbe */
.cart-footer #wishlist-message.error {
  background-color: #ffe6e6;
  color: #a60000 !important;
  /* Dunkelrot */
  border: 1px solid #a60000;
}

#wishlist-message .login-link {
  color: #4fc3f7;
  /* hellblau z.B. */
  text-decoration: underline;
  cursor: pointer;
}

#wishlist-message .login-link:hover {
  color: #81d4fa;
}

/* ======================================= */
/* DIALOG OVERLAY (Hintergrund) */
/* ======================================= */
.dialog-overlay-first {
  /* Standardmï¿½ï¿½ig ausgeblendet (JS macht es sichtbar) */
  display: none;

  /* Positionierung ï¿½ber den gesamten Bildschirm */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* Dunkle, leicht transparente ï¿½berlagerung */
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  /* Sehr hoch, um ï¿½ber allem anderen zu liegen */

  /* Zentrierung des Modal-Inhalts */
  display: flex;
  /* Muss in JS auf 'flex' gesetzt werden, um sichtbar zu sein */
  justify-content: center;
  align-items: center;
}

/* ======================================= */
/* DIALOG INHALT (Pop-up Fenster) */
/* ======================================= */
.dialog-content-first {
  background-color: #f7fafc;
  /* Heller Hintergrund fï¿½r den Pop-up-Effekt */
  color: #2d3748;
  padding: 2rem;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);

  /* Animation beim Erscheinen */
  transform: scale(0.9);
  animation: bounceIn 0.3s forwards;
}

/* ======================================= */
/* TYPOGRAPHIE UND BUTTONS */
/* ======================================= */
.dialog-content-first h2 {
  font-size: 1.8rem;
  color: #4c51bf;
  /* Akzentfarbe */
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.dialog-content-first p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

#close-dialog-btn {
  background-color: #4c51bf;
  /* Primï¿½rfarbe */
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

#close-dialog-btn:hover {
  background-color: #383a8f;
  transform: translateY(-1px);
}

/* ======================================= */
/* ANIMATION */
/* ======================================= */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Anpassung fï¿½r mobile Gerï¿½te */
@media (max-width: 450px) {
  .dialog-content-first {
    padding: 1rem;
    border-radius: 8px;
  }
}

/* ======================================= */
/* 1. Modal-Hintergrund (Backdrop)         */
/* ======================================= */
.cart-backdrop {
  /* Positionierung und Abdeckung des gesamten Bildschirms */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Dunkle, leicht transparente ï¿½berlagerung */
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  /* Standardmï¿½ï¿½ig ausgeblendet (wird per JS geï¿½ndert) */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
}

/* Zustand, wenn das Modal geï¿½ffnet ist (wird per JS-Klasse hinzugefï¿½gt) */
.cart-backdrop.open {
  visibility: visible;
  /* <-- Hier wird der Hintergrund sichtbar */
  opacity: 1;
}

/* Zustand, wenn das Modal geï¿½ffnet ist */
.cart-backdrop.open .cart-modal {
  /* <-- Hier wird das Modal hereingeschoben */
  transform: translateX(0);
}

/* ======================================= */
/* 2. Modal-Inhalt (Sidebar)               */
/* ======================================= */
.cart-modal {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  /* Definierte Breite fï¿½r die Sidebar */
  height: 100%;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  /* Dark Mode Farben */
  background-color: #24243a;
  color: #ffffff;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);

  /* Animation: Schiebt von rechts ins Bild */
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
}

/* Zustand, wenn das Modal geï¿½ffnet ist */
.cart-backdrop.open .cart-modal {
  transform: translateX(0);
}

/* ======================================= */
/* 3. Header und Close-Button              */
/* ======================================= */
.modal-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #4a5568;
  /* Dunkle Trennlinie */
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: bold;
}

.close-btn {
  background: none;
  border: none;
  color: #a0aec0;
  /* Helleres Grau fï¿½r das Icon */
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: color 0.2s, background-color 0.2s;
}

.close-btn:hover {
  color: #ffffff;
  background-color: #3b4257;
}

/* ======================================= */
/* 4. Artikel-Container (Scrollbar)        */
/* ======================================= */
.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  /* Wichtig fï¿½r scrollbare Liste */
  padding: 1rem 1.5rem;
  /* Scrollbar Styling fï¿½r Dark Mode (optional) */
  scrollbar-color: #4a5568 #2d3748;
  scrollbar-width: thin;
}

/* ======================================= */
/* 5. Footer und Checkout-Bereich          */
/* ======================================= */
.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid #4a5568;
  /* Dunkle Trennlinie */
  background-color: #1a1a2e;
  /* Etwas dunklerer Hintergrund fï¿½r den Footer */
}

/* Einzelner Warenkorb-Artikel */
.cart-item {
  margin-bottom: 12px;
}

.cart-item-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--background-color-container);
  border: 1px solid var(--border-color-medium);
  border-radius: var(--border-radius-small);
  box-shadow: var(--box-shadow-small);
  transition: transform 0.1s, box-shadow 0.2s, background-color 0.3s;
  position: relative;
}

.cart-item-inner:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-medium);
}

/* Artikelinfo */
.cart-item-info {
  display: flex;
  flex-direction: column;
}

.cart-item-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-color-primary);
  margin-bottom: 4px;
}

.cart-item-quantity,
.cart-item-id {
  font-size: 13px;
  color: var(--text-color-secondary);
}

/* Entfernen-Button */
.cart-item-actions .remove-btn {
  position: absolute;
  bottom: 12px;
  /* Abstand vom unteren Rand */
  right: 16px;
  /* Abstand vom rechten Rand */
  background-color: #ff4d4f;
  color: var(--white-color);
  border: none;
  padding: 6px 12px;
  border-radius: var(--border-radius-small);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.2s, transform 0.1s;
}

.cart-item-actions .remove-btn:hover {
  background-color: #d9363e;
  transform: scale(1.05);
}

/* Leere Merkliste */
.cart-empty-message {
  text-align: center;
  padding: 30px 0;
  font-size: 14px;
  color: var(--text-color-secondary);
  font-style: italic;
}

/* Icon im Button */
.remove-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.checkout-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  /* Style fï¿½r den Checkout-Button */
  background-color: #63b3ed;
  color: #1a1a2e;
  transition: background-color 0.2s;
}

.checkout-btn:hover:not(:disabled) {
  background-color: #4299e1;
}

.checkout-btn:disabled {
  background-color: #4a5568;
  /* Abgedunkelt, wenn deaktiviert */
  color: #a0aec0;
  cursor: not-allowed;
}

/* ======================================= */
/* 6. Mobile Anpassung (Sidebar wird Fullscreen) */
/* ======================================= */
@media (max-width: 640px) {
  .cart-modal {
    max-width: 100%;
    /* Auf kleinen Bildschirmen volle Breite */
  }
}

/* --- WARENKORB Zï¿½HLER (BADGE) STILE (Jetzt: .cart-count) --- */
.card-count {
  /* SCHLï¿½SSEL 2a: Absolut zur .card-icon-btn platzieren */
  position: absolute;
  top: -5px;
  /* Etwas weiter nach oben verschoben */
  right: -5px;
  /* Etwas weiter nach rechts verschoben */

  /* Layout des Badges */
  display: none;
  /* Standardmï¿½ï¿½ig ausgeblendet */
  align-items: center;
  justify-content: center;

  width: 20px;
  height: 20px;
  font-size: 10px;
  font-weight: bold;
  color: white;
  background-color: #ef4444;
  /* Hellrot */

  /* KORREKTUR: border-radius auf 50% fï¿½r perfekte Kreisform */
  border-radius: 50%;
  border: 2px solid var(--background-color-secondary);
  /* Border in Header-Farbe */

  /* SCHLï¿½SSEL 2b: Nur die Verschiebung, falls nï¿½tig. Mit top/right ist dies weniger nï¿½tig. */
  /* transform: translate(33%, -33%); */

  line-height: 1;
  padding: 0px;
  /* Kleiner Innenabstand */
  min-width: 20px;
  /* Stellt sicher, dass es rund bleibt, auch bei Zahlen > 9 */
  text-align: center;
  transition: opacity 0.3s;
  z-index: 200;
}

/* Klasse wird per JavaScript hinzugefï¿½gt, wenn der Zï¿½hler > 0 ist */
.card-count.visible {
  display: flex;
}

/* --- ENDE KORRIGIERTER HEADER BEREICH --- */

h1 {
  text-align: left;
  color: var(--text-color-primary);
  margin: 0;
  padding-right: 10px;
  flex-grow: 1;
}

h2 {
  text-align: center;
  color: var(--text-color-primary);
  width: 100%;
  margin-bottom: 30px;
}

.content-wrapper {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

form {
  flex: 1;
  min-width: 300px;
  padding-right: 20px;
  border-right: 1px solid var(--border-color-medium);
  transition: border-color 0.3s ease;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: var(--text-color-primary);
}

select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 1em;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%3E%3Cpath%20d%3D%22M7%2C10l5%2C5%205%2C-5H7z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 1em;
  transition: border-color 0.3s ease, background-color 0.3s ease,
    color 0.3s ease;
  box-shadow: none;
}

button[type="submit"] {
  width: 100%;
  padding: 12px 20px;
  background-color: var(--button-background-primary);
  color: var(--button-text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1em;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 8px var(--box-shadow-medium);
}

button[type="submit"]:hover {
  background-color: var(--button-background-hover);
  transform: translateY(-2px);
}

.ergebnis-bereich {
  flex: 1;
  min-width: 300px;
  padding: 15px;
  border-radius: 12px;
  background-color: var(--background-color-section);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding-left: 20px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

#produktListe {
  list-style: none;
  padding: 0;
  width: 100%;
}

#produktListe li {
  background-color: var(--input-background);
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  margin-bottom: 15px;
  padding: 15px;
  text-align: left;
  box-shadow: 0 2px 5px var(--box-shadow-light);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  color: var(--text-color-secondary);
}

#produktListe li strong {
  color: var(--text-color-primary);
  display: block;
  margin-bottom: 5px;
  font-size: 1.05em;
}

#produktListe li p.produkt-beschreibung {
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--text-color-secondary);
}

#ergebnisTitel {
  color: var(--text-color-primary);
  background-color: var(--input-background);
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  box-shadow: 0 2px 5px var(--box-shadow-light);
  padding: 15px;
  margin-bottom: 15px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, box-shadow 0.3s ease;
}

#initialHinweis {
  color: var(--text-color-secondary);
  background-color: var(--input-background);
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  box-shadow: 0 2px 5px var(--box-shadow-light);
  padding: 15px;
  margin-bottom: 15px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, box-shadow 0.3s ease;
}

#gesundheitInfo {
  font-size: 0.85em;
  color: var(--text-color-hint);
  margin-top: 10px;
  margin-bottom: 20px;
  padding-left: 10px;
  border-left: 2px solid var(--highlight-color);
  background-color: var(--highlight-background);
  padding: 8px;
  border-radius: 4px;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

.bu-spezial-hinweis {
  font-size: 0.85em;
  color: var(--text-color-hint);
  margin-top: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--highlight-color);
  background-color: var(--highlight-background);
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

.bu-spezial-hinweis span {
  color: var(--highlight-color);
  font-weight: bold;
}

#register-salutation {
  /* FÃ¼gen Sie hier die ID des Select-Feldes hinzu */
  width: 97%;
  /* NEU: Padding fÃ¼r eine geringere HÃ¶he reduziert */
  padding: 12px 12px;
  margin-bottom: 10px;
  /* Platz nach unten */
  border: 1px solid #5a5a75;
  /* Ein etwas hellerer Rand */
  border-radius: 8px;
  /* Abgerundete Ecken */
  background-color: var(--background-color-container);
  /* Dunkler Hintergrund, wie bei Ihren Textfeldern */
  color: #484b4e;
  /* WeiÃŸe Schrift */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  appearance: none;
  /* WICHTIG: Entfernt das Standard-Pfeil-Symbol in manchen Browsern */
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

button {
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-primary {
  background-color: var(--button-background-primary);
  color: white;
}

/* Wichtig: .dark-mode-toggle muss aus der absoluten Positionierung heraus, 
   um im Flexbox-Container (.header-controls) zu funktionieren. */
.dark-mode-toggle {
  position: static;
  width: 2.5rem;
  height: 2.5rem;
  z-index: 1000;
  /* Angepasst an die neuen Basisstile */
  background-color: var(--background-color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  border-radius: var(--border-radius-small);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.dark-mode-toggle:hover {
  background-color: var(--background-color-tertiary);
  transform: none;
  /* Keine Skalierung */
}

.dark-mode-toggle .icon {
  display: block;
  line-height: 1;
}

/* StandardmÃ¤ÃŸig (Light Mode) ist der Mond versteckt und die Sonne sichtbar */
.dark-mode-toggle .moon-icon {
  display: none;
}

.dark-mode-toggle .sun-icon {
  display: block;
}

/* Im Dark Mode soll der Mond angezeigt werden und die Sonne versteckt sein. */
.dark-mode .dark-mode-toggle .moon-icon {
  display: block;
  filter: grayscale(0%);
}

.dark-mode .dark-mode-toggle .sun-icon {
  display: none;
}

/* ---------------------------------------------------------------------- */
/* WICHTIG: Korrekte Positionierung fï¿½r das Dropdown-Menï¿½                 */
/* ---------------------------------------------------------------------- */

/* 1. CONTAINER: Muss den Bezugspunkt fï¿½r die absolute Positionierung liefern */
.user-dropdown-wrapper {
  /* MUSS relative sein, damit das Kindelement (#user-dropdown) 
       seine Position darauf beziehen kann. */
  position: relative;

  /* Sorgt dafï¿½r, dass der Container nur so breit ist wie der Button */
  display: inline-block;
}

/* 2. DROPDOWN: Muss absolut positioniert werden */
#user-dropdown {
  /* Platziert das Menï¿½ relativ zum nï¿½chsten Elternelement mit 'position: relative' */
  position: absolute;

  /* top: 100% positioniert das Dropdown genau unter dem Button */
  top: 100%;

  /* right: 0 richtet die rechte Kante des Dropdowns an der rechten Kante des Buttons aus */
  right: 0;

  /* Stil und Sichtbarkeit */
  width: 240px;
  /* Breite festlegen */
  margin-top: 25px;
  /* Kleiner Abstand zum Button */
  background-color: var(--background-color-section);
  border: 1px solid var(--border-color-medium);
  border-radius: var(--border-radius-small);
  box-shadow: 0 4px 12px var(--box-shadow-medium);
  z-index: 1000;
  /* Stellt sicher, dass es ï¿½ber allen anderen Elementen liegt */
  transition: all 0.3s ease;

  /* Die Klasse 'show-false' (oder eine andere "versteckt"-Klasse) steuert die Anzeige */
  display: none;
}

/* Die Logik in Ihrer JS-Datei muss 'display: block;' setzen,
   wenn der Button geklickt wird. */
#user-dropdown.show-true {
  display: block;
}

/* ---------------------------------------------------------------------- */
/* Stile fï¿½r den Dropdown-Inhalt                                          */
/* ---------------------------------------------------------------------- */

.dropdown-header {
  padding: 10px 16px;
  font-weight: 600;
  /* Hï¿½lt sich an die globalen Variablen */
  color: var(--text-color-primary);
  border-bottom: 1px solid var(--border-color-medium);
  margin-bottom: 8px;
}

.dropdown-item {
  display: block;
  margin: 10px 1px 1px 7px;
  width: 95%;
  padding: 10px 16px;
  box-sizing: border-box;
  text-align: left;
  /* Macht es wie einen Button */
  text-decoration: none;
  color: var(--white-color);
  /* Weißer Text für Button-Look */
  background-color: #5275b1;
  /* Dunkler Button-Hintergrund */
  border: none;
  border-radius: var(--border-radius-small);
  /* Runde Ecken */
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.dropdown-item:hover {
  background-color: #5998c2;
  /* Dunkler beim Hover */
  transform: scale(1.02);
  /* Leichter Hover-Effekt */
  color: var(--white-color);
  /* Text bleibt weiß */
}

#logout-btn {
  background-color: #ff9800;
  /* Orange (konstant) */
  color: var(--button-text);
  /* Weiï¿½ oder ï¿½hnliches */
  border-radius: var(--border-radius-small);
  font-weight: 700;
  margin: 10px 16px 10px 7px;
  padding: 10px 16px;
  text-align: center;
  width: auto;
  transition: background-color 0.2s ease;
}

#logout-btn:hover {
  filter: brightness(1.1);
  background-color: #b82815;
}

/* ---------------------------------- */
/* DIALOGFELD (MODAL) STYLES */
/* ---------------------------------- */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  /* Dunkler Hintergrund */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1500;
  /* Optional: Transition fï¿½r sanftes Ein-/Ausblenden */
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  /* Wichtig: Deaktiviert Klicks, wenn unsichtbar */
  overflow: hidden;
}

/* Wird per JS gesetzt, um das Modal anzuzeigen */
.dialog-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.dialog-content {
  background-color: var(--background-color-container);
  color: var(--text-color-primary);
  padding: 30px;
  /* strich */
  border-radius: 12px;
  box-shadow: 0 4px 25px var(--box-shadow-medium);
  text-align: center;
  max-width: 450px;
  width: 90%;
  transition: transform 0.3s ease-in-out;
  position: relative;
  overflow: hidden;
}

.dialog-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
  width: auto;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 10px;
}

.auth-form .form-group {
  margin-bottom: 1;
  /* Weniger Abstand im Modal */
  font-size: 1.5rem;
  width: 100%;
  text-align: left;
}

.auth-form input {
  width: 100%;
  /* WICHTIG: Soll 100% der .form-group Breite einnehmen */
  max-width: 380px;
  padding: 1rem 1rem;
  /* Hï¿½he beibehalten */
  margin-bottom: 0;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background-color: var(--card-background);
  color: var(--text-color);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 1.05rem;
}

.auth-form input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
  /* Fokus-Ring */
}

.auth-form label {
  font-size: 0.95em;
}

.link-switch {
  color: var(--button-background-primary);
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.link-switch:hover {
  color: var(--highlight-color);
  text-decoration: underline;
}

.error-message {
  color: var(--error-color);
  font-weight: bold;
  font-size: 0.9em;
  margin: 5px 0 10px 0;
  text-align: center;
}

/* Spezielles Styling fï¿½r den Schlieï¿½en-Button des Benutzer-Dialogs */
#close-user-dialog-btn {
  /* Button wird wie der Submit-Button gestylt, aber in Blau */
  background-color: #007bff;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s, transform 0.1s;

  margin-top: 10px;
  /* Abstand nach oben */
}

#close-user-dialog-btn:hover {
  color: #ff4d4d;
  /* Rot beim Hover */
  background-color: transparent;
}

/* ---------------------------------- */
/* Media Queries fÃ¼r ResponsivitÃ¤t */
/* ---------------------------------- */

/* FÃ¼r Bildschirme, die kleiner als 1200px sind (z.B. groÃŸe Tablets und Laptops) */
@media (max-width: 1200px) {
  .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 20px 20px;
  }

  .content-wrapper {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 20px;
  }

  #versicherungForm,
  #ergebnis {
    width: 100%;
    min-width: unset;
    box-sizing: border-box;
  }

  form {
    border-right: none;
    padding-right: 0;
    width: 100%;
    text-align: left;
  }

  form .form-group,
  form .form-group label {
    text-align: left;
  }

  .header-content {
    /* Hier wurde die Ausrichtung angepasst, um wieder horizontal zu sein */
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    margin-top: 0;
    /* Entfernt den unnï¿½tigen Top-Margin */
    gap: 10px;
    /* Platz zwischen Titel und Controls */
  }

  /* Damit die Controls auch mobil rechts bleiben */
  .header-controls {
    flex-shrink: 0;
  }

  .ergebnis-bereich {
    justify-content: center;
    align-items: center;
    text-align: center;
  }
}

/* FÃ¼r Bildschirme, die kleiner als 768px sind (z.B. Tablets im Hochformat und Handys) */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  #versicherungForm,
  #ergebnis {
    padding: 1.5rem;
    text-align: center;
    box-sizing: border-box;
  }

  button[type="submit"] {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  /* Anpassung der Buttons auf kleinen Bildschirmen */
  .dark-mode-toggle {
    /* Wichtig: Stellt sicher, dass auch hier die statische Positionierung gilt */
    position: static;
    width: 2.5rem;
    height: 2.5rem;
  }

  .header-content h1 {
    /* Erlaubt dem Titel, Platz einzunehmen, damit er umbricht, wenn nï¿½tig */
    flex-grow: 1;
    min-width: 0;
  }

  .dialog-content {
    padding: 20px;
    max-width: 90%;
  }
}