@import url("/smgr/css/all.min.css");

/* ============================================================
   smgr · consejos.css — página "Consejos" del rediseño Foco.
   Comparte tu equipo, recibe comentarios, @menciones y duelos.
   Construida sobre tokens.css (--ground/--surface/--ink/--accent…).
   NOTA: se importa Font Awesome porque los endpoints AJAX y el
   helper de menciones (compartidos, no editables) emiten iconos
   .fa-* que no podemos convertir a SVG desde aquí.
   ============================================================ */

/* ---------- Botones auxiliares (variantes de tamaño no globales) ---------- */
.cj-page .btn--sm { padding: 6px 12px; font-size: 13px; }
.cj-page .btn--lg { padding: 12px 26px; font-size: 15px; }
.cj-page .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Cabecera de página + filtros ---------- */
.cj-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.cj-head h1 { font-family: var(--score); font-size: 30px; line-height: 1.05; letter-spacing: .01em; }
.cj-head h1 span { color: var(--accent-deep); }
.cj-intro { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 60ch; }
.cj-intro a { color: var(--accent-deep); font-weight: 600; }

.cj-filters { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-4); }
.cj-filters label { font-size: 13px; color: var(--muted); font-weight: 600; }
.cj-jsel {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: var(--r-input); padding: 7px 30px 7px 12px;
  font: inherit; font-size: 13px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235B6577' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.cj-jsel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cj-toggle-mis { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; font-weight: 600; }

/* ---------- Layout dos columnas ---------- */
.cj-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-5); margin-top: var(--sp-5); align-items: start; }
@media (max-width: 900px) { .cj-layout { grid-template-columns: 1fr; } }

/* ---------- Composer / prompt de login ---------- */
.cj-composer { padding: var(--sp-4); border: 1px solid var(--line); }
.cj-composer h2 { font-size: 15px; font-weight: 600; margin-bottom: var(--sp-3); display: flex; align-items: center; gap: 8px; }
.cj-composer h2 .fa { color: var(--accent-deep); }
.cj-field { margin-bottom: var(--sp-3); }
.cj-select, .cj-textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--r-input); padding: 9px 12px; font: inherit; font-size: 13.5px;
}
.cj-select { max-width: 360px; cursor: pointer; }
.cj-textarea { resize: vertical; min-height: 58px; line-height: 1.5; }
.cj-select:focus-visible, .cj-textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.cj-charcount { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.cj-alert { display: none; background: var(--down-tint); color: var(--down); border-radius: var(--r-input); padding: 8px 12px; font-size: 13px; margin-bottom: var(--sp-3); }
.cj-alert.is-visible { display: block; }
.cj-empty { text-align: center; color: var(--muted); padding: var(--sp-6) var(--sp-4); }
.cj-empty .fa { font-size: 30px; color: var(--line); display: block; margin-bottom: var(--sp-3); }

/* ---------- Tarjeta de consulta ---------- */
.cj-consulta { padding: 0; margin-bottom: var(--sp-4); overflow: hidden; transition: box-shadow .2s; }
.cj-consulta.is-own { border-color: var(--accent); }
.cj-consulta__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-3); flex-wrap: wrap; }
.cj-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cj-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cj-avatar--ph { display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: #fff; font-weight: 700; font-family: var(--score); font-size: 16px; }
.cj-author-name { font-weight: 700; color: var(--ink); }
.cj-team { color: var(--muted); font-size: 13px; }
.cj-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; font-size: 12px; }
.cj-badge-own { background: var(--accent-soft); color: var(--accent-deep); border-radius: var(--r-pill); padding: 2px 9px; font-weight: 700; }
.cj-badge-pos { background: var(--ink); color: #fff; border-radius: var(--r-pill); padding: 2px 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cj-badge-pos small { font-weight: 500; opacity: .8; }
.cj-date { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cj-wallet { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cj-wallet.up { color: var(--up); }
.cj-wallet.down { color: var(--down); }

/* ---------- Mensaje + menciones ---------- */
.cj-message { margin: 0 var(--sp-4) var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--ground); border-left: 3px solid var(--accent); border-radius: 0 var(--r-input) var(--r-input) 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.mention-inline { font-weight: 600; color: var(--pos-b); text-decoration: none; }
.mention-inline:hover { text-decoration: underline; }
.mention-unknown { font-weight: 600; color: var(--muted); }
.mention-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-3); }
.mention-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-input); padding: 8px 10px; font-size: 12px; min-width: 180px; flex: 1 1 200px; }
.mention-card-baja { border-color: var(--down); background: var(--down-tint); }
.mention-card-header { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; font-weight: 600; }
.mention-card-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.mention-card-row strong { color: var(--ink); }
.mention-card-price { color: var(--accent-deep) !important; }
.mention-player-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.mention-player-link:hover { color: var(--accent-deep); }
.mention-sep { color: var(--line); }
.mention-condicion { width: 12px; height: 12px; vertical-align: middle; }

