/* ═══════════════════════════════════════════════════════════════════════
   LPF SP Overrides — Mejoras visuales para shortcodes nativos de SportsPress
   Afecta: [event_blocks], [team_standings], [league_table]
   Hereda los colores del tema via --lpf-primary (inyectado por PHP)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── [event_blocks] — Calendario nativo de SportsPress ──────────────── */

/* Contenedor general del bloque de eventos */
.sp-template-event-blocks {
    background: transparent;
}

/* Cada tarjeta de partido */
.sp-template-event-blocks .sp-event-block,
.sp-template-event-blocks .sp-block {
    background    : #0B1D3D;
    border        : 1px solid rgba(255,255,255,0.07) !important;
    border-radius : 12px !important;
    color         : #fff;
    transition    : box-shadow 0.2s;
}
.sp-template-event-blocks .sp-event-block:hover,
.sp-template-event-blocks .sp-block:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* Header de la tarjeta (fecha) */
.sp-template-event-blocks .sp-event-block-head,
.sp-template-event-blocks .sp-block-title {
    color         : rgba(255,255,255,0.5) !important;
    font-size     : 10px !important;
    font-weight   : 600 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    border-bottom : 1px solid rgba(255,255,255,0.06) !important;
    background    : transparent !important;
    padding       : 10px 14px !important;
}

/* Nombres de equipos */
.sp-template-event-blocks .sp-event-block-teams .team-name,
.sp-template-event-blocks .sp-event-block-teams h5,
.sp-template-event-blocks .sp-block-teams .team-name {
    color      : #fff !important;
    font-size  : 11px !important;
    font-weight: 700 !important;
}

