body {
  margin: 0;
  font-family: verdana, Arial, sans-serif;
  background-color: #fff;
  color: #000;
  transition: background-color 0.3s, color 0.3s;
}

a:link,
a:visited {
  color: cornflowerblue;
  text-decoration: none;
}

a:hover,
a:active {
  color: #000;
}

/* Navigation Styles */
.navbar {
  background-color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.navbar .title {
  color: white;
  font-size: 20px;
  font-weight: bold;
}

.navbar .menu {
  display: flex;
  gap: 20px;
  margin-right: 2em;
}

.navbar a {
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  text-align: center;
}

.navbar a:hover {
  background-color: #575757;
  border-radius: 5px;
}

.hint {
  margin: 60px 25px 0 25px;
  background-color: #eee;
  border-radius: 7px;
  border: 1px solid #ccc;
  padding: 20px;
}

.hint ol li {
  display: inline;
}

/* Dialog Styles */
dialog {
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 20px;
  max-width: 50%;
  max-height: 80%;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.dialog-header {
  font-size: 18px;
  margin-bottom: 10px;
}

.dialog-content {
  margin-bottom: 20px;
  line-height: 1.5;
}

.dialog-content h2 {
  font-size: 1.4em;
  font-weight: normal;
  border-top: 1px dotted #ddd;
  padding: 15px 0 0 0;
}

.dialog-content h2:first-child {
  border-top: 0px solid #ddd;
  padding: 0;
}

.dialog-content h3 {
  font-size: 1.1em;
  font-weight: normal;
}

.dialog-footer {
  text-align: right;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.close-button {
  background-color: #007bff;
  color: #fff;
}

#wrapper {
  max-width: 100%;
  margin: 20px auto;
  padding: 20px 0px;
}

h1 {
  text-align: center;
}

#searchEngineGroups {
  display: flex;
  flex-wrap: wrap;
  align-content: stretch;
  align-items: stretch;
  margin-top: 10px;
}

#searchEngineGroups h2 {
  font-weight: normal;
  border-bottom: 1px solid #ddd;
}

button,
.button {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover,
.button:hover {
  background-color: #000;
}

form {
  width: auto;
  max-width: 100%;
  margin: 20px auto;
  padding: 10px;
  border-radius: 10px;
}

#btn {
  width: 100%;
  margin: 20px;
  text-align: center;
}

#search-container {
  display: flex;
  align-items: center;
  margin-top: 20px;
  padding: 0 10px;
}

#search-container input[type="text"] {
  height: 40px;
  padding: 0 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 7px 0 0 7px;
  outline: none;
  flex-grow: 1;
}

#search-container button.go {
  height: 42px;
  padding: 0 20px;
  font-size: 16px;
  color: white;
  background-color: #007bff;
  border: 1px solid #007bff;
  border-radius: 0 7px 7px 0;
  cursor: pointer;
}

#search-container button.go:hover {
  background-color: #0056b3;
}

label {
  display: inline-flex;
  align-items: center;
  padding: 10px;
  margin: 5px;
  background: #efefef;
  border: 0px solid #ccc;
  border-radius: 5px;
  transition: background-color 0.1s, border-color 0.1s;
  font-size: 0.9em;
  user-select: none;
  cursor: pointer;
}

label:has(input[type="checkbox"]:hover) {
  background-color: rgba(0, 123, 255, 0.2);
}

label input[type="checkbox"] {
  display: none;
}

label:has(input[type="checkbox"]:checked) {
  background-color: rgba(0, 123, 255, 0.4);
}

label.nobutton {
  display: inline !important;
  padding: 0px !important;
  margin: 0px !important;
  background: transparent !important;
  border: 0 !important;
  font-size: 1em;
}

input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #cccccc;
  border-radius: 5px;
  background-color: #f9f9f9;
  transition: border-color 0.3s;
  font-size: 1.2em;
}

input[type="text"]:focus {
  border-color: #007bff;
  outline: none;
}

input[type="checkbox"]:focus {
  border-color: #007bff;
}

fieldset {
  border: 1px solid #cccccc;
  border-radius: 5px;
  padding: 10px;
  margin: 10px;
  width: auto;
  flex-grow: 1;
  flex-basis: 25%;
  justify-content: space-evenly;
}

legend {
  font-weight: bold;
  padding: 0 10px;
}

img {
  vertical-align: middle;
  margin-right: 5px;
}

.favicon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin: 0 5px;
}

.bookmarklet {
  background: #eee;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

a.bookmarklet {
  text-decoration: none;
}

.paid {
  color: red;
  margin-left: 5px;
}

pre {
  background: #efefef;
  border: 1px inset #ddd;
  border-radius: 7px;
  padding: 10px;
  overflow: auto;
  font-family: "Lucida Console", Monaco, "Nimbus Mono L", monospace;
  color: #457607;
}

.save-selection {
  margin: 10px 0;
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.save-selection input[type="checkbox"] {
  transform: scale(1.2);
  cursor: pointer;
}

.save-selection input[type="checkbox"]:checked {
  background-color: #eef; /* leichtes Blau */
  outline: 2px solid #88f; /* dezente blaue Umrandung */
  border-radius: 3px;
}

.footer {
  width: 100%;
  display: flex;
  margin: 0;
  padding: 0;
}
.footer-left {
  float: left;
  flex-grow: 1;
  margin-left: 10px;
}
.footer-right {
  flex-grow: 1;
  text-align: right;
  margin-right: 10px;
}

@media (max-width: 768px) {
  dialog {
    max-width: 95%;
    max-height: 98%;
  }

  .footer {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
  }

  .footer-left {
    width: 100%;
  }
  .footer-right {
    flex-grow: 1;
    text-align: left;
    margin-left: 10px;
    margin-top: 10px;
    width: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #151515;
    color: #e0e0e0;
  }

  a:hover,
  a:active {
    color: #e0e0e0;
  }

  .hint {
    background: #3c3c3c;
    border: 1px solid #606060;
  }

  dialog {
    background: #3c3c3c;
    color: #e0e0e0;
  }

  dialog pre {
    background: #8c8c8c;
    color: #d2eeaf;
  }

  a.bookmarklet:link {
    background: #8c8c8c;
    color: #e0e0e0;
  }

  #search-container input[type="text"] {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #606060;
  }

  fieldset {
    border: 1px solid #3c3c3c;
  }

  label {
    background: #333;
  }

  label:has(input[type="checkbox"]:checked) {
    background-color: #114884;
  }
  label:has(input[type="checkbox"]:hover) {
  }

  .info-icon {
    color: #b3a366;
  }
}
