/* New Horizon — dark mode (html[data-theme="dark"]) */

html[data-theme='dark'] {
  background-color: #0e1218;
  background-image:
    linear-gradient(180deg, rgba(8, 12, 18, 0.72), rgba(8, 12, 18, 0.55)),
    url(../img/bgTop.jpg),
    url(../img/bgFooter.jpg);
  background-position: center top, center top, center bottom;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: cover, 100%, 100%;
}

html[data-theme='dark'] body {
  color: #e6ebf2;
  background-color: transparent;
}

html[data-theme='dark'] #wrapper {
  background: transparent;
}

html[data-theme='dark'] .container {
  background: #1a2230;
  color: #e6ebf2;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] .container::after {
  filter: brightness(0.45) saturate(0.7);
}

html[data-theme='dark'] #top {
  background-color: rgba(8, 12, 18, 0.35);
}

/* Horloge serveur locale (remplace l’iframe timeanddate) */
.nh-server-clock {
  display: inline-block;
  min-width: 72px;
  line-height: 31px;
  font-family: gadugib, Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff !important;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] .nh-server-clock {
  color: #fff !important;
}

html[data-theme='dark'] a,
html[data-theme='dark'] a:hover,
html[data-theme='dark'] .action a,
html[data-theme='dark'] .action span.anchor,
html[data-theme='dark'] .toggler a,
html[data-theme='dark'] .sortable,
html[data-theme='dark'] .sortable:hover {
  color: #9ec1ef;
}

html[data-theme='dark'] h2,
html[data-theme='dark'] h3,
html[data-theme='dark'] .mHeading {
  color: #f0f4fa;
  text-shadow: none;
  border-color: #3a4a60;
}

html[data-theme='dark'] p,
html[data-theme='dark'] td,
html[data-theme='dark'] th,
html[data-theme='dark'] li {
  color: #e6ebf2;
}

html[data-theme='dark'] .content,
html[data-theme='dark'] .message {
  color: #e6ebf2;
}

/* Light : labels toujours lisibles sur fond gris clair (DB monstre/item) */
.search-column label,
.search-form-column label,
.form-group label,
.search-form label,
.search-form2 label {
  color: #1a2230;
}

/* Dark : contraste forcé (évite fond clair inline + texte clair) */
html[data-theme='dark'] label,
html[data-theme='dark'] .form-group label,
html[data-theme='dark'] .search-form-column label,
html[data-theme='dark'] .search-form label,
html[data-theme='dark'] .search-form2 label,
html[data-theme='dark'] .generic-form-table th label,
html[data-theme='dark'] .generic-form-table label {
  color: #e8eef8 !important;
}

html[data-theme='dark'] .search-column,
html[data-theme='dark'] #itemSearchFilters,
html[data-theme='dark'] .search-container > .search-column {
  background: #1e2838 !important;
  color: #e6ebf2 !important;
  border: 1px solid #3a4a60;
}

html[data-theme='dark'] .search-column h3,
html[data-theme='dark'] #itemSearchFilters h3 {
  color: #f0f4fa !important;
}

html[data-theme='dark'] .message {
  background: #243044;
  border-color: #3d5270;
}

/* Tables */
html[data-theme='dark'] table,
html[data-theme='dark'] .horizontal-table,
html[data-theme='dark'] .vertical-table,
html[data-theme='dark'] .generic-form-table {
  color: #e6ebf2;
}

html[data-theme='dark'] .horizontal-table th,
html[data-theme='dark'] .vertical-table th,
html[data-theme='dark'] .generic-form-table th,
html[data-theme='dark'] table th {
  background: #243044 !important;
  color: #d7e3f5 !important;
  border-color: #3a4a60 !important;
}

html[data-theme='dark'] .horizontal-table td,
html[data-theme='dark'] .vertical-table td,
html[data-theme='dark'] .generic-form-table td,
html[data-theme='dark'] table td {
  background: #1e2838 !important;
  color: #e6ebf2 !important;
  border-color: #334155 !important;
}

