/* 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;
}

.dark-mode-toggle {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--border-radius-small);
  background-color: var(--background-color-secondary);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  flex-shrink: 0;
  /* Verhindert, dass die Buttons schrumpfen */
  font-size: 1.5rem;
  padding: 0;
}

.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;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  /* ! WICHTIG: Die Variablen anwenden */
  background-color: var(--background-color-main);
  color: var(--text-color-primary);
  /* Ende des wichtigen Teils */
  min-height: 100vh;
  padding: 1.5rem 1rem;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  /* FÃ¼r einen sanften Ãœbergang */
}

.container {
  max-width: 1000px;
  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: 30px;
  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 */
}

/* --- 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>div {
  display: flex;
  /* Wichtig fÃ¼r die nebeneinander liegenden Buttons */
  align-items: center;
  gap: 0.75rem;
  /* Abstand zwischen den Steuerelementen */
}

.welcome-text {
  font-size: 1.15rem;
  /* Setzt Abstand zwischen dem Willkommenstext und der Tab-Navigation */
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  overflow-x: auto;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  /* Abstand zwischen Text und Linie */
  margin-bottom: 2rem;
  /* Abstand zwischen Linie und Inhalt */
  width: 100%;
}

.hidden-until-auth {
  display: none;
  /* Optional: FÃ¼gen Sie ein Loading-Element hinzu, um zu zeigen, dass etwas passiert */
}

.form-input,
#salutation-input-edit {
  /* FÃ¼gen Sie hier die ID des Select-Feldes hinzu */
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  /* Platz nach unten */
  border: 1px solid #5a5a75;
  /* Ein etwas hellerer Rand */
  border-radius: 8px;
  /* Abgerundete Ecken */
  background-color: #3b3a50;
  /* Dunkler Hintergrund, wie bei Ihren Textfeldern */
  color: #ffffff;
  /* 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;
}

.insurance-card {
  border: 1px solid var(--border-color-medium);
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  background-color: var(--background-color-secondary);
}

.delete-insurance-btn {
  background-color: #ff4d4f;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.delete-insurance-btn:hover {
  background-color: #e53935;
}

#logout-btn {
  /* Wichtige Korrekturen zur Positionierung und GrÃ¶ÃŸe */
  margin: 0;
  height: 2.5rem;
  background-color: #ff9800;
  color: var(--button-text);
  border-radius: 4px;
  font-weight: 700;

  /* Padding an die HÃ¶he angepasst */
  padding: 0 16px;
  /* Vertikales Padding auf 0 setzen, da die HÃ¶he gesetzt wurde */

  text-align: center;
  width: auto;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;

  /* ZusÃ¤tzliche Flex-Eigenschaften, um den Text mittig zu zentrieren, da HÃ¶he gesetzt wurde */
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* WICHTIG: Der rote Button fÃ¼r gefÃ¤hrliche Aktionen */
.btn-danger {
  padding: 0.75rem 2rem;
  font-weight: 600;
  margin-top: 20px;
  border-radius: var(--border-radius-small);
  color: var(--button-text);
  transition: all 150ms ease-in-out;
  cursor: pointer;
  border: none;
  outline: none;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  background-color: #dc3545;
  /* Helles Rot */
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
  /* Dunkleres Rot beim Hover */
}

#content-loeschen p {
  color: #dc3545;
  font-weight: 500;
  /* FETT */
  font-size: 1.2rem;
  margin: 20px 0;
  padding: 20px;

  /* Hintergrund und Rahmen fÃ¼r einen deutlichen Block */
  border: 2px solid #dc3545;
  border-radius: 6px;
  background-color: #3f2e32;
  /* Dunkler, leicht rÃ¶tlicher Hintergrund im Dark Mode */
}

#content-loeschen h2 {
  text-decoration: underline;
}

@media (min-width: 600px) {
  .container {
    padding: 2.5rem;
  }
}

header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-color-primary);
  margin-bottom: 0.25rem;
}

header p {
  color: var(--color-text-light);
  font-size: 1rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-dark);
}

/* --- 3. Tab Navigation --- */
.tab-nav {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 2rem;
  overflow-x: auto;
  gap: 0.5rem;
  padding-bottom: 0.1rem;
}

.tab-button {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-light);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 150ms ease-in-out;
  white-space: nowrap;
  /* Verhindert Zeilenumbruch */
}

.tab-button:hover {
  color: var(--color-text-dark);
}

.tab-active {
  border-bottom-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}

/* Tab Content Steuerung */
.tab-pane.hidden {
  display: none;
}

/* --- 4. VersicherungsÃ¼bersicht (Vertragskarten) not used jet --- */

.card-contract-list {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 1px solid #c7d2fe;
  background-color: var(--color-card-bg);
  border-radius: var(--radius-md);
}

.card-contract-list h3 {
  color: var(--color-primary-dark);
  margin-bottom: 1.25rem;
}

.contract-item {
  background-color: #ffffff;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  border-left: 5px solid var(--color-primary);
  /* Akzentlinie links */
  transition: box-shadow 200ms ease;
}

.contract-item:last-child {
  margin-bottom: 0;
}

.contract-item:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Desktop-Layout fÃ¼r Vertragselemente */
@media (min-width: 600px) {
  .contract-item {
    flex-direction: row;
    align-items: center;
  }
}

.font-bold {
  font-weight: 700;
  color: var(--color-text-dark);
}

