/* EruSearch — Irrenhaus branding overlay for simple theme */

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  background-color: #0a1424;
}

/* Full-page circuit image — original colors (no brightness wash) */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #0a1424;
  background-image: image-set(
    url("../img/background.webp") type("image/webp"),
    url("../img/background.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* Only the image layer — UI overlays/panels unchanged */
  filter: brightness(0.78) saturate(0.95);
}

/* Dark overlay on circuit bg — original tone (not washed out) */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(8, 14, 28, 0.82) 0%,
    rgba(8, 14, 28, 0.88) 45%,
    rgba(8, 14, 28, 0.92) 100%
  );
}

body {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  background: transparent !important;
}

main,
#main_results,
#main_index {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
  background: transparent !important;
}

.page_with_header .logo {
  max-height: 72px;
  width: auto;
  height: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.45));
}

/* —— Startseite: zentriert ohne unnötiges Scrollen —— */
body.index_endpoint {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.index_endpoint #main_index {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 0 !important;
  min-height: 0;
  padding: 1.25rem 1rem;
  box-sizing: border-box;
}

body.index_endpoint footer {
  flex: 0 0 auto;
  padding: 0.5rem 1rem 0.85rem;
  line-height: 1.35;
}

body.index_endpoint .index {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}

body.index_endpoint .erusearch-home {
  width: min(100%, 34rem);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1.1rem;
  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(12, 24, 42, 0.82) 0%,
    rgba(10, 20, 36, 0.9) 55%,
    rgba(8, 16, 30, 0.94) 100%
  );
  border: 1px solid rgba(72, 160, 190, 0.22);
  box-shadow:
    0 16px 56px rgba(0, 0, 0, 0.5),
    0 0 64px rgba(40, 140, 170, 0.08);
  backdrop-filter: blur(14px);
}

body.index_endpoint .erusearch-home__brand {
  margin: 0;
  padding: 0 0 0.25rem;
}

body.index_endpoint .erusearch-home__brand-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

body.index_endpoint .erusearch-home__mascot-ring {
  display: block;
  width: clamp(88px, 20vw, 112px);
  height: clamp(88px, 20vw, 112px);
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(90, 200, 220, 0.28),
    0 8px 28px rgba(0, 0, 0, 0.45);
}

body.index_endpoint .erusearch-home__mascot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

body.index_endpoint .erusearch-home__name {
  font-size: clamp(1.65rem, 5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: #e8f4fc;
  text-shadow: 0 0 28px rgba(64, 190, 220, 0.35);
}

body.index_endpoint .erusearch-home__search {
  width: 100%;
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(72, 160, 190, 0.14);
}

body.index_endpoint #search {
  width: 100%;
  margin: 0;
}

body.index_endpoint #search_header {
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

body.index_endpoint #search_header::before {
  content: none;
}

body.index_endpoint #search_view {
  width: 100%;
}

body.index_endpoint .search_box {
  width: 100%;
  background: rgba(6, 14, 26, 0.65);
  border: 1px solid rgba(90, 190, 210, 0.28);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.index_endpoint #q {
  background: transparent;
}

/* —— Ergebnisse: keine horizontale Seiten-Scrollleiste —— */
body.results_endpoint #search,
body.index_endpoint #search {
  position: relative;
  z-index: 300;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.results_endpoint #search_header {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.results_endpoint #categories {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

body.results_endpoint #categories_container {
  max-width: none;
}

body.results_endpoint .autocomplete {
  width: 100% !important;
  max-width: min(44rem, calc(100vw - 2rem)) !important;
  box-sizing: border-box;
}

body.results_endpoint #results {
  max-width: 100%;
  box-sizing: border-box;
}

body.results_endpoint #urls,
body.results_endpoint #sidebar {
  max-width: 100%;
  box-sizing: border-box;
}

html.center-alignment-no body.results_endpoint #urls {
  margin-left: 0 !important;
}

body.results_endpoint #search_header,
body.index_endpoint #search_header {
  position: relative;
  z-index: 310;
  overflow: visible;
}

body.results_endpoint #search_view,
body.results_endpoint .search_box,
body.index_endpoint #search_view,
body.index_endpoint .search_box {
  position: relative;
  overflow: visible;
}

