/* Liga Manager – Frontend Widget Styles v1.1 */

/* ── Base widget ─────────────────────────────────────────────── */
.lm-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #2c3e50;
}

.lm-empty {
    color: #999;
    font-size: .9rem;
    padding: 12px 0;
}

/* ── Título ─────────────────────────────────────────────────── */
.lm-widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid #1a56a0;
    color: #1a56a0;
    letter-spacing: -.01em;
}

/* ── Escudos ─────────────────────────────────────────────────── */
.lm-escudo-sm {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Tabla ───────────────────────────────────────────────────── */
.lm-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e0e6ed;
}

.lm-ftable {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.lm-ftable thead tr {
    background: #1a56a0;
    color: #fff;
}

.lm-ftable th {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .04em;
    white-space: nowrap;
}

.lm-ftable td {
    padding: 9px 10px;
    text-align: center;
    border-bottom: 1px solid #e0e6ed;
    vertical-align: middle;
    color: #2c3e50;
}

.lm-ftable tbody tr:last-child td { border-bottom: none; }
.lm-ftable tbody tr:nth-child(even) td { background: #f7f9fc; }
.lm-ftable tbody tr:hover td { background: #eaf0f9; transition: background .15s; }

.lm-row-leader td { background: #fff8e1 !important; }
.lm-row-leader:hover td { background: #fff3c4 !important; }

.lm-th-pos, .lm-td-pos { width: 32px; font-weight: 700; color: #1a56a0; }
.lm-td-nombre { text-align: left !important; font-weight: 600; }

/* Badge goles */
.lm-goles-badge {
    display: inline-block;
    background: #1a56a0;
    color: #fff;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .85rem;
    min-width: 28px;
    text-align: center;
}

/* ── Fixture ─────────────────────────────────────────────────── */
.lm-fecha-block {
    margin-bottom: 16px;
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    overflow: hidden;
}

.lm-fecha-header {
    background: #1a56a0;
    color: #fff;
    padding: 10px 14px;
    font-weight: 700;
    font-size: .9rem;
}

.lm-fecha-header span { font-weight: 400; opacity: .85; }

.lm-partido-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-bottom: 1px solid #e0e6ed;
    background: #fff;
    transition: background .15s;
}

/* Fila interna: local — resultado — visita */
.lm-pi-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.lm-partido-item:last-child { border-bottom: none; }
.lm-partido-item:hover { background: #f7f9fc; }

.lm-pi-equipo {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    font-weight: 600;
    color: #2c3e50;
}

/* ── Alineacion independiente local / visitante ──────────────── */

/*
 * LOCAL: escudo SIEMPRE a la izquierda, nombre SIEMPRE a la derecha.
 * flex-direction: row fijo. Solo cambia justify-content para mover el bloque.
 */
.lm-pi-local {
    flex-direction: row;         /* escudo izq, nombre der — nunca cambia */
    justify-content: flex-start; /* default: bloque pegado a la izquierda */
}
.lm-fixture-widget[data-alin-local="left"]   .lm-pi-local { justify-content: flex-start; }
.lm-fixture-widget[data-alin-local="center"] .lm-pi-local { justify-content: center; }
.lm-fixture-widget[data-alin-local="right"]  .lm-pi-local { justify-content: flex-end; }

/*
 * VISITANTE: HTML es [nombre][escudo], flex-direction: row normal.
 * El nombre queda a la izquierda del escudo visualmente — siempre.
 * justify-content mueve el bloque entero.
 */
.lm-pi-visita {
    flex-direction: row;         /* nombre izq, escudo der — nunca cambia */
    justify-content: flex-end;   /* default: bloque pegado a la derecha */
}
.lm-fixture-widget[data-alin-visita="right"]  .lm-pi-visita { justify-content: flex-end; }
.lm-fixture-widget[data-alin-visita="center"] .lm-pi-visita { justify-content: center; }
.lm-fixture-widget[data-alin-visita="left"]   .lm-pi-visita { justify-content: flex-start; }

.lm-pi-resultado {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 72px;
    justify-content: center;
}

.lm-score {
    background: #1a56a0;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 6px;
    padding: 3px 10px;
    min-width: 28px;
    text-align: center;
}

.lm-score-sep { color: #aaa; font-weight: 700; }
.lm-vs { color: #aaa; font-size: .82rem; letter-spacing: .05em; font-weight: 600; }

.lm-libre {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #7f8c8d;
    font-style: italic;
    font-size: .88rem;
    border-bottom: 1px solid #e0e6ed;
}
.lm-libre:last-child { border-bottom: none; }

/* ── Cargar resultado (frontend form) ────────────────────────── */
.lm-fe-group { margin-bottom: 14px; }

.lm-fe-label {
    display: block;
    font-weight: 600;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.lm-fe-select,
.lm-fe-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e0e6ed;
    border-radius: 7px;
    font-size: .9rem;
    background: #fff;
    color: #2c3e50;
    box-sizing: border-box;
}

.lm-fe-select:focus,
.lm-fe-input:focus {
    outline: none;
    border-color: #1a56a0;
    box-shadow: 0 0 0 3px rgba(26,86,160,.1);
}

.lm-fe-partido {
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.lm-fe-partido-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #f7f9fc;
    flex-wrap: wrap;
}

.lm-fe-equipo {
    flex: 1;
    font-weight: 600;
    font-size: .88rem;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #2c3e50;
}

.lm-fe-visita { justify-content: flex-end; }

.lm-fe-score-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lm-fe-score {
    width: 54px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 6px;
    border: 2px solid #e0e6ed;
    border-radius: 7px;
    background: #fff;
}

.lm-fe-dash { color: #aaa; font-weight: 700; }

.lm-fe-goleadores {
    padding: 12px 14px;
    border-top: 1px solid #e0e6ed;
}

.lm-gol-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #e0e6ed;
    font-size: .88rem;
    gap: 8px;
}

.lm-gol-row:last-child { border-bottom: none; }

.lm-fe-add-gol {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.lm-fe-add-gol .lm-fe-input  { flex: 2; min-width: 120px; }
.lm-fe-add-gol .lm-fe-select { flex: 1; min-width: 100px; }

/* ── Botones frontend ─────────────────────────────────────────── */
.lm-btn-fe {
    padding: 8px 16px;
    border: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
    line-height: 1.4;
}

.lm-btn-fe:hover   { opacity: .85; }
.lm-btn-fe:active  { transform: scale(.97); }

.lm-btn-fe-primary { background: #1a56a0; color: #fff; }
.lm-btn-fe-accent  { background: #e8b400; color: #1a1a1a; }
.lm-btn-fe-danger  { background: #e74c3c; color: #fff; padding: 4px 10px; font-size: .8rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .lm-pi-equipo        { font-size: .78rem; }
    .lm-score            { padding: 3px 7px; font-size: .9rem; }
    .lm-fe-partido-header { flex-direction: column; align-items: flex-start; }
    .lm-fe-score-wrap    { align-self: center; }
    .lm-ftable th,
    .lm-ftable td        { padding: 7px 6px; font-size: .8rem; }
}

/* ── Goleadores en widget fixture ────────────────────────────── */
.lm-pi-goleadores {
    width: 100%;
    display: flex;
    gap: 0;
    border-top: 1px dashed #e0e6ed;
    margin-top: 8px;
    padding-top: 6px;
    font-size: .78rem;
    color: #555;
}

.lm-pi-goles-local,
.lm-pi-goles-visita {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lm-pi-goles-local  { align-items: flex-start; padding-right: 8px; }
.lm-pi-goles-visita { align-items: flex-end;   padding-left:  8px; }

.lm-pi-goles-sep {
    width: 1px;
    background: #e0e6ed;
    flex-shrink: 0;
}

.lm-pi-gol {
    display: inline-block;
    line-height: 1.5;
}

.lm-pi-gol em {
    font-style: normal;
    color: #999;
    font-size: .75rem;
}