html[data-theme='dark'] .horizontal-table tr:nth-child(even) td,
html[data-theme='dark'] table tr:nth-child(even) td {
  background: #222d3f !important;
}

html[data-theme='dark'] .horizontal-table tr:hover td,
html[data-theme='dark'] table tr:hover td {
  background: #2a3850 !important;
}

/* Forms */
html[data-theme='dark'] input[type='text'],
html[data-theme='dark'] input[type='password'],
html[data-theme='dark'] input[type='number'],
html[data-theme='dark'] input[type='email'],
html[data-theme='dark'] input[type='search'],
html[data-theme='dark'] input[type='url'],
html[data-theme='dark'] textarea,
html[data-theme='dark'] select {
  background: #121821 !important;
  color: #e6ebf2 !important;
  border: 1px solid #3a4a60 !important;
}

html[data-theme='dark'] input::placeholder,
html[data-theme='dark'] textarea::placeholder {
  color: #8a97ab;
}

html[data-theme='dark'] .generic-form button[type='submit'],
html[data-theme='dark'] .generic-form input[type='submit'],
html[data-theme='dark'] button,
html[data-theme='dark'] .btn {
  background: #3a6eb0;
  color: #fff;
  border-color: #4a7fc4;
}

html[data-theme='dark'] button:hover,
html[data-theme='dark'] .btn:hover {
  background: #4a7fc4;
}

/* Cards / panels / news */
html[data-theme='dark'] .OneNews,
html[data-theme='dark'] .newsItem,
html[data-theme='dark'] .newsCont,
html[data-theme='dark'] .loginBox,
html[data-theme='dark'] .indexBBox,
html[data-theme='dark'] .indexBBoxInfos,
html[data-theme='dark'] .tab,
html[data-theme='dark'] .search-form,
html[data-theme='dark'] .search-form2 {
  background: #1e2838 !important;
  color: #e6ebf2 !important;
  border-color: #3a4a60 !important;
  box-shadow: none;
}

/* Panneau donation (menu) — fond clair d’origine → texte illisible en dark */
html[data-theme='dark'] .donateSupport {
  background:
    linear-gradient(180deg, rgba(51, 101, 166, 0.22) 0%, rgba(30, 40, 56, 0.98) 42%),
    #1e2838 !important;
  border-color: #3a4a60 !important;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
  color: #e8eef8;
}

html[data-theme='dark'] .donateSupport p,
html[data-theme='dark'] .donateSupportBody p {
  color: #e8eef8 !important;
}

html[data-theme='dark'] .donateSupportBtn {
  background: #3a6eb0;
  color: #fff !important;
}

html[data-theme='dark'] .donateSupportBtn:hover {
  background: #4a7fc4;
  color: #fff !important;
}

html[data-theme='dark'] .newsTitle,
html[data-theme='dark'] .newsAccordion-summary,
html[data-theme='dark'] .newsAccordion-title {
  color: #f0f4fa !important;
}

html[data-theme='dark'] .newsAccordion-meta,
html[data-theme='dark'] .copyright,
html[data-theme='dark'] .footerNav li a {
  color: #a8b4c6 !important;
  border-color: #5a6a80;
}

html[data-theme='dark'] .footerNav li a:hover {
  color: #fff !important;
}

html[data-theme='dark'] #footer {
  color: #c5d0e0;
}

/* Nav / menus */
html[data-theme='dark'] .quickLinks li a,
html[data-theme='dark'] .sub-menu a,
html[data-theme='dark'] .page-menu a,
html[data-theme='dark'] #adminmenu a,
html[data-theme='dark'] #pagemenu a,
html[data-theme='dark'] #submenu a {
  color: #c5d4ea !important;
}

html[data-theme='dark'] .tab > ul > li a {
  color: #b8c6da;
}

html[data-theme='dark'] .tab > ul > li a.active {
  color: #fff;
  background: #3365a6;
}

/* Unitip / tooltips */
html[data-theme='dark'] #unitip,
html[data-theme='dark'] .unitip {
  background: #1a2230 !important;
  color: #e6ebf2 !important;
  border-color: #4a5a70 !important;
}

