/* =============================================================
   partidos.css — Mobile-first
   Breakpoints: 640 | 768 | 992 | 1200
   ============================================================= */

html { scroll-behavior: smooth; }

/* =============================================================
   1. CONTENEDOR
   ============================================================= */
.partidos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem;
}

@media (min-width: 768px)  { .partidos-container { padding: 2rem; } }

/* =============================================================
   2. TÍTULO
   ============================================================= */
.titulo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.titulo-container h1 {
    font-size: clamp(1.6rem, 5vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

/* =============================================================
   3. FILTROS COLAPSABLES
   ============================================================= */
.filter-details {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.filter-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 700;
    color: #094c79;
    font-size: 0.95rem;
    list-style: none;
    user-select: none;
}

.filter-summary::-webkit-details-marker { display: none; }

.filter-summary i:first-child { font-size: 1.1rem; }

.filter-chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.85rem;
}

.filter-details[open] .filter-chevron {
    transform: rotate(180deg);
}

/* Label "Filtros" visible en móvil como hint */
.filter-summary::after {
    content: 'Toca para filtrar';
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 400;
}

.filter-details[open] .filter-summary::after { content: ''; }

@media (min-width: 768px) {
    .filter-summary::after { display: none; }
}

.partidos-filter-form {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid #f0f4f8;
}

.filter-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding-top: 1rem;
}

