/* ============================================================
   COMPARADOR — estilos específicos
   Reutiliza variables y componentes base definidos en styles.css
   (topbar, query-panel, toolbar, botones, estados vacío/error/carga)
   ============================================================ */

.filter-toggle{
  display:flex;
  align-items:center;
  gap:7px;
  font-size: 12.5px;
  color: var(--ink-dim);
  cursor:pointer;
  user-select:none;
}
.filter-toggle input{ accent-color: var(--ideal); width:14px; height:14px; cursor:pointer; }

.compare-view{ max-width: 980px; margin: 0 auto; }

.compare-summary{
  display:flex;
  flex-wrap:wrap;
  gap: 14px;
  align-items:center;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 18px;
}
.summary-block{ display:flex; flex-direction:column; gap:2px; }
.summary-label{
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 600;
}
.summary-value{
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink);
}
.summary-arrow{
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ideal);
  padding: 0 4px;
}

.legend{
  display:flex;
  flex-wrap:wrap;
  gap: 18px;
  margin-bottom: 20px;
  padding: 0 2px;
}
.legend-item{
  display:flex;
  align-items:center;
  gap:6px;
  font-size: 11.5px;
  color: var(--ink-dim);
}
.swatch{ width:12px; height:12px; border-radius:3px; display:inline-block; }
.swatch-up{ background: rgba(111,207,151,0.35); border:1px solid var(--ideal); }
.swatch-down{ background: rgba(225,99,107,0.35); border:1px solid var(--danger); }
.swatch-flat{ background: var(--panel-alt); border:1px solid var(--line); }

.badge{
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 20px;
}
.badge-nuevo{ background: rgba(111,207,151,0.16); color: var(--ideal); border: 1px solid var(--ideal-dim); }
.badge-baja{ background: rgba(225,99,107,0.16); color: var(--danger); border: 1px solid #8C4348; }
.badge-presente{ background: var(--panel-alt); color: var(--ink-faint); border: 1px solid var(--line); }

/* ============================================================
   TARJETA DE JUGADOR (diff)
   ============================================================ */
.player-diff-list{ display:flex; flex-direction:column; gap: 12px; }

.diff-card{
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow:hidden;
  box-shadow: var(--shadow-card);
  animation: rise .4s ease both;
}

.diff-head{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 14px 18px;
  cursor:pointer;
  user-select:none;
}
.diff-head:hover{ background: var(--panel-alt); }

.diff-name{
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  flex: 1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.diff-id{
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

.diff-summary-count{
  display:flex;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.count-up{ color: var(--ideal); }
.count-down{ color: var(--danger); }

.diff-toggle{
  flex-shrink:0;
  width:22px; height:22px;
  border-radius:50%;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--ink-dim);
  font-size: 14px;
  line-height:1;
  display:flex; align-items:center; justify-content:center;
  transition: transform .2s ease, color .15s ease, border-color .15s ease;
}
.diff-card[data-expanded="true"] .diff-toggle{ transform: rotate(45deg); color: var(--ideal); border-color: var(--ideal); }

.diff-body{
  max-height:0;
  overflow:hidden;
  transition: max-height .3s ease, padding .3s ease;
  border-top: 1px solid var(--line-soft);
}
.diff-card[data-expanded="true"] .diff-body{
  max-height: 600px;
  padding: 16px 18px 18px;
}

/* ============================================================
   GRID DE DIFERENCIAS POR HABILIDAD
   ============================================================ */
.diff-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin:0;
}

.diff-cell{
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--panel-alt);
  transition: background .15s ease, border-color .15s ease;
}
.diff-cell dt{
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.diff-cell dd{
  margin:0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  display:flex;
  align-items:baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.diff-old{ color: var(--ink-faint); text-decoration: line-through; font-size: 11px; }
.diff-arrow{ color: var(--ink-faint); font-size: 11px; }
.diff-new{ font-weight: 700; }
.diff-delta{ font-size: 10.5px; margin-left: auto; }

.diff-cell[data-tendencia="sube"]{
  background: rgba(111,207,151,0.14);
  border-color: var(--ideal-dim);
}
.diff-cell[data-tendencia="sube"] .diff-new{ color: var(--ideal); }
.diff-cell[data-tendencia="sube"] .diff-delta{ color: var(--ideal); }

.diff-cell[data-tendencia="baja"]{
  background: rgba(225,99,107,0.14);
  border-color: #8C4348;
}
.diff-cell[data-tendencia="baja"] .diff-new{ color: var(--danger); }
.diff-cell[data-tendencia="baja"] .diff-delta{ color: var(--danger); }

.diff-cell[data-tendencia="igual"]{ opacity: 0.75; }
.diff-cell[data-tendencia="n/a"]{ opacity: 0.55; }

@media (max-width: 560px){
  .diff-grid{ grid-template-columns: repeat(2, 1fr); }
}

.nav-link{ color: var(--ideal); text-decoration:none; font-weight:600; }
.nav-link:hover{ text-decoration:underline; }
