/*
 * tier-list.css — Styles pour les pages Tier List PvP
 * Shortcode [pvp_unified] — generate_html.py
 */

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --tier-s:        #ff5757;
  --tier-a:        #ffa057;
  --tier-b:        #ffd957;
  --tier-c:        #82d96e;
  --tier-d:        #6ea6ff;
  --tier-unranked: #7c7c95;

  --color-death-knight: #C41E3A;
  --color-demon-hunter: #A330C9;
  --color-druid:        #FF7C0A;
  --color-evoker:       #33937F;
  --color-hunter:       #AAD372;
  --color-mage:         #3FC7EB;
  --color-monk:         #00FF98;
  --color-paladin:      #F48CBA;
  --color-priest:       #D8D8D8;
  --color-rogue:        #FFF468;
  --color-shaman:       #0070DD;
  --color-warlock:      #8788EE;
  --color-warrior:      #C69B3A;
}

/* ============================================================
   Meta bar
   ============================================================ */
.ak-tl-metabar {
  display: flex;
  flex-wrap: wrap;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}

.ak-tl-metabar-item {
  display: flex;
  flex-direction: column;
  padding: 10px 18px;
  border-right: 1px solid rgba(255,255,255,.06);
}

.ak-tl-metabar-item:last-child { border-right: none; }

.ak-tl-metabar-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #555;
  margin-bottom: 2px;
}

.ak-tl-metabar-value {
  font-size: 0.86rem;
  color: #E6E0D4;
  font-weight: 500;
}

.ak-live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  animation: ak-pulse 2.5s infinite;
}

@keyframes ak-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* ============================================================
   Bracket tabs (style onglets avec soulignement)
   ============================================================ */
.ak-unified-brackets {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid rgba(255,255,255,.08);
  margin-bottom: 20px;
  gap: 0;
}

.ak-bracket-btn {
  background: transparent;
  color: #666;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  transition: color .2s, border-color .2s;
}

.ak-bracket-btn:hover  { color: #bbb; }
.ak-bracket-btn.active { color: #F0D351; border-bottom-color: #F0D351; }

/* ============================================================
   Role control
   ============================================================ */
.ak-tl-roletabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.ak-tl-rolebtnwrap {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.06);
}

.ak-tl-rolebtn {
  background: transparent;
  color: #777;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  transition: all .15s;
}

.ak-tl-rolebtn:hover { color: #E6E0D4; background: rgba(255,255,255,.05); }

.ak-tl-rolebtn.active {
  background: rgba(50,50,66,.9);
  color: #F0D351;
  border-color: rgba(240,211,81,.3);
}

.ak-tl-rolecounts {
  font-size: .78rem;
  color: #F0D351;
  white-space: nowrap;
}

/* ============================================================
   Intro
   ============================================================ */
.ak-tl-intro {
  font-size: .92rem;
  color: #aaa;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ============================================================
   Tier table
   ============================================================ */
.ak-tl-tiertable {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 1.5rem;
}

.ak-tl-tier-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.ak-tl-tier-row:last-child { border-bottom: none; }

.ak-tl-tier-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px; width: 68px;
  padding: 10px 4px;
  border-radius: 6px;
  text-align: center;
  flex-shrink: 0;
}

.ak-tl-tier-letter {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}

.ak-tl-tier-tagline {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .8;
  margin-top: 4px;
}

.ak-tl-tier-s  { background: rgba(255, 87, 87,.12); color: var(--tier-s);       border: 1px solid rgba(255, 87, 87,.28); }
.ak-tl-tier-a  { background: rgba(255,160, 87,.12); color: var(--tier-a);       border: 1px solid rgba(255,160, 87,.28); }
.ak-tl-tier-b  { background: rgba(255,217, 87,.12); color: var(--tier-b);       border: 1px solid rgba(255,217, 87,.28); }
.ak-tl-tier-c  { background: rgba(130,217,110,.12); color: var(--tier-c);       border: 1px solid rgba(130,217,110,.28); }
.ak-tl-tier-d  { background: rgba(110,166,255,.12); color: var(--tier-d);       border: 1px solid rgba(110,166,255,.28); }
.ak-tl-tier-nr { background: rgba(124,124,149,.08); color: var(--tier-unranked);border: 1px solid rgba(124,124,149,.22); }

.ak-tl-tier-cells {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 6px 0;
}

.ak-tl-tier-empty { font-style: italic; font-size: .82rem; color: #555; align-self: center; }

/* ============================================================
   Spec tiles
   ============================================================ */
.ak-tl-tile { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; width: 64px; }

.ak-tl-tile-icon {
  width: 44px; height: 44px;
  border-radius: 8px; object-fit: cover;
  outline: 2px solid transparent; outline-offset: 1px;
  transition: transform .15s;
}

.ak-tl-tile:hover .ak-tl-tile-icon { transform: scale(1.1); }

/* Tiles avec guide : glow gold au survol */
a.ak-tl-tile { text-decoration: none; color: inherit; }
a.ak-tl-tile:hover .ak-tl-tile-icon {
  outline-width: 3px;
  filter: brightness(1.12);
  box-shadow: 0 0 8px rgba(240,211,81,.3);
}

.ak-tl-tile.class-death-knight .ak-tl-tile-icon { outline-color: var(--color-death-knight); }
.ak-tl-tile.class-demon-hunter .ak-tl-tile-icon { outline-color: var(--color-demon-hunter); }
.ak-tl-tile.class-druid        .ak-tl-tile-icon { outline-color: var(--color-druid);        }
.ak-tl-tile.class-evoker       .ak-tl-tile-icon { outline-color: var(--color-evoker);       }
.ak-tl-tile.class-hunter       .ak-tl-tile-icon { outline-color: var(--color-hunter);       }
.ak-tl-tile.class-mage         .ak-tl-tile-icon { outline-color: var(--color-mage);         }
.ak-tl-tile.class-monk         .ak-tl-tile-icon { outline-color: var(--color-monk);         }
.ak-tl-tile.class-paladin      .ak-tl-tile-icon { outline-color: var(--color-paladin);      }
.ak-tl-tile.class-priest       .ak-tl-tile-icon { outline-color: var(--color-priest);       }
.ak-tl-tile.class-rogue        .ak-tl-tile-icon { outline-color: var(--color-rogue);        }
.ak-tl-tile.class-shaman       .ak-tl-tile-icon { outline-color: var(--color-shaman);       }
.ak-tl-tile.class-warlock      .ak-tl-tile-icon { outline-color: var(--color-warlock);      }
.ak-tl-tile.class-warrior      .ak-tl-tile-icon { outline-color: var(--color-warrior);      }

.ak-tl-tile-tip {
  position: absolute;
  bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: #12121e; color: #E6E0D4;
  font-size: .73rem; white-space: nowrap;
  padding: 4px 8px; border-radius: 4px;
  border: 1px solid #333;
  pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 20;
}

.ak-tl-tile:hover .ak-tl-tile-tip { opacity: 1; }

/* Nom de la spé sous l'icône */
.ak-tl-tile-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: .58rem;
  font-weight: 600;
  text-align: center;
  width: 64px;
  line-height: 1.25;
  margin-top: 3px;
  word-break: break-word;
  hyphens: auto;
}

/* Lien spec-cell dans le tableau */
a.ak-tl-spec-cell { text-decoration: none; color: inherit; }
a.ak-tl-spec-cell:hover .ak-tl-spec-icon { filter: brightness(1.15); }

/* ============================================================
   Stats section title
   ============================================================ */
.ak-tl-stattitle-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.07);
}