/* Badges de posición emitidos por el helper compartido (.position-badge) */
.position-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; font-size: 10.5px; font-weight: 700; font-family: var(--score); }
.position-badge.base { background: var(--pos-b-tint); color: var(--pos-b); }
.position-badge.alero { background: var(--pos-a-tint); color: var(--pos-a); }
.position-badge.pivot { background: var(--pos-p-tint); color: var(--pos-p); }
.broker-up { color: var(--up); }
.broker-down { color: var(--down); }

/* Utilidades puntuales */
.cj-mb-3 { margin-bottom: var(--sp-3); }
.cj-center { text-align: center; }
.cj-venue { font-size: 10px; }
.cj-venue--home { color: var(--up); }
.cj-venue--away { color: var(--pos-b); }

/* ---------- Tabla de plantilla (roster) — usa el look base .table ----------
   El <table> lleva class="table cj-roster": hereda cabecera oscura, zebra,
   hover y alineación (.r) del sistema. Aquí sólo los ajustes propios. */
.cj-roster-wrap {
  overflow-x: auto; margin: 0 var(--sp-4) var(--sp-2);
  border: 1px solid var(--line); border-radius: var(--r-card);
}
.cj-roster { min-width: 640px; font-size: 12.5px; line-height: 1.2; }
/* Cabeceras estáticas: hay muchas tablas por página, evitamos el sticky global.
   Filas compactas: padding ajustado para que cada jugador ocupe una línea baja. */
.cj-roster th { position: static; padding: 6px 8px; }
.cj-roster td { padding: 3px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cj-roster tbody tr:last-child td { border-bottom: 0; }

.cj-player { display: inline-flex; align-items: center; gap: 5px; }
.cj-player a { color: var(--ink); font-weight: 600; }
.cj-player a:hover { color: var(--accent-deep); }
.cj-player .fa-medkit { color: var(--down); font-size: 11px; }
.cj-flag { width: 12px; height: 12px; vertical-align: middle; }
.cj-transfer-in { color: var(--up); font-size: 11px; }

.cj-roster .team-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); }
.cj-roster .team-tag:hover { color: var(--accent-deep); }
.cj-roster .team-tag .shield--sm { width: 16px; height: 16px; }
.cj-team-code { color: var(--muted); font-size: 12px; font-weight: 600; }

/* Próx: icono + escudo + previsión SIEMPRE en una sola línea */
.cj-next { white-space: nowrap; }
.cj-next-in { display: inline-flex; align-items: center; gap: 4px; }
.cj-next-in .shield { width: 15px; height: 15px; }
.cj-next-in strong { font-variant-numeric: tabular-nums; }
.cj-row-baja td { opacity: .55; }
@media (max-width: 640px) { .cj-broker-hide { display: none; } .cj-team-code { display: none; } }

