/* ============================================================
   AKALAVOLO — Guides de classe (CSS unifié)
   
   Remplace : builds.css, tokens.css, shortcode-styles.css
   Charger APRÈS pages.css (qui gère le layout de base equipement-list)
   ============================================================ */


/* ── Variables de design ── */
/* Tokens deplaces vers css/tokens.css */


/* ── Items : pourcentages à droite ── */

.equipement-list ul li {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  list-style: none !important;
}

/* Le lien (y compris après injection Wowhead icontinyl) prend l'espace dispo */
.equipement-list ul li > a,
.equipement-list ul li > a.icontinyl,
.equipement-list ul li > .ak-itemlink {
  flex: 1 1 auto !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex !important;
  align-items: center;
}

/* Le badge % reste compact à droite, ne rétrécit jamais */
.equipement-list ul li > .akalavolo-pct {
  flex: 0 0 auto !important;
  margin-left: auto;
  white-space: nowrap;
}


/* ── Badges de pourcentage ── */

.akalavolo-pct {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.akalavolo-pct-high {
  background: rgba(240, 211, 81, 0.18);
  color: var(--ak-gold);
}

.akalavolo-pct-mid {
  background: rgba(230, 224, 212, 0.12);
  color: var(--ak-text);
}

.akalavolo-pct-low {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ak-text-dim);
}


/* ── Ligne "Autre" dans les listes d'items ── */

.ak-itemlink-autre {
  color: var(--ak-text-dim);
  font-style: italic;
}


/* ── Badges de type d'item (Ensemble, Artisanat) ── */

.ak-item-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 5px;
  vertical-align: middle;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ak-item-badge-set {
  background: rgba(163, 100, 240, 0.18);
  color: #c49af0;
  border: 1px solid rgba(163, 100, 240, 0.25);
}

.ak-item-badge-craft {
  background: rgba(80, 200, 160, 0.15);
  color: #6dcfb4;
  border: 1px solid rgba(80, 200, 160, 0.25);
}

.ak-item-badge-vendor {
  background: rgba(96, 168, 212, 0.15);
  color: #7ec8e3;
  border: 1px solid rgba(96, 168, 212, 0.25);
}

.ak-item-badge-other {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ak-text-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
}


/* ── Méta (nombre de joueurs) ── */

.akalavolo-builds-meta {
  font-size: 0.85rem;
  color: var(--ak-text-muted);
  margin-bottom: 20px;
  font-style: italic;
}

.akalavolo-builds-meta strong {
  color: var(--ak-gold);
  font-style: normal;
  font-weight: 700;
}


/* ── Titres de section (H3 dans les groupes d'équipement) ── */

.ak-h3 {
  font-size: 1.2rem;
  color: var(--ak-gold);
  margin: 24px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ak-border);
  font-weight: 600;
}


/* ── Séparateur entre groupes ── */

.ak-sep {
  border: none;
  border-top: 1px solid rgba(240, 211, 81, 0.15);
  margin: 24px 0;
}


/* ── Barre de filtre (titre section + pills de mode) ── */

.ak-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--ak-border);
  flex-wrap: wrap;
}

.ak-filterbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ak-section-h2 {
  margin: 0 !important;
  font-size: 1.4rem !important;
  color: var(--ak-gold) !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.ak-mode-badge {
  background: var(--ak-gold-soft);
  color: var(--ak-gold);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ak-filterbar-right {
  display: flex;
  align-items: center;
}


/* ── Pills de mode (2v2, 3v3, shuffle, etc.) ── */

.ak-mode-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ak-mode-pill {
  /* Reset button navigateur */
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  outline: none;
  /* Styles custom */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ak-text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.4;
}

.ak-mode-pill:hover {
  background: rgba(240, 211, 81, 0.1);
  border-color: rgba(240, 211, 81, 0.3);
  color: var(--ak-text);
}

.ak-mode-pill.is-active {
  background: var(--ak-gold-soft);
  border-color: var(--ak-gold);
  color: var(--ak-gold);
}


/* ── Sections dynamiques (tabs) ── */

.ak-section[hidden] {
  display: none !important;
}

.ak-section {
  scroll-margin-top: var(--ak-nav-offset, 80px);
}

/* Ancres TOC : présentes dans le DOM pour le sommaire, invisibles à l'écran */
.ak-section-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ── Placeholder (sections pas encore implémentées) ── */

.ak-placeholder {
  text-align: center;
  padding: 48px 24px;
  color: var(--ak-text-muted);
  font-style: italic;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.ak-placeholder strong {
  color: var(--ak-gold);
  font-style: normal;
}


/* ── Erreurs ── */

.akalavolo-error {
  color: var(--ak-red);
  font-style: italic;
  padding: 12px;
  border: 1px solid rgba(196, 30, 58, 0.3);
  border-radius: 6px;
  background-color: rgba(196, 30, 58, 0.05);
}


/* ── Tags de slot d'embellissement ── */

.ak-emb-slot {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 5px;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ak-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Note explicative dans le titre "Embellissements" */
.ak-emb-note {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ak-text-muted);
  margin-left: 6px;
}


/* ── Section Statistiques ── */

.ak-stats-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 0 24px;
}

.ak-stat-row {
  display: grid;
  grid-template-columns: 140px 1fr 160px;
  align-items: center;
  gap: 14px;
}

.ak-stat-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ak-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ak-stat-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  overflow: hidden;
}

.ak-stat-fill {
  height: 100%;
  background: var(--stat-clr, var(--ak-gold));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.ak-stat-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--stat-clr, var(--ak-text));
  text-align: right;
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 4px;
  justify-content: flex-end;
}

