
/* ===== Nimiq Validators API — LIGHT THEME ===== */

/* Palette */
:root {
  --bg: #f5f7fb;
  --fg: #0c1226;
  --muted: #617199;

  --accent: #4ecdc4;
  --accent-ink: #0c1020;

  --card: #ffffff;
  --table-border: #e4e8f2;
  --badge: #2f9e63;

  --shadow-sm: 0 2px 8px rgba(12, 16, 32, 0.08);
  --shadow-md: 0 6px 18px rgba(12, 16, 32, 0.10);

  --nimiq-gold:  #E9B213;
  --nimiq-honey: #E5A212;
  --gold-ink:    #0c1020;

  /* Ajouts */
  --nimiq-yellow:   #f8d66d;
  --nimiq-yellow-2: #f7cc53;
  --nimiq-turquoise:#27b6b0;
}

/* Typo de base */
:root { --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif; }
html, body { height: 100%; font-family: var(--font-ui); }
body.theme-light {
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
  margin: 0;
  opacity: 0;
  animation: fadeIn .35s ease forwards;
}

/* Header (compact) */
.header-3col {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: .5rem; padding: .6rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--table-border);
  box-shadow: var(--shadow-sm), 0 3px 0 rgba(233,178,19,0.12);
  position: sticky; top: 0; z-index: 10;
  border-bottom: 2px solid rgba(233,178,19,0.18);
}
.brand { display: flex; gap: 14px; align-items: center }
.logo { width: 44px; height: 44px; border-radius: 10px; background: #f0f3fb; object-fit: contain; }
.header-left .logo, .header-left img.logo { width: 40px; height: 40px; object-fit: contain; }

#validator-name { margin: 0 0 .15rem 0; line-height: 1.05; font-size: 1.35rem; }
#validator-address { margin: 0; line-height: 1.1; font-size: .9rem; color: var(--muted); }

.header-center { text-align: center; padding: 0 .5rem; overflow: hidden; }

/* Description : une seule ligne + auto-fit (JS) */
.description.one-line {
  white-space: nowrap;
  overflow: hidden;
  font-size: 16px;      /* ajustée par JS (12–18) */
  line-height: 1.25;
  color: #374151;
  font-weight: 500;
}

/* Nom du validator : une seule ligne + auto-fit (JS) */
#validator-name.one-line {
  white-space: nowrap;
  overflow: hidden;
  font-size: 1.35rem;   /* ajustée par JS (13–22) */
  line-height: 1.05;
  text-overflow: clip;
}

