/* ============================================================
   Emilien Search — habillage sombre moderne pour SearXNG
   Injecté par nginx (sub_filter) : survit aux mises à jour de
   SearXNG, qui reste sur son thème « simple » d'origine.
   ============================================================ */

:root {
  color-scheme: dark;

  /* Palette (variables du thème « simple » de SearXNG) */
  --color-base-font: #dfe4ea;
  --color-base-background: #0f1115;
  --color-url-font: #7aa2ff;
  --color-url-visited-font: #9d8cff;
  --color-header-background: #0f1115;
  --color-header-font: #dfe4ea;
  --color-footer-background: #0f1115;
  --color-footer-font: #6b7280;
  --color-btn-background: #4f8cff;
  --color-btn-font: #ffffff;
  --color-result-border: #232833;
  --color-result-url-font: #7aa2ff;
  --color-result-description-font: #b7bfc9;
  --color-result-title-font: #f2f4f8;
  --color-result-title-visited-font: #c9b8ff;
  --color-result-link-visited-font: #c9b8ff;
  --color-result-link-font: #7aa2ff;
  --color-search-border: #2a303c;
  --color-search-background: #171b22;
  --color-search-background-hover: #1d2230;
  --color-search-font: #dfe4ea;
  --color-categories-item-selected-font: #4f8cff;
  --color-categories-item-border-selected: #4f8cff;
  --color-answer-border: #2a303c;
  --color-answer-background: #171b22;
  --color-sidebar-border: #232833;
  --color-sidebar-background: #0f1115;
  --color-settings-border: #232833;
  --color-error-background: #2a1518;
  --color-error-font: #ff8f96;
  --color-warning-border: #4a3a12;
  --color-warning-background: #241d0d;
  --color-warning-font: #ffd479;

  /* Police */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

html, body {
  background: #0f1115 !important;
  color: #dfe4ea !important;
  font-family: var(--font) !important;
}

/* Liens génériques */
a { color: #7aa2ff; }
a:visited { color: #9d8cff; }

/* ---- En-tête : centre la barre, supprime le bruit visuel ---- */
#search_header {
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}
#search_view {
  justify-content: center !important;
}
#q, #search-input, input#q {
  background: #171b22 !important;
  border: 1px solid #2a303c !important;
  border-radius: 14px !important;
  color: #dfe4ea !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .35) !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#q:focus, #search-input:focus, input#q:focus {
  border-color: #4f8cff !important;
  box-shadow: 0 4px 28px rgba(79, 140, 255, .25) !important;
  outline: none !important;
}
#search_logo, .search_logo img, #logo img {
  filter: drop-shadow(0 2px 10px rgba(79, 140, 255, .35));
}

/* Bouton de recherche */
button[type="submit"], .btn, input[type="submit"] {
  background: #4f8cff !important;
  color: #fff !important;
  border-radius: 12px !important;
  border: 0 !important;
  font-weight: 600;
  transition: filter .15s ease;
}
button[type="submit"]:hover, .btn:hover, input[type="submit"]:hover {
  filter: brightness(1.12);
}

/* ---- Catégories (Général, Images, …) : pilules discrètes ---- */
#categories, .categories, #main-menu, .main-menu {
  justify-content: center !important;
}
.category a, .category label, #categories a {
  border-radius: 999px !important;
  padding: .35rem .9rem !important;
  color: #8a919c !important;
  transition: color .15s ease, background .15s ease;
}
.category a:hover, .category label:hover {
  background: #1a1f29 !important;
  color: #dfe4ea !important;
}
.category.selected a, .category input:checked + label {
  background: rgba(79, 140, 255, .12) !important;
  color: #7aa2ff !important;
  border-color: transparent !important;
}

/* ---- Résultats : cartes arrondies, aérées, hover net ---- */
.result {
  background: #141821 !important;
  border: 1px solid #232833 !important;
  border-radius: 14px !important;
  padding: 14px 18px !important;
  margin: 0 0 14px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: border-color .15s ease, transform .15s ease;
}
.result:hover {
  border-color: #33405a !important;
  transform: translateY(-1px);
}
.result h3, .result .title {
  font-size: 1.06rem !important;
  font-weight: 600 !important;
  letter-spacing: .01em;
}
.result .url_wrapper, .result cite, .result .url {
  color: #6e7d94 !important;
  font-size: .82rem !important;
}
.result .content, .result p {
  color: #b7bfc9 !important;
  line-height: 1.55 !important;
}

/* ---- Colonne latérale (infobox Wikipédia…) ---- */
#sidebar, aside#sidebar {
  background: #141821 !important;
  border: 1px solid #232833 !important;
  border-radius: 14px !important;
  padding: 16px !important;
}

/* ---- Pied de page et logo « powered by » : hors ---- */
footer, #footer, #end_splits, .searxng-footer-bottom {
  display: none !important;
}

/* ---- Préférences : mêmes cartes ---- */
#main_preferences fieldset, #main_preferences .preferences_back {
  background: #141821 !important;
  border: 1px solid #232833 !important;
  border-radius: 14px !important;
}

/* ---- Éléments divers ---- */
#answers, .answer {
  background: #141821 !important;
  border: 1px solid #2a303c !important;
  border-radius: 14px !important;
}
.highlight .hll, mark {
  background: rgba(79, 140, 255, .22) !important;
  color: #eaf1ff !important;
  border-radius: 4px;
}
::selection { background: rgba(79, 140, 255, .35); }

/* Largeur de lecture un peu plus confortable */
#main_results, #results, .result-container {
  max-width: 52rem !important;
  margin-inline: auto !important;
}

/* Défilement discret */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #232833; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