.cj-transfers-out { padding: var(--sp-3) var(--sp-4); border-top: 1px dashed var(--line); font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cj-transfers-out .lbl { color: var(--down); font-weight: 700; }
.cj-out-player { display: inline-flex; align-items: center; gap: 4px; background: var(--ground); border-radius: var(--r-pill); padding: 2px 8px; }
.cj-out-player a { color: var(--ink); text-decoration: none; }
.cj-out-player a:hover { color: var(--accent-deep); }
.cj-out-price { color: var(--muted); font-variant-numeric: tabular-nums; }
.cj-wallet-foot { padding: var(--sp-2) var(--sp-4) var(--sp-3); font-size: 12.5px; color: var(--muted); }
.cj-wallet-foot strong.up { color: var(--up); }
.cj-wallet-foot strong.down { color: var(--down); }

/* ---------- Comentarios ---------- */
.cj-comments { border-top: 1px solid var(--line); }
.cj-comments-toggle { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: var(--sp-3) var(--sp-4); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.cj-comments-toggle:hover { background: var(--hover); }
.cj-comments-toggle .fa-comment { color: var(--accent-deep); }
.cj-comments-toggle .chev { margin-left: auto; font-size: 11px; color: var(--muted); transition: transform .2s; }
.cj-comments-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.cj-comments-list { padding: 0 var(--sp-4) var(--sp-3); }

/* Markup emitido por los endpoints AJAX (.consulta-comment*) */
.consulta-comment { padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.consulta-comment:last-child { border-bottom: 0; }
.consulta-comment.comment-hidden { opacity: .5; }
.consulta-comment-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.consulta-comment-author { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.consulta-comment-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.consulta-comment-avatar-icon { font-size: 24px; color: var(--line); }
.consulta-comment-actions { display: flex; align-items: center; gap: 8px; }
.consulta-comment-date { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.consulta-comment-body { font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.btn-toggle-comment-visibility { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px; }
.cj-comment-form { display: flex; flex-direction: column; gap: 6px; margin-top: var(--sp-3); }
.cj-comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cj-login-prompt { padding: var(--sp-3) 0; font-size: 13px; color: var(--muted); }
.cj-login-prompt button { background: none; border: 0; color: var(--accent-deep); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.cj-spinner { text-align: center; padding: var(--sp-3); color: var(--muted); }

/* ---------- Sidebar: duelos ---------- */
.cj-aside { display: flex; flex-direction: column; gap: var(--sp-4); }
.cj-widget { padding: var(--sp-4); }
.cj-widget h2 { font-size: 15px; font-weight: 700; margin-bottom: var(--sp-3); display: flex; align-items: center; gap: 7px; }
.cj-widget h2 .fa { color: var(--accent-deep); }

.duelo-card { border: 1px solid var(--line); border-radius: var(--r-input); padding: var(--sp-3); margin-bottom: var(--sp-3); }
.duelo-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.duelo-player { position: relative; text-align: center; padding: 6px 4px; border-radius: var(--r-input); cursor: pointer; transition: background .15s; border: 1px solid transparent; }
.duelo-player:not(.disabled):hover { background: var(--hover); }
.duelo-player.voted { background: var(--accent-soft); border-color: var(--accent); }
.duelo-player.disabled { cursor: default; }
.duelo-voted-check { position: absolute; top: 2px; right: 4px; color: var(--up); font-size: 12px; }
.duelo-condicion { position: absolute; top: 4px; left: 4px; width: 11px; height: 11px; }
.duelo-player-shield { display: block; margin: 0 auto 4px; }
.duelo-player-name { font-weight: 700; font-size: 12.5px; line-height: 1.15; color: var(--ink); }
.duelo-player-meta { display: flex; flex-direction: column; font-size: 10.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.duelo-vs { font-family: var(--score); font-weight: 700; font-size: 12px; color: var(--muted); }
.duelo-bar { display: flex; height: 20px; border-radius: var(--r-pill); overflow: hidden; margin-top: 8px; background: var(--zebra); }
.duelo-bar.hidden { display: none; }
.duelo-bar-fill-1, .duelo-bar-fill-2 { display: flex; align-items: center; min-width: 0; overflow: hidden; }
.duelo-bar-fill-1 { background: var(--pos-b); justify-content: flex-start; }
.duelo-bar-fill-2 { background: var(--pos-a); justify-content: flex-end; }
.duelo-bar-label { font-size: 10.5px; font-weight: 700; color: #fff; padding: 0 6px; white-space: nowrap; }
.duelo-bar-legend { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 3px; gap: 6px; }
.duelo-bar-legend-1, .duelo-bar-legend-2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 48%; }
.duelo-total-votes { text-align: center; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.duelo-login-hint { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.duelo-login-hint button, .cj-login-inline { background: none; border: 0; color: var(--accent-deep); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.cj-vermas { width: 100%; margin-bottom: var(--sp-3); }
.duelo-propose-form { border-top: 1px solid var(--line); padding-top: var(--sp-3); margin-top: var(--sp-2); display: flex; flex-direction: column; gap: 6px; }
.duelo-propose-form h3 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.duelo-propose-form h3 .fa { color: var(--accent-deep); }
.duelo-propose-form input { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-input); padding: 8px 10px; font: inherit; font-size: 13px; }
.duelo-propose-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.duelo-propose-error { display: none; color: var(--down); font-size: 12px; }
.duelo-propose-error.is-visible { display: block; }
.duelo-propose-success { display: none; color: var(--up); font-size: 12px; }
.duelo-propose-success.is-visible { display: block; }

/* ---------- Sidebar: partidos ---------- */
.cj-partidos table { width: 100%; font-size: 13px; }
.cj-partidos td { padding: 4px 6px; vertical-align: middle; }
.cj-partidos .cj-p-mid { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.cj-partidos .cj-p-vis { text-align: right; }

/* ---------- Paginación ---------- */
.cj-pager { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); }

/* ---------- Autocompletado de menciones (popup propio) ---------- */
.cj-mention-pop { position: absolute; z-index: 1200; list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-input); box-shadow: var(--shadow-pop); max-height: 240px; overflow-y: auto; min-width: 220px; }
.cj-mention-pop[hidden] { display: none; }
.cj-mention-pop li { padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.cj-mention-pop li.is-active, .cj-mention-pop li:hover { background: var(--accent-soft); }