.ak-stat-unit {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ak-text-muted);
}

/* Pourcentage approximatif affiché à côté de la cote (polyvalence uniquement) */
.ak-stat-pct {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ak-text-muted);
  margin-left: 2px;
}

.ak-stat-priority {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--ak-gold);
  border-radius: 0 var(--ak-radius) var(--ak-radius) 0;
  font-size: 0.88rem;
}

.ak-stat-priority-label {
  font-weight: 700;
  color: var(--ak-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  margin-right: 4px;
}

.ak-stat-priority-sep {
  color: var(--ak-text-dim);
  font-size: 0.8rem;
  margin: 0 2px;
}


/* ── Section Talents ── */

.ak-hero-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ak-hero-pill {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ak-text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ak-hero-pill:hover {
  background: rgba(240, 211, 81, 0.1);
  border-color: rgba(240, 211, 81, 0.3);
  color: var(--ak-text);
}

.ak-hero-pill.is-active {
  background: var(--ak-gold-soft);
  border-color: var(--ak-gold);
  color: var(--ak-gold);
}

.ak-hero-pill-pct {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.7;
}

.ak-tree-panel[hidden] {
  display: none !important;
}

.ak-talent-embed-wrap {
  margin-bottom: 24px;
}

.ak-talent-embed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ak-talent-source {
  font-size: 0.78rem;
  color: var(--ak-text-muted);
  font-style: italic;
  margin: 0;
}

.ak-talent-source strong {
  color: var(--ak-text);
  font-style: normal;
}

.ak-talent-wowhead-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ak-gold);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.ak-talent-wowhead-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* L'arbre de talents Wowhead est ~830px large, ~590px de contenu utile */
.ak-talent-iframe-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--ak-border);
  border-radius: var(--ak-radius);
  background: #0d0b12;
}

.ak-talent-iframe {
  display: block;
  width: 830px;
  min-width: 100%;
  height: 620px;
  border: none;
  background: #0d0b12;
}

.ak-pvp-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ak-text-dim);
  margin: 12px 0 4px;
}

.ak-talent-code code {
  font-size: 0.8rem;
  color: var(--ak-text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}


/* ── Section Général — Layout côte à côte ── */

.ak-general-top-cols {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 4px;
}

.ak-general-col-tier {
  min-width: 200px;
}

/* ── Tier list badges (liste verticale) ── */

.ak-tier-positions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ak-tier-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--ak-radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--tier-clr, rgba(255,255,255,0.08));
  border-left: 3px solid var(--tier-clr, rgba(255,255,255,0.15));
}

.ak-tier-badge-bracket {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ak-text-muted);
  min-width: 72px;
}

.ak-tier-badge-letter {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--tier-clr, var(--ak-text-dim));
  min-width: 28px;
  text-align: center;
}

.ak-tier-badge-rank {
  font-size: 0.75rem;
  color: var(--ak-text);
  font-weight: 600;
}

.ak-tier-badge-role {
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--ak-text-dim);
}

.ak-tier-badge-mmr {
  font-weight: 400;
  color: var(--ak-text-muted);
}


/* ── Top joueurs — liste flex ── */

.ak-players-wrap {
  min-width: 0;
}

.ak-players-header {
  display: grid;
  grid-template-columns: 36px 1fr 80px;
  padding: 4px 12px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ak-text-dim);
  border-bottom: 1px solid var(--ak-border);
}

.ak-players-header span:last-child { text-align: right; }

.ak-player-row {
  display: grid;
  grid-template-columns: 36px 1fr 80px;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--ak-border-soft);
  transition: background 0.1s;
}

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