body.results_endpoint .search_filters {
  position: relative;
  z-index: 1;
  margin-left: 0 !important;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  background: rgba(10, 18, 32, 0.55);
  border: 1px solid rgba(72, 160, 190, 0.16);
}

body.results_endpoint .search_filters select {
  background-color: rgba(8, 16, 28, 0.9) !important;
  color: #e8f4fc;
  border: 1px solid rgba(72, 160, 190, 0.35);
  border-radius: 8px;
  padding: 0.4rem 1.75rem 0.4rem 0.65rem;
  margin-right: 0.35rem;
  font-size: 0.9rem;
}

body.results_endpoint .search_filters select:focus {
  border-color: rgba(90, 200, 220, 0.55);
  outline: none;
  box-shadow: 0 0 0 2px rgba(64, 190, 220, 0.2);
}

/* Über / Einstellungen: über Suchleiste, unter Autocomplete */
body.results_endpoint #links_on_top,
body.index_endpoint #links_on_top {
  z-index: 500;
}

body.results_endpoint .autocomplete.open,
body.index_endpoint .autocomplete.open {
  z-index: 10000 !important;
}

body.results_endpoint #search_header {
  background: rgba(12, 22, 40, 0.88);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(72, 160, 190, 0.12);
}

body.results_endpoint #results {
  position: relative;
  z-index: 1;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

body.results_endpoint #results::before {
  content: none;
}

/* Lesbare Kachel nur für die Ergebnisliste */
body.results_endpoint #urls {
  background-color: rgba(10, 18, 32, 0.88) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(72, 160, 190, 0.18);
  border-radius: 12px;
  padding: 0.75rem 1rem 1.25rem !important;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.45);
}

body.results_endpoint #urls article.result {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding-left: 0;
  padding-right: 0;
}

/* Sidebar: gleiche Kachel wie die Suchergebnisse */
body.results_endpoint #sidebar {
  background-color: rgba(10, 18, 32, 0.88) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(72, 160, 190, 0.18);
  border-radius: 12px;
  padding: 0.75rem 1rem 1.25rem !important;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.45);
  margin-right: 0;
}

body.results_endpoint {
  --color-sidebar-background: transparent;
  --color-sidebar-border: rgba(72, 160, 190, 0.18);
  --color-sidebar-font: #e8f4fc;
  --color-answer-background: rgba(8, 16, 28, 0.5);
  --color-answer-font: #c8dce8;
}

/* Wikipedia-Antwort (graues Kästchen „More at Wikipedia“) — nicht die Sidebar-Infobox */
body.results_endpoint #answers {
  background-color: rgba(8, 16, 28, 0.5) !important;
  border: 1px solid rgba(72, 160, 190, 0.16) !important;
  border-radius: 10px;
  color: #c8dce8 !important;
  padding: 0.75rem 1rem !important;
  margin: 0 0 0.75rem !important;
  box-shadow: none !important;
}

body.results_endpoint #answers span {
  color: #b8ccd8 !important;
  line-height: 1.45;
}

body.results_endpoint #answers .answer-url {
  color: #5ac8dc !important;
  text-decoration: none;
}

body.results_endpoint #answers .answer-url:hover {
  color: #8ee8f8 !important;
  text-decoration: underline;
}

/* Gleicher Wikipedia-Text schon in „Information“ → Antworten ausblenden */
body.results_endpoint #results:has(#infoboxes .infobox) #answers {
  display: none !important;
}

body.results_endpoint #infoboxes,
body.results_endpoint #infoboxes details,
body.results_endpoint #sidebar details,
body.results_endpoint #suggestions,
body.results_endpoint #corrections,
body.results_endpoint #apis,
body.results_endpoint #engines_msg {
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

body.results_endpoint #sidebar details > summary.title,
body.results_endpoint #infoboxes details > summary.title,
body.results_endpoint #suggestions summary.title,
body.results_endpoint #engines_msg summary.title {
  color: #e8f4fc !important;
}