/* Header droit + badges */
.header-right { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; }
.header-right #pool-fee { white-space: nowrap; }
.badge { background: var(--badge); color: #fff; padding: .15rem .4rem; border-radius: .35rem; font-size: 12px; font-weight: 700; line-height: 1; transition: background .2s ease; }
.badge:hover { background: #38c77f; }

/* Availability badge levels */
.badge.availability-badge { margin-left: .35rem; }
.badge.level-high { background: #0a8; color: #fff; }
.badge.level-mid  { background: #fb3; color: #000; }
.badge.level-low  { background: #e53; color: #fff; }
.badge.level-unknown { background: #999; color: #fff; }

/* RESTAKE : turquoise + texte blanc */
#restake-badge {
  background: var(--nimiq-turquoise);
  color: #ffffff !important;
  border: 1px solid #1aa59f;
  font-weight: 700;
}

/* Main paddings */
main { padding: 20px 24px }

/* Cards / KPI — 4 colonnes */
.totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.card {
  background: var(--card);
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--table-border);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card .label { color: var(--muted); font-size: 12px }
.card .value {
  font-weight: 700;
  font-size: 20px;
  margin-top: 6px;
  color: var(--accent);
  text-shadow: 0 0 4px rgba(78,205,196,0.25);
}

/* KPI typographies */
.totals .card { display: flex; flex-direction: column; gap: .25rem; }
.totals .card .label { font-family: inherit; font-weight: 600; letter-spacing: .01em; color: #111827; }
.totals .card .value { font-family: inherit; font-weight: 600; color: #0f172a; }
.totals .card .sub   { font-family: inherit; font-weight: 600; letter-spacing: .01em; color: #374151; line-height: 1.35; }

/* Figures KPI en turquoise (option) */
.totals .card .value .fig { color: #0fb9b1; font-family: inherit; font-weight: 600; }
.totals .card .value > span:first-child { color: #0fb9b1; }

/* Disclaimer (petit) */
.card.disclaimer .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.card.disclaimer .value {
  color: var(--fg);
  font-weight: 400;
  font-size: 11px;
  line-height: 1.45;
  text-shadow: none;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--table-border);
}
thead th {
  text-align: left; color: var(--muted);
  font-weight: 600; font-size: 12px; padding: 12px;
  border-bottom: 1px solid var(--table-border);
  background: linear-gradient(180deg, rgba(233,178,19,0.12), rgba(233,178,19,0.06) 50%, transparent 100%);
}
tbody td { padding: 12px; border-bottom: 1px solid var(--table-border); font-size: 14px; }
td.num, th.num { text-align: right }
tbody tr:hover { background: rgba(233,178,19,0.08); transition: background .20s ease; }

/* Turquoise pour les nombres du tableau */
table .num { color: #0fb9b1; font-family: inherit; font-weight: 600; }
table td.num, table th.num { color: #0fb9b1; }

/* Filtrage visuel */
.table .highlight { background: #fff6cc; }
.table .muted-row { opacity:.35; }

/* Search (carte KPI rangée 3) */
#search-card .value {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}
.search-help {
  margin: .20rem 0 .35rem;
  font-size: 12px;
  color: #6b7485;
}
.search-input {
  width: 72%;
  max-width: 360px;
  min-width: 220px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  padding: .40rem .55rem;
  border: 1px solid #cfd6e6;
  border-radius: .4rem;
  background: #fff;
  margin: 0 auto;
}
/* Placeholder multi-navigateurs */
.search-input::placeholder { color:#8a93a8; opacity:1; font-size:12px; }
.search-input::-webkit-input-placeholder { color:#8a93a8; opacity:1; }
.search-input::-moz-placeholder { color:#8a93a8; opacity:1; }
.search-input:-ms-input-placeholder { color:#8a93a8; opacity:1; }
.search-input:-moz-placeholder { color:#8a93a8; opacity:1; }
/* Actions: compteur + Clear */
.search-actions {
  display:flex;
  gap:.6rem;
  align-items:center;
  justify-content:center;
  margin-top:.45rem;
}
.search-meta {
  font-size:.80rem;
  color:#6b7485;
  margin-top:.30rem;
}
/* Clear: petit bouton jaune Nimiq */
.search-clear {
  display: inline-block;
  padding: 4px 10px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--nimiq-yellow);
  color: #0a0a0a;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #d5b75b;
  user-select: none;
}
.search-clear:hover { background: var(--nimiq-yellow-2); }
.search-clear:focus { outline: 2px solid #0a0a0a; outline-offset: 2px; }

/* Fade-in */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 1024px) { .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .header-3col { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: .4rem; padding: .5rem .75rem; }
  .header-right { justify-content: center; }
  #validator-name { font-size: 1.2rem; }
  #validator-address { font-size: .85rem; }
  /* (si jamais tu réactives une version multi-lignes) */
  .header-center .description { -webkit-line-clamp: 3; }
}

/* Focus accessible */
:focus-visible { outline: 2px solid var(--nimiq-gold); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(233,178,19,0.28); }

/* Coin doré optionnel sur cartes */
.card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  background: var(--nimiq-gold);
  border-bottom-left-radius: 12px;
  border-top-right-radius: 12px;
  box-shadow: 0 1px 6px rgba(233,178,19,0.35);
}

/* (Retiré) tout style spécial pour #ratio et .stake-highlight afin que
   “Staked supply ratio” et “Share of network” soient comme les autres cartes. */

/* A11y utility */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