@media (min-width: 640px)  { .filter-group { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px)  { .filter-group { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .filter-group { grid-template-columns: repeat(6, 1fr); } }

.filter-item label {
    display: block;
    margin-bottom: 0.3rem;
    color: #094c79;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.filter-select,
.filter-item input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #333;
    font-size: 0.88rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus,
.filter-item input[type="text"]:focus {
    border-color: #094c79;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(9,76,121,0.1);
}

.filter-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #094c79;
    color: #fff;
    padding: 0.7rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    margin-top: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.filter-button:hover  { background: #063860; }
.filter-button:active { transform: scale(0.97); }

/* =============================================================
   4. SECCIÓN CAMPEONATO
   ============================================================= */
.campeonato-section { margin-bottom: 3rem; }

.campeonato-fecha-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin: 2rem 0 1.25rem;
}

.campeonato-title {
    color: #fff;
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    font-weight: 800;
    text-align: left;
    padding-bottom: 0.6rem;
    margin: 0;
    position: relative;
}

.campeonato-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: #ffd700;
    border-radius: 3px;
}

/* =============================================================
   5. FECHA Y DÍA
   ============================================================= */
.fecha-seccion { margin-bottom: 2rem; }

.dia-seccion { margin: 0.75rem 0 1.25rem; }

.dia-title {
    color: #094c79;
    font-size: 0.96rem;
    font-weight: 700;
    text-align: left;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    padding: 0.4rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: fit-content;
    margin: 0 0 0.85rem 0;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dia-title i,
.fecha-numerica-title i {
    font-size: 0.9em;
}

.dia-title-libres {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.dia-seccion .table-responsive {
    overflow-x: visible;
}

.libres-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: min(100%, 380px);
    margin: 0 auto;
}

.libre-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.95rem;
    background: #fff;
    border: 1px solid #e6edf5;
    border-left: 4px solid #094c79;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    padding: 0.85rem 1rem;
}

.libre-serie {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    background: #094c79;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 999px;
    padding: 0.28rem 0.68rem;
    white-space: nowrap;
}

.libre-equipo {
    margin: 0;
    color: #1a1a2e;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    line-height: 1.25;
}

/* =============================================================
   6. TABLA — VERSIÓN MÓVIL (cards) < 768px
   ============================================================= */
.table-responsive { margin-bottom: 0.75rem; }

/* ---- CARD MODE (móvil) ---- */
@media (max-width: 767px) {

    /* Ocultar thead; convertir tabla/tbody/tr en bloques */
    .partidos-table.compact thead { display: none; }

    .partidos-table.compact,
    .partidos-table.compact tbody { display: block; width: 100%; }

    /* — Tarjeta compacta con grid de 3 filas — */
    .partidos-table.compact tr {
        display: grid;
        grid-template-areas:
            "serie  serie  hora"
            "local  goles  visita"
            "estado estado cancha";
        grid-template-columns: 1fr auto 1fr;
        grid-template-rows: auto auto auto;
        background: #fff;
        border-radius: 10px;
        margin-bottom: 0.5rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.07);
        border: 1px solid #eef2f7;
        overflow: hidden;
    }

    /* Suprimir pseudo-labels heredados */
    .partidos-table.compact td::before { display: none; }
    .partidos-table.compact td { border: none; padding: 0; }

    .libre-card {
        gap: 0.7rem;
        padding: 0.7rem 0.8rem;
    }

    .libre-serie {
        font-size: 0.65rem;
        padding: 0.24rem 0.52rem;
    }

    .libre-equipo {
        font-size: 0.8rem;
    }

    /* ── FILA SUPERIOR: serie (izq) + hora (der) ── */
    .partidos-table.compact td.serie {
        grid-area: serie;
        align-self: center;
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        font-weight: 700;
        color: #fff;
        background: #094c79;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .partidos-table.compact td.hora {
        grid-area: hora;
        align-self: center;
        padding: 0.3rem 0.65rem;
        font-size: 0.7rem;
        font-weight: 600;
        color: #fff;
        background: #094c79;
        white-space: nowrap;
        text-align: right;
    }

    /* ── FILA CENTRAL: local | score | visita ── */
    .partidos-table.compact td.local {
        grid-area: local;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.5rem 0.4rem;
        text-align: center;
    }

    .partidos-table.compact td.visita {
        grid-area: visita;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.5rem 0.4rem;
        text-align: center;
    }

    .partidos-table.compact td.goles {
        grid-area: goles;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.4rem 0.35rem;
        align-self: center;
    }

    .partidos-table.compact td.goles .score {
        font-size: 0.78rem;
        padding: 0.2rem 0.5rem;
        min-width: 40px;
        border-radius: 5px;
    }

    /* Logos en central */
    .partidos-table.compact td.local .team-logo,
    .partidos-table.compact td.visita .team-logo {
        width: 34px;
        height: 34px;
        object-fit: contain;
        border-radius: 50%;
        border: 1px solid #eef2f7;
        flex-shrink: 0;
    }

    .partidos-table.compact td.local .team-name,
    .partidos-table.compact td.visita .team-name {
        font-size: 0.65rem;
        font-weight: 600;
        color: #1a1a2e;
        line-height: 1.2;
        line-clamp: 2;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .partidos-table.compact td.local .team-container,
    .partidos-table.compact td.visita .team-container {
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        justify-content: center;
    }

    /* ── FILA INFERIOR: estado | cancha ── */
    .partidos-table.compact td.estado {
        grid-area: estado;
        display: flex;
        align-items: center;
        padding: 0.25rem 0.6rem;
        background: #f8fafc;
        border-top: 1px solid #eef2f7;
    }

    .partidos-table.compact td.estado .status-badge {
        font-size: 0.62rem;
        padding: 0.15rem 0.5rem;
    }

    .partidos-table.compact td.cancha {
        grid-area: cancha;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.25rem 0.6rem;
        font-size: 0.65rem;
        font-weight: 600;
        color: #094c79;
        background: #f8fafc;
        border-top: 1px solid #eef2f7;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* =============================================================
   7. TABLA — VERSIÓN DESKTOP ≥ 768px
   ============================================================= */
@media (min-width: 768px) {
    .partidos-table.compact {
        width: 100%;
        table-layout: fixed;
        background: #fff;
        border-radius: 12px;
        overflow: hidden;
        border-collapse: collapse;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    }

    .partidos-table.compact thead {
        background: linear-gradient(90deg, #094c79 0%, #0b1138 100%);
    }

    .partidos-table.compact th {
        padding: 0.85rem 0.75rem;
        color: #fff;
        font-weight: 700;
        font-size: 0.82rem;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    .partidos-table.compact tbody tr {
        transition: background 0.15s;
    }

    .partidos-table.compact tbody tr:nth-child(even) { background: #f8fafc; }
    .partidos-table.compact tbody tr:nth-child(odd)  { background: #fff; }
    .partidos-table.compact tbody tr:hover           { background: #eef6fd; }

    .partidos-table.compact td {
        padding: 0.75rem;
        border-bottom: 1px solid #eef2f7;
        color: #333;
        font-size: 0.88rem;
        vertical-align: middle;
    }

    /* Anchos columnas */
    .partidos-table.compact .hora  { width: 5%;  text-align: center; font-weight: 700; }
    .partidos-table.compact .serie { width: 9%;  font-size: 0.82rem; }
    .partidos-table.compact .equipo{ width: 15%; }
    .partidos-table.compact .goles { width: 11%; text-align: center; }
    .partidos-table.compact .estado{ width: 12%; }
    .partidos-table.compact .cancha{ width: 11%; }

    .partidos-table.compact th.cancha,
    .partidos-table.compact td.cancha {
        text-align: center;
        justify-content: center;
    }

    .partidos-table.compact td.hora,
    .partidos-table.compact td.serie {
        color: #094c79;
    }

    .partidos-table.compact td.cancha {
        color: #2f3b4a;
        font-size: 0.82rem;
        font-weight: 600;
    }

    .partidos-table.compact th.th-local {
        text-align: right;
    }

    .partidos-table.compact td.local .team-container {
        justify-content: flex-end;
    }

    .partidos-table.compact td.visita .team-container {
        justify-content: flex-start;
    }

    .partidos-table.compact td.local .team-name {
        text-align: right;
    }

    .partidos-table.compact td.visita .team-name {
        text-align: left;
    }

    .partidos-table.compact td.equipo .team-name {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        white-space: normal;
        line-height: 1.2;
        min-height: 2.4em;
        overflow: hidden;
    }
}

/* =============================================================
   8. EQUIPO (logo + nombre) — común a ambos modos
   ============================================================= */
.team-container {
    display: flex;
    align-items: center;
    gap: 7px;
}

.team-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 4px;
    background: #f0f4f8;
    flex-shrink: 0;
}

.team-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

@media (min-width: 992px) { .team-name { max-width: 180px; } }

/* =============================================================
   9. MARCADOR
   ============================================================= */
.score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #0b1138;
    color: #fff;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.95rem;
    min-width: 52px;
    letter-spacing: 1px;
}

.score .separator { color: rgba(255,255,255,0.4); font-weight: 400; }

/* =============================================================
   10. ESTADO (badges)
   ============================================================= */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.status-badge.finalizado   { background: #dcfce7; color: #166534; }
.status-badge.no.jugado    { background: #fef9c3; color: #854d0e; }
.status-badge.suspendido   { background: #fee2e2; color: #991b1b; }
.status-badge.retirado     { background: #f3e8ff; color: #6b21a8; }
.status-badge.sancionado   { background: #ffedd5; color: #9a3412; }
.status-badge.libre        { background: #e0f2fe; color: #0369a1; }

/* =============================================================
   11. PAGINACIÓN
   ============================================================= */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 0.5rem;
    flex-wrap: wrap;
}

.pagination-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-pagination:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-pagination:active {
    transform: scale(0.96) translateY(0);
    box-shadow: none;
}

/* =============================================================
   12. SIN RESULTADOS
   ============================================================= */
.no-results {
    background: rgba(255,255,255,0.08);
    padding: 3rem 1.25rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0;
    backdrop-filter: blur(4px);
}

.no-results i      { font-size: 2.5rem; color: #ffd700; margin-bottom: 0.75rem; display: block; }
.no-results h3     { font-size: 1.2rem; color: rgba(255,255,255,0.85); }