.ak-tl-stattitle {
  font-size: 1.15rem;
  font-weight: 700;
  color: #E6E0D4;
}

.ak-tl-stattitle-bracket { color: #F0D351; }

.ak-tl-stattitle-hint {
  font-size: .74rem;
  color: #555;
  white-space: nowrap;
}

/* ============================================================
   Stats bar (résumé)
   ============================================================ */
.ak-tl-statsbar {
  font-size: .8rem;
  color: #888;
  background: rgba(240,211,81,.05);
  border-left: 3px solid rgba(240,211,81,.3);
  border-radius: 0 4px 4px 0;
  padding: 7px 12px;
  margin: 0 0 12px;
  line-height: 1.6;
}

.ak-tl-statsbar strong { color: #F0D351; }

/* ============================================================
   Stats table
   ============================================================ */
.ak-tl-statwrap { overflow-x: auto; margin-bottom: 1.5rem; }

.ak-tl-stattable {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}

.ak-tl-stattable thead th {
  background-color: #1e1e2c !important;
  color: #888;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  text-align: center;
  padding: 9px 10px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.ak-tl-stattable thead th:nth-child(2) { text-align: left; }

.ak-tl-stattable thead th[data-sort] { cursor: pointer; user-select: none; }
.ak-tl-stattable thead th[data-sort]:hover { color: #E6E0D4; }
.ak-tl-stattable thead th.sort-asc::after  { content: ' ↑'; opacity: .7; }
.ak-tl-stattable thead th.sort-desc::after { content: ' ↓'; opacity: .7; }

.ak-tl-stattable tbody tr { border-bottom: 1px solid rgba(255,255,255,.04); transition: background .1s; }
.ak-tl-stattable tbody tr:hover { background: rgba(255,255,255,.035); }
.ak-tl-stattable td { padding: 8px 10px; text-align: center; color: #C8C0B4; }
.ak-tl-stattable td:nth-child(2) { text-align: left; }

/* Tier badge — carré */
.ak-tl-tierbadge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700; font-size: .82rem;
  border-radius: 4px;
}

.ak-tl-stattable .ak-tl-tierbadge.tier-s  { background: rgba(255, 87, 87,.22); color: var(--tier-s);        border: 1px solid rgba(255, 87, 87,.35); }
.ak-tl-stattable .ak-tl-tierbadge.tier-a  { background: rgba(255,160, 87,.22); color: var(--tier-a);        border: 1px solid rgba(255,160, 87,.35); }
.ak-tl-stattable .ak-tl-tierbadge.tier-b  { background: rgba(255,217, 87,.22); color: var(--tier-b);        border: 1px solid rgba(255,217, 87,.35); }
.ak-tl-stattable .ak-tl-tierbadge.tier-c  { background: rgba(130,217,110,.22); color: var(--tier-c);        border: 1px solid rgba(130,217,110,.35); }
.ak-tl-stattable .ak-tl-tierbadge.tier-d  { background: rgba(110,166,255,.22); color: var(--tier-d);        border: 1px solid rgba(110,166,255,.35); }
.ak-tl-stattable .ak-tl-tierbadge.tier-nr { background: rgba(124,124,149,.14); color: var(--tier-unranked); border: 1px solid rgba(124,124,149,.25); }

/* Spec cell */
.ak-tl-spec-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }

.ak-tl-spec-icon {
  width: 32px; height: 32px;
  border-radius: 6px; object-fit: cover;
  outline: 2px solid transparent; outline-offset: 1px;
  flex-shrink: 0;
}

.ak-tl-spec-info { display: flex; flex-direction: column; gap: 2px; }

.ak-tl-spec-name { font-weight: 600; font-size: .88rem; line-height: 1.25; }

.ak-tl-spec-role { font-size: .72rem; color: #888; }

/* Score bar */
.ak-tl-score-bar-bg {
  position: relative;
  height: 16px;
  background: rgba(255,255,255,.05);
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px;
}

.ak-tl-score-bar-fill {
  position: absolute; inset: 0 auto 0 0;
  border-radius: 3px;
  opacity: .55;
}

.ak-tl-score-val {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .74rem; font-weight: 600; color: #fff;
}

/* ============================================================
   Rank badges (tableau détaillé)
   ============================================================ */
.ak-tl-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 19px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 700;
  background: rgba(255,255,255,.07);
  color: #777;
  vertical-align: middle;
}

.ak-tl-rank.rk-1 { background: rgba(240,211, 81,.2);  color: #F0D351; }
.ak-tl-rank.rk-2 { background: rgba(200,200,200,.1);  color: #bbb;    }
.ak-tl-rank.rk-3 { background: rgba(205,127, 50,.12); color: #C88B3A; }

.ak-tl-rank-val {
  font-size: .76rem;
  color: #C8C0B4;
  margin-left: 5px;
  vertical-align: middle;
}

/* ============================================================
   Colonnes détails (Z-scores bruts) — masquées par défaut
   ============================================================ */
.ak-tl-detail-col { display: none; }
.ak-tl-stattable.show-details .ak-tl-detail-col { display: table-cell; }

.ak-tl-details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(240,211,81,.25);
  color: rgba(240,211,81,.65);
  font-size: .72rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: .85rem;
  transition: background .15s, color .15s, border-color .15s;
  letter-spacing: .03em;
}

.ak-tl-details-toggle:hover {
  background: rgba(240,211,81,.07);
  border-color: rgba(240,211,81,.45);
  color: #F0D351;
}

/* ============================================================
   Méthodologie — 2 colonnes
   ============================================================ */
.ak-tl-method {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: .88rem;
  color: #aaa;
  line-height: 1.75;
}

.ak-tl-method-prose p + p { margin-top: .75rem; }
.ak-tl-method-prose strong { color: #E6E0D4; }
.ak-tl-method-prose a { color: #F0D351; }

.ak-tl-method-boxes { display: flex; flex-direction: column; gap: 1rem; }

.ak-tl-method-box {
  background: rgba(30,30,44,.8);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
}

.ak-tl-method-box-title {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #F0D351;
  margin-bottom: .75rem;
}

.ak-tl-method-formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: #E6E0D4;
  margin-bottom: .75rem;
  line-height: 1.5;
}

.ak-tl-method-formula strong { color: #F0D351; }

.ak-tl-method ul { margin: 0; padding: 0; list-style: none; }
.ak-tl-method li { padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .82rem; }
.ak-tl-method li:last-child { border-bottom: none; }
.ak-tl-method li strong { color: #E6E0D4; }

/* ============================================================
   Update date (inline dans shortcode)
   ============================================================ */
.ak-update-date { display: none; } /* géré dans meta bar */

/* ============================================================
   Screen-reader only
   ============================================================ */
.ak-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .ak-tl-method { grid-template-columns: 1fr; }
  .ak-tl-metabar-item { padding: 8px 12px; }
}

@media (max-width: 640px) {
  .ak-tl-tier-label  { min-width: 50px; width: 50px; padding: 8px 3px; }
  .ak-tl-tier-letter { font-size: 1.15rem; }
  .ak-tl-tier-tagline { display: none; }
  .ak-tl-tile        { width: 52px; }
  .ak-tl-tile-icon   { width: 36px; height: 36px; }
  .ak-tl-tile-name   { font-size: .52rem; width: 52px; }
  .ak-tl-stattable   { font-size: .78rem; }
  .ak-tl-stattable thead th,
  .ak-tl-stattable td { padding: 5px 5px; }
  .ak-bracket-btn    { padding: 8px 12px; font-size: .72rem; }
  .ak-tl-spec-icon   { width: 26px; height: 26px; }
}