.ak-player-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ak-player-rank-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ak-text-dim);
  font-variant-numeric: tabular-nums;
}

.ak-rank-top-1 { color: var(--ak-accent) !important; }
.ak-rank-top-2 { color: #b0b8c4 !important; }
.ak-rank-top-3 { color: #cd7f32 !important; }

.ak-player-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

.ak-player-name {
  color: var(--ak-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ak-player-name:hover { color: var(--ak-gold); }

.ak-player-realm {
  font-size: 0.72rem;
  color: var(--ak-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ak-player-cr-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.ak-player-cr {
  color: var(--ak-gold);
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.ak-player-global-rank {
  font-size: 0.68rem;
  color: var(--ak-text-dim);
  font-variant-numeric: tabular-nums;
}

.ak-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 4px;
}

.ak-page-btn {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ak-text-muted);
  padding: 5px 14px;
  border-radius: 5px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.ak-page-btn:hover:not(:disabled) {
  background: var(--ak-gold-soft);
  border-color: var(--ak-gold);
  color: var(--ak-gold);
}

.ak-page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.ak-page-info {
  font-size: 0.8rem;
  color: var(--ak-text-muted);
}


/* ── Tier Set + Races côte à côte ── */

.ak-general-side-cols {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.ak-general-side-col {
  flex: 1;
  min-width: 240px;
}


/* ── Tier Set PvE ── */

.ak-tier-set-block {
  display: flex;
  gap: 0;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ak-border);
  border-radius: var(--ak-radius);
  overflow: hidden;
}

.ak-tier-set-info {
  flex: 1;
  padding: 16px 20px;
  min-width: 0;
}

.ak-tier-set-model {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  border-left: 1px solid var(--ak-border);
  padding: 0;
  overflow: hidden;
}

.ak-tier-set-model-img {
  display: block;
  width: 120px;
  height: auto;
  object-fit: cover;
  object-position: top;
}

.ak-tier-set-header {
  margin-bottom: 12px;
}

.ak-tier-set-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ak-text);
  text-decoration: none;
}

a.ak-tier-set-name:hover { color: var(--ak-gold); }

.ak-tier-set-dist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ak-tier-set-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 10px;
}

.ak-tier-set-label {
  font-size: 0.78rem;
  color: var(--ak-text-dim);
  white-space: nowrap;
}

.ak-tier-set-bar-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
}

.ak-tier-set-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ak-tier-set-bonuses {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--ak-border);
  padding-top: 12px;
}

.ak-tier-set-bonus-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ak-gold);
  margin-bottom: 3px;
}

.ak-tier-set-bonus-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ak-text);
  line-height: 1.5;
}


/* ── Races par faction ── */

.ak-races-wrap {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ak-races-group {
  flex: 1;
  min-width: 160px;
}

.ak-races-group .equipement-list {
  column-count: 1;
}

.ak-races-faction-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ak-border);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ak-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ak-faction-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.ak-race-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-right: 2px;
}


/* ── Responsive ── */

@media (max-width: 768px) {
  .ak-filterbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .ak-mode-pills {
    width: 100%;
  }

  .ak-mode-pill {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
  }

  .ak-general-top-cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }


  .ak-races-wrap {
    flex-direction: column;
    gap: 20px;
  }

  .ak-stat-row {
    grid-template-columns: 110px 1fr 130px;
    gap: 10px;
  }

  .ak-stat-name {
    font-size: 0.75rem;
  }
}

/* ── Compositions ─────────────────────────────────────────────────────────── */

.ak-comp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.ak-comp-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ak-border);
  border-radius: 6px;
}

.ak-comp-rank {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ak-text-muted, #8a8aa0);
  text-align: center;
}

.ak-comp-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ak-comp-spec {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.ak-comp-spec--focal {
  background: rgba(255, 255, 255, 0.11);
  outline: 1px solid rgba(255, 255, 255, 0.15);
}

.ak-role-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-right: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.ak-comp-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.ak-comp-games {
  font-size: 0.78rem;
  color: var(--ak-text-muted, #8a8aa0);
}

.ak-comp-source {
  font-size: 0.78rem;
  color: var(--ak-text-muted, #8a8aa0);
  margin-bottom: 4px;
}

.ak-comp-updated {
  font-size: 0.75rem;
  color: var(--ak-text-muted, #8a8aa0);
  margin-top: 10px;
}

@media (max-width: 600px) {
  .ak-comp-row {
    grid-template-columns: 30px 1fr;
    grid-template-rows: auto auto;
  }
  .ak-comp-stats {
    grid-column: 2;
  }
}
