/* Standard (Nachtmodus) */
body {
  font-family: sans-serif;
  background-color: #121212;
  color: #e0e0e0;
  max-width: 600px;
  margin: auto;
  padding: 1em;
  transition: background-color 0.3s, color 0.3s; /* Sanfter Übergang */
}

/* Basis-Styling für Inputs und Buttons, ohne feste Breite, die Flexbox stört */
input {
  padding: 0.8em;
  font-size: 1em;
  box-sizing: border-box; /* Stellt sicher, dass Padding und Border zur Gesamtbreite gehören */
  background-color: #1e1e1e;
  color: #ffffff;
  border: 1px solid #555;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Allgemeine Button-Styles, überschrieben, wenn spezifischer */
button {
  padding: 0.8em;
  font-size: 1em;
  box-sizing: border-box;
  background-color: #2a2a2a;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Buttons mit voller Breite, die nicht im Header-Container sind */
form button[type="submit"],
#csv-button,
#del-button {
  width: 100%;
  margin-bottom: 1em;
}


/* Neuer Flex-Container für Überschrift und Themen-Button */
#header-container {
  display: flex;
  align-items: center; /* Vertikal zentrieren */
  justify-content: space-between; /* Überschrift links, Button rechts */
  margin-bottom: 1em; /* Abstand nach unten */
}

#header-container h1 {
  margin: 0; /* Standard-Margin des h1 entfernen */
}

/* Styling für den Themen-Button im Header */
#theme-toggle-button {
  width: 2.5em; /* Feste Breite und Höhe für ein quadratisches Symbol */
  height: 2.5em;
  padding: 0; /* Padding entfernen, um nur das Symbol zu zeigen */
  border-radius: 50%; /* Runde Form */
  background-color: #2a2a2a;
  color: #eee;
  display: flex; /* Flexbox für Zentrierung des Symbols */
  align-items: center;
  justify-content: center;
  font-size: 1.2em; /* Größe des Symbols anpassen */
  border: 1px solid #555;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 0; /* Wichtig, um den Abstand zu entfernen, da es im header-container ist */
}

#theme-toggle-button:hover {
  background-color: #3e3e3e;
}


/* Flex-Container für Artname und Anzahl */
.input-row {
  display: flex;
  gap: 1em; /* Abstand zwischen den Feldern */
  margin-bottom: 1em; /* Abstand unter der Zeile */
  width: 100%; /* Stellt sicher, dass die Zeile die volle Breite einnimmt */
}

/* Eingabefelder innerhalb des Flex-Containers */
.input-row input {
  margin-bottom: 0; /* Entfernt den unteren Rand von Inputs innerhalb der flex-Container */
  flex-basis: 0;
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 0;
  width: auto;
}

/* Spezifische Breitenverteilung für Artname und Anzahl */
.input-row #artname {
  flex-grow: 7; /* Nimmt 70% des verfügbaren Platzes ein (von 10 Teilen) */
}

.input-row #anzahl {
  flex-grow: 3; /* Nimmt 30% des verfügbaren Platzes ein (von 10 Teilen) */
}


button.enabled {
  color: black;
  background-color: #a5d6a7;
  border: 1px solid #388e3c;
}

button:hover.enabled {
  background-color: #81c784;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2em;
  table-layout: fixed; /* Wichtig: Ermöglicht die Festlegung von Spaltenbreiten */
}

th, td {
  border: 1px solid #444;
  padding: 0.5em;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
  text-align: left; /* Standardmäßig Text linksbündig */
  word-wrap: break-word; /* Lange Wörter umbrechen */
}

/* Spaltenbreiten anpassen */
th:nth-child(1), td:nth-child(1) { /* Nr. Spalte */
  width: 10%;
}

th:nth-child(2), td:nth-child(2) { /* Artname Spalte */
  width: 55%;
}

th:nth-child(3), td:nth-child(3) { /* Anzahl Spalte */
  width:20%;
}

th:nth-child(4), td:nth-child(4) { /* Lösch-Button Spalte */
  width: 15%;
  text-align: center; /* Lösch-Button mittig */
}


th {
  background: #333;
  color: #eee;
}

#autocomplete-list {
  font-size: 1em;
  border-radius: 6px;
  margin-top: 0.5em;
  background-color: #222;
  color: #eee;
  border: 1px solid #555;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

#autocomplete-list li {
  padding: 0.6em;
  border-bottom: 1px solid #444;
  background-color: #222;
  color: #eee;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

#autocomplete-list li:hover {
  background-color: #333;
}


/* Tagmodus */
body.light-mode {
  background-color: #ffffff;
  color: #333333;
}

body.light-mode input,
body.light-mode button {
  background-color: #f0f0f0;
  color: #333333;
  border-color: #ccc;
}

/* Spezifische Anpassungen für den Themen-Button im Light-Mode */
body.light-mode #theme-toggle-button {
  background-color: #e0e0e0;
  color: #333333;
  border-color: #ccc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.light-mode #theme-toggle-button:hover {
  background-color: #d0d0d0;
}


body.light-mode button.enabled {
  color: white;
  background-color: #66bb6a;
  border: 1px solid #4caf50;
}

body.light-mode button:hover.enabled {
  background-color: #81c784;
}

body.light-mode th,
body.light-mode td {
  border-color: #ccc;
}

body.light-mode th {
  background: #f0f0f0;
  color: #333333;
}

body.light-mode #autocomplete-list {
  background-color: #ffffff;
  color: #333333;
  border-color: #ccc;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

body.light-mode #autocomplete-list li {
  background-color: #ffffff;
  color: #333333;
  border-bottom: 1px solid #eee;
}

body.light-mode #autocomplete-list li:hover {
  background-color: #f0f0f0;
}