/* Score central — usar el color primario del tema */
.sp-template-event-blocks .sp-event-main,
.sp-template-event-blocks .sp-event-block-main,
.sp-template-event-blocks .sp-result {
    color      : var(--lpf-primary, #38a9ff) !important;
    font-size  : 22px !important;
    font-weight: 800 !important;
}

/* Hora pendiente */
.sp-template-event-blocks .sp-event-block-time,
.sp-template-event-blocks .sp-event-time {
    background    : var(--lpf-primary, #38a9ff) !important;
    color         : #001820 !important;
    border-radius : 14px !important;
    padding       : 4px 12px !important;
    font-weight   : 800 !important;
    font-size     : 12px !important;
    display       : inline-block !important;
}

/* Estadio/venue */
.sp-template-event-blocks .sp-event-block-venue,
.sp-template-event-blocks .sp-event-venue {
    color    : rgba(255,255,255,0.35) !important;
    font-size: 10px !important;
}

/* Botón Ver detalles */
.sp-template-event-blocks .sp-event-block-results a,
.sp-template-event-blocks .sp-event-block-link,
.sp-template-event-blocks a.btn,
.sp-template-event-blocks .sp-view-all-link {
    background    : var(--lpf-primary, #38a9ff) !important;
    color         : #fff !important;
    border-radius : 6px !important;
    border        : none !important;
    font-size     : 10px !important;
    font-weight   : 700 !important;
    text-transform: uppercase !important;
    padding       : 6px 14px !important;
    text-decoration: none !important;
    display       : inline-block !important;
}

/* Logos de equipos */
.sp-template-event-blocks .sp-event-block-teams img,
.sp-template-event-blocks .team-logo img {
    border-radius: 50% !important;
}

/* ── [team_standings] / [league_table] — Tabla nativa de SportsPress ── */

/* Wrapper de la tabla de posiciones */
.sp-template-league-table,
.sp-template-standings {
    border-radius: 12px;
    overflow     : hidden;
    border       : none !important;
}

/* Encabezado de la tabla */
.sp-template-league-table thead tr,
.sp-template-standings thead tr {
    background: #0B1D3D !important;
}
.sp-template-league-table thead th,
.sp-template-standings thead th {
    color         : rgba(255,255,255,0.55) !important;
    font-size     : 10px !important;
    font-weight   : 700 !important;
    letter-spacing: 0.4px !important;
    padding       : 10px 8px !important;
    border        : none !important;
    background    : transparent !important;
}

/* Filas de equipos */
.sp-template-league-table tbody tr,
.sp-template-standings tbody tr {
    border-bottom: 1px solid #f0f2f5 !important;
    border-left  : 4px solid transparent;
    transition   : background 0.15s;
}
.sp-template-league-table tbody tr:hover,
.sp-template-standings tbody tr:hover {
    background: #f7f9fc !important;
}

/* ── Indicadores de clasificación (rank 1 = semi, 2-3 = playoff) ─── */
.sp-template-league-table tbody tr:nth-child(1),
.sp-template-standings tbody tr:nth-child(1) {
    border-left-color: var(--lpf-semi, #00C9E4);
}
.sp-template-league-table tbody tr:nth-child(2),
.sp-template-league-table tbody tr:nth-child(3),
.sp-template-standings tbody tr:nth-child(2),
.sp-template-standings tbody tr:nth-child(3) {
    border-left-color: var(--lpf-playoff, #00C853);
}

/* Highlight nombres top 3 */
.sp-template-league-table tbody tr:nth-child(1) td.data-name,
.sp-template-standings tbody tr:nth-child(1) td.data-name {
    color      : var(--lpf-semi, #00C9E4) !important;
    font-weight: 700 !important;
}
.sp-template-league-table tbody tr:nth-child(2) td.data-name,
.sp-template-league-table tbody tr:nth-child(3) td.data-name,
.sp-template-standings tbody tr:nth-child(2) td.data-name,
.sp-template-standings tbody tr:nth-child(3) td.data-name {
    color      : var(--lpf-playoff, #00C853) !important;
    font-weight: 700 !important;
}

/* Celda de nombre */
.sp-template-league-table tbody td.data-name,
.sp-template-standings tbody td.data-name {
    color      : #1d2b3a !important;
    font-weight: 600 !important;
    text-align : left !important;
    padding-left: 14px !important;
}
.sp-template-league-table tbody td.data-name a,
.sp-template-standings tbody td.data-name a {
    color: inherit !important;
    text-decoration: none !important;
}

/* Celda de puntos */
.sp-template-league-table tbody td.data-pts,
.sp-template-league-table tbody td.data-sp_pts,
.sp-template-standings tbody td.data-pts {
    color      : #1d2b3a !important;
    font-weight: 800 !important;
    font-size  : 14px !important;
}

/* Resto de celdas */
.sp-template-league-table tbody td,
.sp-template-standings tbody td {
    border     : none !important;
    border-bottom: 1px solid #f0f2f5 !important;
    text-align : center !important;
    padding    : 10px 8px !important;
    color      : #6b7280 !important;
    font-size  : 13px !important;
    vertical-align: middle !important;
}

/* Logo del equipo inline */
.sp-template-league-table tbody td.data-name .team-logo,
.sp-template-league-table tbody td.data-name img {
    width        : 22px !important;
    height       : 22px !important;
    border-radius: 50% !important;
    object-fit   : contain !important;
    margin-right : 8px !important;
    vertical-align: middle !important;
}
/* Highlight logo top 3 */
.sp-template-league-table tbody tr:nth-child(1) td.data-name img {
    outline: 2px solid var(--lpf-semi, #00C9E4);
    outline-offset: 1px;
}
.sp-template-league-table tbody tr:nth-child(2) td.data-name img,
.sp-template-league-table tbody tr:nth-child(3) td.data-name img {
    outline: 2px solid var(--lpf-playoff, #00C853);
    outline-offset: 1px;
}

/* Título de la tabla SP (ocultar — no necesario con nuestro diseño) */
.sp-table-caption { display: none !important; }

/* DataTables controles — ocultar */
.sp-template-league-table .dataTables_wrapper .dataTables_filter,
.sp-template-league-table .dataTables_wrapper .dataTables_length,
.sp-template-league-table .dataTables_wrapper .dataTables_info,
.sp-template-standings .dataTables_wrapper .dataTables_filter { display: none !important; }