/* Infobox: Theme-Grau (#292c34) durch EruSearch-Palette ersetzen */
body.results_endpoint #sidebar .infobox,
body.results_endpoint #infoboxes .infobox {
  background-color: rgba(8, 16, 28, 0.5) !important;
  border: 1px solid rgba(72, 160, 190, 0.16) !important;
  border-radius: 10px;
  color: #c8dce8 !important;
  margin: 0.65rem 0 0 !important;
  padding: 0.85rem 1rem !important;
}

body.results_endpoint #sidebar .infobox h2,
body.results_endpoint #sidebar .infobox h2.title,
body.results_endpoint #infoboxes .infobox h2 {
  color: #e8f4fc !important;
  font-size: 1.05rem;
  font-weight: 600;
}

body.results_endpoint #sidebar .infobox p,
body.results_endpoint #sidebar .infobox dt,
body.results_endpoint #sidebar .infobox dd,
body.results_endpoint #sidebar .infobox li {
  color: #b8ccd8 !important;
}

body.results_endpoint #sidebar .infobox a,
body.results_endpoint #sidebar .infobox .url a {
  color: #5ac8dc !important;
  text-decoration: none;
}

body.results_endpoint #sidebar .infobox a:hover,
body.results_endpoint #sidebar .infobox .url a:hover {
  color: #8ee8f8 !important;
  text-decoration: underline;
}

body.results_endpoint #sidebar .infobox p *,
body.results_endpoint #sidebar .infobox div * {
  background-color: transparent !important;
  color: inherit !important;
}

body.results_endpoint #sidebar .infobox img {
  border-radius: 8px;
  border: 1px solid rgba(72, 160, 190, 0.12);
}

body.results_endpoint #sidebar .infobox input[type="submit"],
body.results_endpoint #sidebar .relatedTopics input[type="submit"] {
  background-color: rgba(8, 16, 28, 0.9) !important;
  color: #5ac8dc !important;
  border: 1px solid rgba(72, 160, 190, 0.25) !important;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

body.results_endpoint #sidebar .infobox input[type="submit"]:hover,
body.results_endpoint #sidebar .relatedTopics input[type="submit"]:hover {
  border-color: rgba(90, 200, 220, 0.45) !important;
  color: #8ee8f8 !important;
}

body.results_endpoint #sidebar-end-collapsible {
  border-bottom-color: rgba(72, 160, 190, 0.14) !important;
}

/* —— Einstellungen: gleiche Kachel wie Suchergebnisse —— */
body.preferences_endpoint #main_preferences {
  padding: 0 1rem 2rem;
}

body.preferences_endpoint #main_preferences #search_form {
  background-color: rgba(10, 18, 32, 0.88) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(72, 160, 190, 0.18);
  border-radius: 12px;
  padding: 1rem 1.25rem 1.5rem !important;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

body.preferences_endpoint #main_preferences fieldset {
  background: transparent !important;
  border: none !important;
}

body.preferences_endpoint #main_preferences .pref-group,
body.preferences_endpoint #main_preferences .pref-group th {
  background: transparent !important;
  color: #e8f4fc;
  font-weight: 600;
  text-align: left;
  width: 100%;
  padding: 0.85rem 0 0.4rem;
  margin: 0.35rem 0 0;
  border-bottom: 1px solid rgba(72, 160, 190, 0.2);
}

body.preferences_endpoint #main_preferences legend {
  background: transparent !important;
  color: #e8f4fc;
  font-weight: 600;
  float: none !important;
  width: 100% !important;
  max-width: none;
  display: block;
  margin: 0.85rem 0 0.5rem;
  padding: 0 0 0.35rem;
  border-bottom: 1px solid rgba(72, 160, 190, 0.15);
}

body.preferences_endpoint #main_preferences table.table_engines th,
body.preferences_endpoint #main_preferences table.cookies th {
  background: rgba(8, 16, 28, 0.55) !important;
}

body.preferences_endpoint #main_preferences .tabs {
  border-bottom-color: rgba(72, 160, 190, 0.2);
}

body.preferences_endpoint #main_preferences .tabs > section {
  border-top-color: rgba(72, 160, 190, 0.15);
}

footer {
  background: transparent;
}
