/* AKDB — encyclopédie sombre type Wowhead/GitHub : surfaces plates, bordures fines, accent or unique. */

:root {
  --bg: #0f1116;
  --surface: #171b22;
  --surface-2: #1d222b;
  --surface-deep: #12151c;
  --border: #2a313d;
  --border-soft: #222834;
  --text: #e8ebf0;
  --muted: #8d96a5;
  --gold: #c99b47;
  --gold-soft: #ddb662;
  --r0: #b9c0cc;  /* Commun */
  --r1: #8f99a6;  /* Gris (nom client inconnu "?1") */
  --r2: #7dcb70;  /* Vert   */
  --r3: #e8924a;  /* Orange */
  --r4: #5aa5e8;  /* Bleu   */
  --r5: #b06ee8;  /* Violet (nom client inconnu "?5") */
  --r6: #e0b652;  /* Gold   */
  --display: Montserrat, "Segoe UI", system-ui, sans-serif;
  --radius: 8px;
  --sidebar: 250px;
  --topbar-h: 96px;   /* logo 64px + sous-titre */
  --nav-h: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

/* ---------- topbar ---------- */

.topbar {
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.brand-logo { height: 64px; width: auto; }
.brand small {
  margin-top: 5px;
  font-size: 8.5px;
  letter-spacing: .22em;
  color: var(--muted);
}

.global-search {
  height: 40px;
  max-width: 720px;
  width: 100%;
  justify-self: center;
  border: 1px solid var(--border);
  background: var(--surface-deep);
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  transition: border-color .16s ease, background .16s ease;
}
.global-search:focus-within { border-color: #536070; background: var(--surface); }
.global-search svg { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.global-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  min-width: 0;
}
.global-search input::placeholder { color: #7e8897; }

kbd {
  color: #7f8997;
  font-size: 11px;
  border: 1px solid #2f3845;
  background: var(--bg);
  border-radius: 4px;
  padding: 2px 7px;
}

.lang-select {
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #c4cad3;
  background: var(--surface-deep);
  cursor: pointer;
}
.lang-select:hover { border-color: #536070; }

/* ---------- navigation ---------- */

.nav {
  height: var(--nav-h);
  display: flex;
  align-items: stretch;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-deep);
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.tab {
  min-width: max-content;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b6bdc7;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.tab:hover { color: #fff; background: #14191f; }
.tab.is-active {
  color: var(--gold-soft);
  border-bottom-color: var(--gold);
  background: linear-gradient(180deg, transparent, rgba(201,155,71,.04));
}

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h) - var(--nav-h));
}

/* ---------- sidebar ---------- */

.sidebar {
  padding: 22px 20px 40px;
  background: rgba(18, 21, 28, .6);
  align-self: start;
  position: sticky;
  top: calc(var(--topbar-h) + var(--nav-h));
  max-height: calc(100vh - var(--topbar-h) - var(--nav-h));
  overflow-y: auto;
}

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 17px;
}
.filter-title strong {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.reset {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.reset:hover { color: var(--text); }

.filter-group {
  padding-bottom: 17px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}
.filter-group:last-of-type { border-bottom: 0; }
.filter-label {
  display: block;
  margin-bottom: 9px;
  font-weight: 600;
  font-size: 12px;
  color: #d8dde4;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 27px;
  color: #aeb6c1;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}
.check:hover { color: var(--text); }
.check input {
  appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  flex: 0 0 auto;
  border: 1px solid #3a4553;
  border-radius: 3px;
  background: var(--bg);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.check input:checked { background: var(--gold); border-color: var(--gold); }
.check input:checked::after {
  content: "✓";
  color: #14100a;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
}
.check-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dot.r0 { background: var(--r0); }
.dot.r1 { background: var(--r1); }
.dot.r2 { background: var(--r2); }
.dot.r5 { background: var(--r5); }
.dot.r3 { background: var(--r3); }
.dot.r4 { background: var(--r4); }
.dot.r6 { background: var(--r6); }

.range { width: 100%; accent-color: var(--gold); }
.range-values {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.no-filters { color: var(--muted); font-size: 12.5px; }

/* ---------- contenu ---------- */

.content { padding: 0 24px 44px; min-width: 0; border-left: 1px solid var(--border-soft); }

.banner {
  min-height: 104px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin: 0 -24px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-soft);
  background:
    linear-gradient(90deg, #10141a 0%, #11161c 46%, rgba(17,22,28,.58) 100%),
    radial-gradient(circle at 85% 45%, rgba(201,155,71,.22), transparent 28%);
}
.banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 430px;
  height: 250px;
  background:
    radial-gradient(circle at 45% 50%, rgba(226,181,89,.26), transparent 12%),
    radial-gradient(circle at 70% 48%, rgba(226,181,89,.14), transparent 25%),
    repeating-radial-gradient(circle at 70% 50%, transparent 0 24px, rgba(201,155,71,.08) 25px 26px);
  opacity: .7;
  transform: rotate(-7deg);
  pointer-events: none;
}
.banner-content { position: relative; z-index: 1; }
.banner h1 {
  font-family: var(--display);
  color: var(--gold-soft);
  font-size: 27px;
  letter-spacing: .05em;
  font-weight: 500;
}
.banner p {
  margin-top: 8px;
  color: #aeb5bf;
  max-width: 690px;
}

/* ---------- toolbar ---------- */

.toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin: 18px 0 14px;
  padding: 10px 12px;
  background: var(--surface-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 15px;
  border-right: 1px solid var(--border-soft);
}
.view-btn {
  height: 33px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: #8e98a6;
  background: transparent;
  cursor: pointer;
}
.view-btn:hover { color: var(--text); }
.view-btn.active { color: var(--gold-soft); background: #1b2027; }
.count-info { color: #a9b1bc; font-size: 12px; font-variant-numeric: tabular-nums; }
.sort {
  min-width: 190px;
  height: 36px;
  color: #c7cdd5;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-deep);
  padding: 0 11px;
  outline: 0;
  cursor: pointer;
}
.filter-group .sort { width: 100%; min-width: 0; }

/* ---------- footer ---------- */

.footer {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 1.1rem;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-deep);
}

/* ---------- responsive ---------- */

@media (max-width: 1160px) {
  :root { --sidebar: 220px; }
  .topbar { grid-template-columns: 190px minmax(0, 1fr) auto; gap: 18px; }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px 16px;
    height: auto;
    padding: 12px 16px;
  }
  .global-search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .nav { position: static; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding-left: 16px; padding-right: 16px; }
  .banner { margin-left: -16px; margin-right: -16px; }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: auto 1fr; }
  .sort { grid-column: 1 / -1; }
  .row-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
