html[data-theme="dark"] {
  --app-bg: #502379;
  --app-content-bg: #502379;
  --app-border-color: black;
  --text-color: white;
  --text-inverse-color: #502379;
  --bar-text-color: black;
  --bar-selected-color: #FDC220;
  --bar-bg: white;
  --input-bg: #502379;
  --input-border: white;
  --input-text-color: white;
}

html[data-theme="dark"] body {
  background-color: var(--app-bg);
  color: var(--text-color);
}

html[data-theme="dark"] .landesliste-counter,
html[data-theme="dark"] .legend,
html[data-theme="dark"] .footer-links,
html[data-theme="dark"] .footer-note,
html[data-theme="dark"] #fab-menu,
html[data-theme="dark"] #find-me,
html[data-theme="dark"] #search-box,
html[data-theme="dark"] #wahlkreis-filter,
html[data-theme="dark"] .fab-section button,
html[data-theme="dark"] .leaflet-control {
  background-color: var(--app-content-bg);
  color: var(--text-color);
  border-color: var(--app-border-color);
  border: 1px solid var(--app-border-color);
}

html[data-theme="dark"]{
  --spinner-track: rgba(255,255,255,0.25);
  --spinner-scrim: rgba(0,0,0,0.38);
}

html[data-theme="dark"] input,
html[data-theme="dark"] button,
html[data-theme="dark"] select {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--input-text-color);
}

html[data-theme="dark"] ::placeholder {
  color: #ccc;
}

html[data-theme="dark"] {
  --hover-bg: rgba(255, 255, 255, 0.1);
}
html[data-theme="light"] {
  --hover-bg: rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] a {
  color: var(--bar-selected-color);
}

html[data-theme="dark"] {
  --footer-bg: rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .leaflet-bar a {
  background-color: var(--app-bg);
  color: var(--text-color);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .leaflet-bar a:hover {
  background-color: #3a1d55;
}

html[data-theme="dark"] {
  --focus-color: white;
}

html[data-theme="dark"] .desktop-feedback,
html[data-theme="dark"] .fab-feedback {
  color: #ff6b6b;
}

html[data-theme="dark"] .rotate-overlay{
  background: linear-gradient(135deg,#2f154a 0%, #3b1b5d 60%, #4b2477 100%);
  color: white;
}

body, input, select, button, .landesliste-counter, .legend, .leaflet-bar a {
  transition: background-color 0.5s ease, color 0.5s ease;
}

#darkmode-toggle {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 24px;
  z-index: 2000;
  background: none;
  border: none;
  cursor: pointer;
}

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