/* Pagination */
html[data-theme='dark'] .pages .current-page,
html[data-theme='dark'] .pages a {
  background: #243044;
  color: #d7e3f5;
  border-color: #3a4a60;
}

html[data-theme='dark'] .pages .current-page {
  background: #3365a6;
  color: #fff;
}

/* Theme switcher (footer) */
.nh-theme-switch {
  clear: both;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 18px 4px 8px;
  font-size: 12px;
  color: #787777;
}

html[data-theme='dark'] .nh-theme-switch {
  color: #a8b4c6;
}

.nh-theme-switch label {
  font-family: gadugib, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nh-theme-switch select {
  min-width: 120px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #b9b9b9;
  background: #fff;
  color: #333;
  font-size: 12px;
  cursor: pointer;
}

html[data-theme='dark'] .nh-theme-switch select {
  background: #121821 !important;
  color: #e6ebf2 !important;
  border-color: #3a4a60 !important;
}

/* Simulateur (dans le container FluxCP) */
html[data-theme='dark'] .simulateur-page {
  color: #e6ebf2;
}

html[data-theme='dark'] .simulateur-loading {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme='dark'] .sim-panel {
  background: rgba(24, 32, 46, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e6ebf2;
}

html[data-theme='dark'] .sim-panel h3 {
  color: #f0f4fa;
  border-color: #3a4a60;
}

html[data-theme='dark'] .sim-panel input[type='number'],
html[data-theme='dark'] .sim-panel select,
html[data-theme='dark'] .sim-panel input[type='search'],
html[data-theme='dark'] .sim-panel input[type='text'] {
  background: #121821 !important;
  color: #e6ebf2 !important;
  border-color: #3a4a60 !important;
}

html[data-theme='dark'] .sim-derived div,
html[data-theme='dark'] .sim-resist-table div {
  background: rgba(120, 160, 220, 0.12);
}

html[data-theme='dark'] .sim-eq-slot {
  background: rgba(18, 24, 34, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e6ebf2;
}

html[data-theme='dark'] .sim-eq-slot:hover {
  border-color: #6a90c4;
}

html[data-theme='dark'] .sim-eq-icon {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

html[data-theme='dark'] .sim-eq-icon.is-linked {
  background: rgba(120, 160, 220, 0.15);
  border-color: rgba(140, 180, 230, 0.35);
}

html[data-theme='dark'] .sim-eq-empty {
  color: rgba(200, 210, 230, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme='dark'] .sim-modal-backdrop {
  background: rgba(6, 10, 16, 0.72);
}

html[data-theme='dark'] .sim-modal {
  background: #1a2230;
  color: #e6ebf2;
  border-color: #3a4a60;
}

html[data-theme='dark'] .sim-modal-tab {
  color: #a8b4c6;
}

html[data-theme='dark'] .sim-modal-tab.is-active {
  background: #243044;
  color: #fff;
  border-color: #3a4a60;
}

html[data-theme='dark'] .sim-modal-item {
  background: #121821;
  border-color: #334155;
  color: #e6ebf2;
}

html[data-theme='dark'] .sim-modal-item.is-active,
html[data-theme='dark'] .sim-modal-item:hover {
  border-color: #6a90c4;
  background: #243044;
}

html[data-theme='dark'] .sim-scenario-btn,
html[data-theme='dark'] .sim-buff-chip {
  background: #243044;
  color: #e6ebf2;
  border-color: #3a4a60;
}

html[data-theme='dark'] .sim-buff-chip.is-on,
html[data-theme='dark'] .sim-scenario-btn.is-active {
  background: #3365a6;
  border-color: #4a7fc4;
  color: #fff;
}

html[data-theme='dark'] .sim-active-effects {
  background: rgba(18, 24, 34, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e6ebf2;
}

html[data-theme='dark'] .sim-fx-head {
  background: rgba(120, 160, 220, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme='dark'] .sim-fx-count {
  background: rgba(120, 160, 220, 0.22);
  color: #e8eef8;
}

html[data-theme='dark'] .sim-fx-totals li {
  background: rgba(120, 160, 220, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
}