.text-sm {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

.text-xs {
  font-size: 0.75rem;
}

/* RechtsbÃ¼ndiger Bereich (Preis und Status) */
.text-right {
  text-align: left;
  /* Mobile */
  margin-top: 1rem;
}

@media (min-width: 600px) {
  .text-right {
    text-align: right;
    min-width: 150px;
    margin-top: 0;
  }
}

.contract-item .price {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-success);
  margin-bottom: 0.25rem;
}

.status-badge {
  font-weight: 600;
  color: #065f46;
  background-color: #d1fae5;
  padding: 0.1rem 0.6rem;
  border-radius: 9999px;
  /* Pillenform */
  display: inline-block;
  border: 1px solid #a7f3d0;
}

/* Call-to-Action Box */
.cta-box {
  padding: 1.5rem;
  border: 1px solid var(--background-color-secondary);
  background-color: var(--background-color-secondary);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

@media (min-width: 600px) {
  .cta-box {
    flex-direction: row;
    align-items: center;
  }
}

/* --- 5. Formulare (PersÃ¶nliche Daten) --- */

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Zwei Spalten ab Medium-Breakpoint */
@media (min-width: 768px) {
  .form-row.md-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-dark);
  margin-bottom: 0.4rem;
}

input[type="name"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: var(--border-radius-small);
  transition: border-color 150ms, box-shadow 150ms;
  font-size: 1rem;
}

input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
  outline: none;
}

/* Formular Statusmeldung */
#password-error,
#modal-error {
  font-size: 0.875rem;
  color: var(--color-danger);
  margin-top: 0.5rem;
}

#status-message {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  border: 1px solid transparent;
}

#status-message.success {
  background-color: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

#status-message.error-msg {
  /* Ersatz fÃ¼r text-red-500 im HTML */
  background-color: #fee2e2;
  color: var(--color-danger);
  border-color: #fecaca;
}

/* --- 6. Buttons --- */
.btn {
  padding: 0.75rem 2rem;
  font-weight: 600;
  background-color: var(--button-background-primary);
  border-radius: var(--border-radius-small);
  color: var(--button-text);
  transition: all 150ms ease-in-out;
  cursor: pointer;
  border: none;
  outline: none;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  /* falls als Link verwendet */
}

.btn:hover {
  background-color: #2567ca;
  transform: translateY(-1px);
  box-shadow: 0 6px 10px rgba(79, 70, 229, 0.4);
}

/* Volle Breite auf Mobile, Auto auf Desktop */
.btn-full-sm-auto {
  width: 100%;
}

@media (min-width: 600px) {
  .btn-full-sm-auto {
    width: auto;
  }
}

.btn-primary {
  padding: 0.75rem 2rem;
  font-weight: 600;
  border-radius: var(--border-radius-small);
  background-color: #007bff;
  color: var(--button-text);
  transition: all 150ms ease-in-out;
  cursor: pointer;
  border: none;
  outline: none;
  display: inline-block;
  text-align: center;
}

.btn-primary:hover {
  background-color: #2567ca;
  transform: translateY(-1px);
  box-shadow: 0 6px 10px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  background-color: #0f45b3;
  /* Grauton */
  color: var(--button-text);
}

.btn-secondary:hover {
  background-color: #2567ca;
}

/* Stilisiert die Anzeige-Felder, damit sie wie Input-Felder aussehen */
.display-value {
  width: 100%;
  /* Passt das Padding an Ihre Input-Felder an */
  padding: 10px 12px;
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius-small);
  /* Wenn Sie einen Radius haben */
  box-sizing: border-box;
  background-color: var(--input-background);
  color: var(--text-color-primary);

  /* Sorgt fÃ¼r gleiche HÃ¶he wie Inputs und zentriert den Text vertikal */
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 1em;
}

/* Stellt sicher, dass die Labels ber den Inputs im Bearbeitungsmodus stehen */
.edit-mode-inputs {
  display: block;
  /* Stellt sicher, dass der Container die volle Breite nimmt */
  width: 100%;
}

/* Stellt sicher, dass die Input-Felder selbst gestylt sind */
.edit-mode-section input[type="text"],
.edit-mode-section input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius-small);
  box-sizing: border-box;
  background-color: var(--input-background);
  color: var(--text-color-primary);
  transition: all 0.2s;
}

/* Stil fr die Status-/Erfolgsmeldung */
.status-message {
  padding: 15px;
  margin-top: 20px;
  border-radius: var(--border-radius-small);
  font-weight: bold;
  text-align: center;
  transition: opacity 0.3s ease;
  /* Ermglicht ein weiches Ein-/Ausblenden */

  /* Standard/Light Mode (Erfolgsmeldung) */
  background-color: #d4edda;
  /* Light Mode grn */
  color: #155724;
  /* Light Mode Text grn */
  border: 1px solid #c3e6cb;
}

/* Dark Mode Stil fÃ¼r die Erfolgsmeldung */
.dark-mode .status-message {
  /* Beispiel fr eine dunklere, aber sichtbare Grn-/Akzentfarbe */
  background-color: #28a74550;
  /* Transparente Dark Mode Farbe */
  color: #90b8f8;
  /* Hellere Akzentfarbe, passend zu Ihrem Schema */
  border: 1px solid #218838;
}

/* Stil fÃ¼r Fehlermeldungen  */
.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.dark-mode .status-message.error {
  background-color: #dc354550;
  color: #ffb8b8;
  border-color: #a71d2a;
}

.hidden {
  display: none !important;
}