/**
 * Styles for Partidos Shortcodes (v20.0 - Goleadores en Lista Vertical)
 */

/* =========================================
   PROTECCIÓN DE IMÁGENES
   ========================================= */
.img-protected {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

/* =========================================
   1. TARJETAS ESTÁNDAR
   ========================================= */
.partido-card {
    box-sizing: border-box;
    background: #ffffff;
    color: #1a202c;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    border-radius: 16px; 
    padding: 20px;
    width: 100%;
    max-width: 540px;
    margin: 20px auto; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); 
    border: 1px solid #edf2f7;
    overflow: hidden;
}

.partido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    color: #2d3748;
}

.partido-header .header-title {
    font-weight: 800;
    font-size: 1.1em;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.partido-header .torneo {
    background-color: #3182ce;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.partido-body {
    display: flex;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    margin-bottom: 10px;
}

.partido-body .team {
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.partido-body .team p {
    color: #2d3748;
    font-weight: 700;
    margin: 8px 0 0 0;
    font-size: 0.9em;
    line-height: 1.2;
}

/* LOGOS GRANDES */
.team-logo {
    width: 70px; 
    height: 70px;
    border-radius: 50%; 
    object-fit: contain;
    margin: 0 auto;
    filter: drop-shadow(0 4px 3px rgba(0,0,0,0.07));
}

.team-logo.placeholder-logo { padding: 10px; box-sizing: border-box; border: 2px dashed #cbd5e0; background: #fff; }

.partido-body .vs, .partido-body .score { font-size: 1.8em; font-weight: 800; color: #a0aec0; white-space: nowrap !important; }
.partido-body .vs-image { width: 40px; height: auto; opacity: 0.8; }
.partido-body .score { font-size: 2.5em; color: #2d3748; line-height: 1; margin: 0 10px; }

.penales-score {
    font-size: 0.45em;
    color: #718096;
    font-weight: 600;
    margin-top: 5px;
    text-align: center;
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap !important;
    display: inline-block;
}

/* =========================================
   GOLEADORES MODERNOS (Listas Verticales Compactas)
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 0 0 15px 0;
    padding: 12px 5px;
    border-top: 1px solid #edf2f7; /* Separador muy suave */
    font-size: 0.85em;
    color: #4a5568;
    position: relative;
}

.scorer-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 45%; /* Asegurar que no se toquen */
}

/* Alineación Local: Derecha (hacia el centro) */
.scorer-column.local { 
    text-align: right; 
    align-items: flex-end; /* Alineación Flex */
    padding-right: 15px;
    border-right: 1px solid #f7fafc; 
}

/* Alineación Visita: Izquierda (hacia el centro) */
.scorer-column.visita { 
    text-align: left; 
    align-items: flex-start; /* Alineación Flex */
    padding-left: 15px;
}

/* Ítem Individual de Goleador */
.scorer-item {
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9em;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 6px; /* Espacio entre texto y balón */
}

/* Orden para local: Texto - Balón */
.scorer-column.local .scorer-item {
    justify-content: flex-end; 
    flex-direction: row; 
}

/* Orden para visita: Balón - Texto */
.scorer-column.visita .scorer-item {
    justify-content: flex-start;
    flex-direction: row; 
}

.ball-icon {
    font-size: 0.85em;
    opacity: 0.8;
    display: inline-block;
}

/* Spacer */
.scorer-spacer { width: 2px; }

/* =========================================
   DETALLES GENERALES (Más compactos)
   ========================================= */
.partido-details { 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #f8fafc !important; 
    border-radius: 12px !important; 
    padding: 12px 15px !important; /* Relleno interior mucho menor */
    margin: 15px 0 !important; 
    border: 1px solid #edf2f7 !important;
}

.partido-details p { 
    margin: 0; 
    line-height: 1.2; 
    text-align: center;
    width: 100%;
}

/* 1. Categoría (Primer texto) */
.partido-details p:nth-child(1) { 
    font-weight: 600 !important; 
    color: #4a5568 !important; 
    text-transform: uppercase !important; 
    font-size: 0.75em !important; 
    letter-spacing: 0.5px !important; 
    margin-bottom: 4px !important; /* Espacio mínimo hacia el estadio */
}

/* 2. Estadio / Ubicación (Segundo texto) */
.partido-details p:nth-child(2) { 
    font-weight: 900 !important; 
    color: #1a202c !important; 
    font-size: 1.05em !important; 
    margin-bottom: 4px !important; /* Espacio mínimo hacia la fecha */
}

/* 3. Fecha y Hora (Tercer texto) */
.partido-details p:nth-child(3) { 
    font-weight: 700 !important; 
    color: #2b6cb0 !important; 
    font-size: 0.9em !important; 
}

/* DETALLES DE PENALES */
.penales-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e0;
    font-size: 0.85em;
    color: #4a5568;
    font-style: italic;
    width: 100%;
    text-align: center;
}

.partido-countdown {
    display: flex; flex-direction: column; align-items: center;
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
    color: #ffffff;
    padding: 12px; border-radius: 10px;
    box-shadow: 0 4px 6px rgba(49, 130, 206, 0.3);
}
.partido-countdown .countdown-title { margin: 0; padding: 0 0 6px 0; font-weight: 700; text-transform: uppercase; font-size: 0.75em; letter-spacing: 1px; opacity: 0.9; }
.countdown-timer { display: flex; justify-content: center; align-items: baseline; }
.countdown-timer > div { font-weight: 700; font-size: 0.7em; padding: 0 6px; text-align: center; text-transform: uppercase; opacity: 0.9; }
.countdown-timer .separator { font-size: 2em; font-weight: 300; color: #90cdf4; padding: 0 2px; position: relative; top: -5px; }
.countdown-timer > div span { display: block; font-size: 3em; line-height: 1; color: #ffffff; margin-bottom: 2px; font-variant-numeric: tabular-nums; opacity: 1; }

.partido-message-box {
    text-align: center; padding: 10px; font-weight: 700; border-radius: 8px; margin-top: 10px;
    text-transform: uppercase; font-size: 0.85em; letter-spacing: 0.5px;
}
.partido-message-box.suspendido { background: #fed7d7; color: #9b2c2c; border: 1px solid #feb2b2; }
.partido-message-box.postergado { background: #fefcbf; color: #975a16; border: 1px solid #fbd38d; }

/* =========================================
   2. SLIDER
   ========================================= */
.partido-slider { position: relative; width: 100%; max-width: 540px; margin: 20px auto; }
.partido-slider .partido-card { display: none; width: 100%; margin: 0; box-sizing: border-box; animation: fadeEffect 0.8s ease-in-out; }
.partido-slider .partido-card.active { display: block; }
@keyframes fadeEffect { from {opacity: 0.4; transform: translateY(5px);} to {opacity: 1; transform: translateY(0);} }

/* =========================================
   PARTIDO EN VIVO PUBLICO
   ========================================= */
.partidos-live-score {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #111827;
    font-variant-numeric: tabular-nums;
    min-width: 86px;
}

@media screen and (min-width: 1200px) {
    /* Salient limita .main-content a 1280px con 90px laterales. Solo la fila de
       marcadores necesita usar el ancho amplio disponible del escritorio. */
    .container.main-content:has(.row_col_wrap_12 > .vc_col-sm-4 .partido-card) {
        width: calc(100% - 64px) !important;
        max-width: 1700px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

.partidos-live-score-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.partido-card.is-live-match .partidos-live-score-wrap {
    display: flex;
}

.partidos-live-shootout-score {
    margin-top: 5px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.7em;
    line-height: 1.2;
    font-weight: 800;
}

.partidos-live-shootout-detail {
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #f8fafc;
}

.partidos-live-shootout-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid #dbe3ec;
    font-size: 0.76em;
}

.partidos-live-shootout-head strong:last-child {
    text-align: right;
}

.partidos-live-shootout-head b {
    color: #dc2626;
    white-space: nowrap;
}

.partidos-live-shootout-kicks {
    display: grid;
    gap: 4px;
    margin-top: 7px;
}

.partidos-live-shootout-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px 18px 20px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    font-size: 0.72em;
}

.partidos-live-shootout-row > span:not(.shootout-player) {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 900;
}

.partidos-live-shootout-row .is-scored { background: #16a34a; }
.partidos-live-shootout-row .is-failed { background: #dc2626; }
.partidos-live-shootout-row .is-pending { background: #94a3b8; }
.partidos-live-shootout-row em { color: #64748b; text-align: center; font-style: normal; font-weight: 700; }
.partidos-live-shootout-row .shootout-player { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partidos-live-shootout-row .shootout-player.is-away { text-align: right; }

.partidos-live-score strong {
    font-size: 2.7em;
    line-height: 1;
    font-weight: 900;
}

.partidos-live-score em {
    color: #94a3b8;
    font-style: normal;
    font-size: 1.8em;
    font-weight: 800;
}

.partidos-live-panel {
    display: none;
    margin-top: 14px;
    border-radius: 14px;
    padding: 0;
    background: #ffffff;
    color: #111827;
}

.partidos-live-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.75em;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #111827;
}

.partidos-live-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #dc2626;
    color: #ffffff;
    padding: 4px 9px;
    border-radius: 999px;
    text-transform: none;
    letter-spacing: 0;
}

.partidos-live-dot::before {
    content: none;
}

.partidos-live-clock-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    margin-top: 5px;
    width: 100%;
}

.partidos-live-clock {
    display: block;
    margin-top: 0;
    text-align: center;
    font-size: 1.05em;
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #111827;
    text-decoration: underline;
    text-decoration-color: #dc2626;
    text-underline-offset: 6px;
}

.partidos-live-extra {
    display: block;
    margin: 0;
    text-align: center;
    color: #dc2626;
    font-size: 0.82em;
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.partidos-live-extra[hidden] {
    display: none;
}

.partidos-live-stoppage {
    margin-top: 5px;
    text-align: center;
    color: #64748b;
    font-size: 0.72em;
    line-height: 1;
    font-weight: 700;
}

.partidos-live-timeline-title {
    margin: 18px 0 10px !important;
    color: #111827 !important;
    font-size: 0.95em !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    text-align: left;
}

.partidos-live-timeline {
    display: grid;
    gap: 12px;
    grid-auto-rows: max-content;
    align-content: start;
    max-height: 410px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

.partidos-live-event,
.partidos-live-empty {
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid #d9dde3;
    background: #ffffff;
    color: #111827;
    font-size: 0.86em;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.partidos-live-event {
    width: fit-content;
    min-width: 130px;
    max-width: 82%;
    box-sizing: border-box;
}

.partidos-live-event.is-home {
    justify-self: start;
    border-left: 3px solid #3182ce;
}

.partidos-live-event.is-away {
    justify-self: end;
    text-align: right;
    border-right: 3px solid #64748b;
}

.partidos-live-event.is-milestone {
    width: fit-content;
    min-width: 120px;
    max-width: 78%;
    justify-self: center;
    align-self: start;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 12px;
    text-align: center;
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: none;
}

.partidos-live-event.is-milestone strong {
    color: #334155;
    font-size: 0.9em;
}

.partidos-live-event.is-milestone em {
    color: #64748b;
    font-size: 0.8em;
    font-style: normal;
    font-weight: 800;
}

.partidos-live-event.is-away .partidos-live-event-head,
.partidos-live-event.is-away .partidos-live-event-person {
    flex-direction: row-reverse;
}

.partidos-live-event-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.partidos-live-event-head strong {
    color: #111827;
    font-size: 0.96em;
}

.partidos-live-event-head em {
    color: #6b7280;
    font-style: normal;
    font-weight: 800;
}

.partidos-live-event span {
    display: block;
    color: #374151;
    font-size: 1.05em;
}

.partidos-live-event .partidos-live-event-team {
    margin-bottom: 5px;
    color: #64748b;
    font-size: 0.78em;
    line-height: 1.15;
    font-weight: 700;
}

.partidos-live-event-person {
    display: flex;
    align-items: center;
    gap: 9px;
}

.partido-card.is-live-match .partidos-live-event-person > img.partidos-live-player-avatar {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    flex: 0 0 24px !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50%;
    object-fit: cover !important;
    object-position: center !important;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #3182ce;
}

.partidos-live-event-player {
    min-width: 0;
    line-height: 1.25;
}

.partidos-live-change-line {
    display: flex !important;
    align-items: center;
    gap: 5px;
}

.partidos-live-change-line + .partidos-live-change-line {
    margin-top: 3px;
}

.partidos-live-change-line b {
    font-size: 1.25em;
    line-height: 1;
}

.partidos-live-change-line.is-in b {
    color: #16a34a;
}

.partidos-live-change-line.is-out b {
    color: #dc2626;
}

.partidos-live-event.is-away .partidos-live-change-line {
    flex-direction: row-reverse;
}

.partidos-live-event .partidos-live-event-notes {
    margin-top: 7px;
    color: #64748b;
    font-size: 0.94em;
}

.partido-card.is-live-match .partido-countdown {
    display: none !important;
}

.partido-card.is-live-match .partidos-live-panel,
.partido-card.is-live-match .partidos-live-score {
    display: flex;
}

.partido-card.is-live-match .partidos-live-panel {
    display: block;
}

.partido-card.is-live-match .live-switch-vs {
    display: none !important;
}

.partido-card.is-live-match .partido-details-box {
    margin-top: 6px !important;
    padding: 9px 8px !important;
}

/* Densidad compacta exclusiva para el marcador en vivo. */
.partido-card.is-live-match {
    padding: 14px;
    height: min(720px, calc(100svh - 110px));
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.partido-card.is-live-match .partido-header {
    margin-bottom: 9px;
}

.partido-card.is-live-match .partido-header .torneo {
    padding: 5px 10px;
}

.partido-card.is-live-match .partido-body {
    margin-bottom: 5px !important;
}

.partido-card.is-live-match .partido-body .team-logo {
    width: 56px !important;
    height: 56px !important;
}

.partido-card.is-live-match .partido-body .team > div {
    margin-top: 5px !important;
    font-size: 0.88em !important;
}

.partido-card.is-live-match .partidos-live-score strong {
    font-size: 2.3em;
}

.partido-card.is-live-match .partidos-live-score em {
    font-size: 1.45em;
}

.partido-card.is-live-match .partido-details-box > div {
    margin-bottom: 5px !important;
}

.partido-card.is-live-match .partido-details-box > div:last-child {
    margin-bottom: 0 !important;
}

.partido-card.is-live-match .partidos-live-panel {
    margin-top: 10px;
    min-height: 0;
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
}

.partido-card.is-live-match .partidos-live-dot {
    padding: 3px 8px;
}

.partido-card.is-live-match .partidos-live-clock {
    margin-top: 0;
}

.partido-card.is-live-match .partidos-live-timeline-title {
    margin: 13px 0 7px !important;
}

.partido-card.is-live-match .partidos-live-timeline {
    gap: 8px;
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    overflow-y: auto;
}

.partido-card.is-live-match .partidos-live-event,
.partido-card.is-live-match .partidos-live-empty {
    padding: 9px 11px;
}

.partido-card.is-live-match .partidos-live-event-head {
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.partido-card.is-live-match .partidos-live-event-notes {
    margin-top: 4px;
}


/* =========================================
   3. CALENDARIO ESTILOS
   ========================================= */
.calendario-card { padding: 15px; background: #fff; }
.calendario-card .partido-header { 
    border-bottom: none; 
    margin-bottom: 15px; 
    padding-bottom: 0; 
}
.calendario-list { display: flex; flex-direction: column; gap: 8px; }

.calendario-row {
    display: flex; 
    align-items: center; 
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calendario-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    background: #ffffff;
    border-color: #cbd5e0;
}

.calendario-row.is-suspended { 
    background-color: #fff5f5; 
    border-color: #feb2b2;
}

.cal-date {
    width: 45px; min-width: 45px;
    text-align: center; 
    font-weight: 800; 
    color: #2b6cb0; 
    font-size: 0.8em;
    line-height: 1; 
    text-transform: uppercase;
    background: #ebf8ff;
    border-radius: 8px;
    padding: 6px 2px;
    margin-right: 10px;
    display: flex; flex-direction: column; justify-content: center;
    border: none;
}
.cal-date span { 
    display: block; 
    font-size: 0.85em; 
    font-weight: 600; 
    color: #4299e1; 
    margin-top: 3px; 
}

.cal-match { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; }

.cal-team {
    flex: 1; font-size: 0.85em; font-weight: 700; color: #2d3748;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.cal-team.tr { text-align: right; }
.cal-team.tl { text-align: left; }

.cal-team-logo {
    width: 24px !important; height: 24px !important;
    min-width: 24px !important; min-height: 24px !important;
    object-fit: contain; margin: 0 6px; flex-shrink: 0;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
    background: transparent; border: none; border-radius: 0;
}

.cal-vs { 
    font-size: 0.7em; color: #cbd5e0; font-weight: 700; 
    margin: 0 2px; flex-shrink: 0; text-transform: lowercase; 
}

.cal-category {
    width: auto; 
    min-width: fit-content;
    padding-left: 10px; 
    border-left: none;
    display: flex; align-items: center; justify-content: flex-end;
}
.cat-badge {
    background: #edf2f7;
    color: #718096;
    font-size: 0.6em;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Mobile Adjustments */
@media screen and (max-width: 480px) {
    .partido-card { padding: 15px; }
    
    .cal-date { width: 40px; min-width: 40px; font-size: 0.75em; padding: 4px 2px; margin-right: 8px; }
    .cal-team { font-size: 0.75em; }
    .cal-team-logo { margin: 0 3px; width: 20px !important; height: 20px !important; }
    .cat-badge { font-size: 0.55em; padding: 2px 4px; }
    
    .team-logo { width: 55px; height: 55px; }
    .partido-body .vs { font-size: 1.5em !important; margin: 0 5px !important; }
    .partido-body .score { font-size: 2.2em !important; margin: 0 5px !important; }
    .countdown-timer > div span { font-size: 2.5em; }

    .partido-card.is-live-match { padding: 12px; }
    .partido-card.is-live-match .partido-header { margin-bottom: 7px; }
    .partido-card.is-live-match .partido-body .team-logo { width: 48px !important; height: 48px !important; }
    .partido-card.is-live-match .partidos-live-score strong { font-size: 2.05em; }
    .partido-card.is-live-match .partido-details-box { padding: 8px 6px !important; }
    .partido-card.is-live-match { height: calc(100svh - 105px); max-height: 680px; margin-top: 8px; margin-bottom: 8px; }
    .partido-card.is-live-match .partidos-live-timeline { max-height: none; }
    .partido-card.is-live-match .partidos-live-event { width: fit-content; min-width: 130px; max-width: 86%; }
}
