/**
 * Estilos para la visualización de fechas de torneos y detalles de resultados
 */

/* Contenedor principal */
.csm-fixtures-container,
.csm-all-fixtures-container,
.csm-match-details-container {
    max-width: 100%;
    margin: 0 auto 30px;
    font-family: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #226334; /* Verde principal */
    color: #fff;
    padding: 20px;
    border-radius: 8px;
}

/* Título */
.csm-fixtures-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #fff;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

/* Filtros */
.csm-fixtures-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.csm-tournament-filter,
.csm-category-filter,
.csm-date-number-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.csm-filter-select {
    padding: 8px 12px;
    border: 1px solid #fff;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
    min-width: 200px;
}

.csm-filter-select option {
    background-color: #226334;
    color: #fff;
}

/* Navegación de fechas */
.csm-fixtures-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 5px;
}

.csm-nav-button {
    padding: 8px 15px;
    background-color: #f2c94c;
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.csm-nav-button:hover {
    background-color: #e0b93e;
}

.csm-nav-button:disabled {
    background-color: rgba(242, 201, 76, 0.5);
    color: rgba(0, 0, 0, 0.5);
    cursor: not-allowed;
}

.csm-current-date-display {
    font-size: 18px;
    font-weight: 600;
}

/* Contenido de partidos (Fixtures) */
.csm-fixtures-content {
    position: relative;
    min-height: 100px; /* Reducido */
}

.csm-fixtures-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(34, 99, 52, 0.9);
    z-index: 10;
    font-size: 18px;
    color: #fff;
}

/* Grupos de partidos (Fixtures) */
.csm-fixtures-group {
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.csm-fixtures-group-header {
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

/* Estilo Fila de Partido (Fixture List) */
.csm-match-row {
    display: flex;
    align-items: center;
    padding: 30px 0px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.csm-match-row:last-child { border-bottom: none; }
.csm-match-row:hover { background-color: rgba(255, 255, 255, 0.05); }

.csm-match-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s;
}
.csm-match-link:hover { background-color: rgba(255, 255, 255, 0.1); color: #fff; text-decoration: none; }

/* Contenedor Equipos vs Equipos */
.csm-match-teams-vs-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    gap: 15px;
}

/* Estilo Equipo Individual (Fixture List) */
.csm-match-team-fixture {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 110px;
}
.csm-team-local { align-items: center; text-align: center; }
.csm-team-visitor { align-items: center; text-align: center; }

.csm-fixture-team-logo {
    max-width: 50px;
    max-height: 50px;
    height: auto;
    margin-bottom: 8px;
    object-fit: contain;
    border-radius: 0;
}
.csm-fixture-no-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
    border-radius: 4px;
}
.csm-fixture-team-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

/* Separador VS */
.csm-match-vs-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #1a4d28;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

/* Contenedor Info Derecha (Resultado/Hora y Sede) */
.csm-match-info-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-shrink: 0;
    width: 150px;
    margin-left: 15px;
}

.csm-match-score-fixture,
.csm-match-time-fixture { /* Estilo común para score y time */
    font-size: 18px;
    font-weight: 700;
    color: #f2c94c;
    margin-bottom: 5px;
    min-height: 25px; /* Asegura altura mínima */
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.csm-match-venue-fixture {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}
.csm-venue-icon { font-size: 1.1em; }


/* Mensajes de error y sin partidos */
.csm-error {
    padding: 15px;
    background-color: rgba(255, 0, 0, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: 20px;
}

.csm-no-matches {
    padding: 30px 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

/* --- Estilos para Detalles de Resultado --- */

.csm-match-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.csm-match-tournament-info { flex: 1; }
.csm-match-tournament { margin: 0 0 10px; font-size: 24px; font-weight: 700; color: #fff; }
.csm-match-category { margin: 0 0 5px; font-size: 18px; font-weight: 500; color: rgba(255, 255, 255, 0.8); }
.csm-match-date-number { display: inline-block; padding: 5px 10px; background-color: rgba(255, 255, 255, 0.1); border-radius: 4px; font-size: 14px; font-weight: 600; color: #f2c94c; }
.csm-match-datetime { text-align: right; }
.csm-match-date { font-size: 16px; margin-bottom: 5px; color: rgba(255, 255, 255, 0.8); }
.csm-match-time { font-size: 20px; font-weight: 700; color: #f2c94c; margin-bottom: 5px; }
.csm-match-venue-header { font-size: 14px; color: rgba(255, 255, 255, 0.7); }

.csm-match-teams-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.csm-match-teams-result img{
    max-width:70px;
}

.csm-match-team {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.csm-match-team-local {
    align-items: anchor-center;
    text-align: center;
    padding-right: 0px;
}

.csm-match-team-visitor {
    align-items: anchor-center;
    text-align: center;
    padding-left: 20px;
}

.csm-team-logo {
    max-width: 100px;
    height: auto;
    max-height: 100px;
    margin-bottom: 5px;
    border-radius: 0;
    object-fit: contain;
    border: none;
}

.csm-team-name { font-size: 20px; font-weight: 700; color: #fff; }
.csm-match-result { padding: 0 20px; }
.csm-match-score { font-size: 32px; font-weight: 700; color: #f2c94c; }

/* Contenedor del resumen */
.csm-result-summary {
    padding: 0px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.csm-summary-section {
    padding: 1px;
    border-radius: 10px;
}
.csm-summary-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.csm-summary-section h4 { margin: 0 0 15px; font-size: 18px; font-weight: 600; color: #f2c94c; text-align: center; }

/* MVP Resumen */
.csm-summary-mvp { 
    text-align: center;
    min-width: 200px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
 }
.csm-result-summary .csm-mvp-photo {
    width: 80px;
    height: 80px;
    border-radius: 50% !important;
    object-fit: cover;
    border: 2px solid #f2c94c;
    margin: 0 auto 15px;
    display: block;
    box-shadow: none !important;
}
.csm-summary-mvp .csm-mvp-name { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 10px; }
.csm-summary-mvp .csm-mvp-comment { font-size: 14px; color: rgba(255, 255, 255, 0.8); text-align: center; font-style: italic; }
.csm-summary-mvp .csm-mvp-comment p { margin: 0; }

/* Columnas Resumen (Goles, Tarjetas) */
.csm-summary-columns { display: flex; gap: 20px; }
.csm-summary-col { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.csm-summary-col-local { align-items: flex-start; text-align: left; }
.csm-summary-col-visitor { align-items: flex-end; text-align: right; }
.csm-summary-item { display: flex; align-items: center; font-size: 14px; }
.csm-summary-col-local .csm-summary-item { justify-content: flex-start; }
.csm-summary-col-visitor .csm-summary-item { justify-content: flex-end; flex-direction: row-reverse; }
.csm-summary-icon { margin: 0 8px; font-size: 1.1em; }
 .csm-summary-col-visitor .csm-summary-icon { margin: 0 0 0 8px; }

/* --- Estilos para Minuto a Minuto (3 columnas) --- */

/* Estilos para destacar eventos en la timeline */
.csm-timeline-col-local .csm-timeline-text-content,
.csm-timeline-col-visitor .csm-timeline-text-content,
.csm-timeline-col-full .csm-timeline-content-center {
    background: rgba(0, 0, 0, 0.15); /* Fondo oscuro sutil, ajustar color/opacidad */
    padding: 8px 12px; /* Padding más ajustado */
    border-radius: 6px; /* Bordes redondeados */
    display: inline-block; /* Ajustar al contenido */
    width: auto; 
    max-width: 100%; 
    box-sizing: border-box;
    margin-bottom: 5px; /* Espacio inferior */
    color: #fff; /* Asegurar texto blanco */
}

/* Asegurar que el contenedor de texto crezca si hay foto */
.csm-timeline-col-local .csm-timeline-text-content,
.csm-timeline-col-visitor .csm-timeline-text-content {
    flex-grow: 1; 
}

/* Estilo para la descripción dentro del recuadro */
.csm-timeline-description {
    display: block; 
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 5px;
    padding-left: 0; 
    width: 100%; 
    color: rgba(255, 255, 255, 0.8); /* Color ligeramente más tenue */
}
.csm-timeline-col-local .csm-timeline-description { text-align: left; }
.csm-timeline-col-visitor .csm-timeline-description { text-align: right; }
.csm-timeline-col-full .csm-timeline-description { text-align: center; }

/* Ajustes para eventos centrales */
.csm-timeline-col-full {
    text-align: center; 
}
.csm-timeline-col-full .csm-timeline-content-center {
     margin: 5px 0; 
}

/* Ajustar el contenedor principal de la columna para que el fondo no interfiera */
.csm-timeline-col {
    padding: 5px; /* Añadir padding a la columna para separar las cajas */
}
.csm-timeline-col-local,
.csm-timeline-col-visitor {
    /* Mantener flex-start para alinear foto y caja de texto */
    align-items: flex-start; 
}


.csm-timeline-columns-container {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    margin-top: 30px;
    background-color: #173d22; /* Verde más oscuro */
    border-radius: 8px;
}
.csm-timeline-columns-container h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #f2c94c;
}

.csm-timeline-columns {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.csm-timeline-row {
    display: flex;
    width: 100%;
    align-items: flex-start;
    min-height: 45px;
    padding: 5px 0;
}
.csm-timeline-row-center {
    justify-content: center;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    margin: 8px 0;
    padding: 8px 0;
    min-height: auto;
}

.csm-timeline-col {
    padding: 0 5px;
    display: flex;
    line-height: 1.4;
    font-size: 14px;
}

.csm-timeline-col-local {
    flex: 1;
    justify-content: flex-start;
    text-align: left;
    padding-right: 10px;
    gap: 8px;
    align-items: flex-start;
}

.csm-timeline-col-minute {
    flex: 0 0 60px;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.csm-timeline-col-visitor {
    flex: 1;
    justify-content: flex-end;
    text-align: right;
    padding-left: 10px;
    gap: 8px;
    flex-direction: unset;
    align-items: flex-start;
}

.csm-timeline-col-full {
     width: 100%;
     align-items: center;
     text-align: center;
     justify-content: center;
}

/* Estilo para el minuto (círculo) */
.csm-timeline-minute {
    font-weight: 600;
    color: #fff;
    background-color: #000;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 3px;
}

/* Foto del jugador */
.csm-player-photo {
    width: 50px;
    height: 35px;
    border-radius: 50% !important; /* Forzar redondeo */
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none !important;
}

/* Contenedor para texto y descripción del evento */
.csm-timeline-text-content {
    display: flex;
    flex-direction: column;
}
.csm-timeline-col-local .csm-timeline-text-content { align-items: flex-start; }
.csm-timeline-col-visitor .csm-timeline-text-content { align-items: flex-end; }


/* Contenido del evento (texto principal) */
.csm-timeline-content {
    display: inline-flex;
    align-items: center;
    gap: 5px;    
    flex-wrap: wrap;
}
.csm-timeline-content .csm-event-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

/* Estilo para la descripción (nueva línea) */
.csm-timeline-description {
    display: block;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 3px;
    font-style: italic;
}
.csm-timeline-col-full .csm-timeline-description {
    margin-top: 5px;
    text-align: center;
}


/* Contenido central (inicio/fin de tiempo) */
.csm-timeline-content-center {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 5px 10px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.csm-timeline-content-center .csm-event-icon {
     font-size: 1.1em;
}


/* --- Crónica --- */
.csm-result-chronicle {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.csm-result-chronicle h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #f2c94c;
}
.csm-chronicle-content {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}
.csm-chronicle-content p {
    margin-bottom: 1em;
}


/* --- Responsive --- */
@media (max-width: 768px) {
    .csm-fixtures-filters,
    .csm-fixtures-navigation {
        flex-direction: row;
        gap: 10px;
    }
    .csm-tournament-filter, .csm-category-filter, .csm-date-number-filter, .csm-filter-select { width: 100%; }
    .csm-current-date-display {
        order: -1;
        font-size: 14px;
        width: 100%;
        text-align: left;
        margin-bottom: 10px;
        margin-top: 10px;
    }
    .csm-match-info-right {
         text-align: center;
        flex-shrink: 0;
        display: flex;
        width: 100%;
        margin-left: 0px;
        margin-top: 10px;
        align-items: center;
    }
    .csm-match-venue-fixture{
           display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 5px;
    font-size: 14px;
    color: #fff;
    font-weight: 600; 
    }
    .csm-match-score-fixture, .csm-match-time-fixture {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
    min-height: 25px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-right: 0px;
}
    .csm-match-row, .csm-match-link { flex-wrap: wrap; }
    .csm-match-teams-container, .csm-match-venue-container, .csm-match-score-container { width: 100%; margin: 5px 0; text-align: center; justify-content: center; }

    /* Ajustes responsive para el resumen */
     .csm-summary-columns { flex-direction: column; gap: 15px; }
     .csm-summary-col-local, .csm-summary-col-visitor { align-items: flex-start; text-align: left; }
     .csm-summary-col-visitor .csm-summary-item { flex-direction: row; }
     .csm-summary-col-visitor .csm-summary-icon { margin: 0 8px 0 0; }

     /* Ajustes responsive para timeline 3 columnas */
     .csm-timeline-row {
         flex-direction: column;
         align-items: center;
         gap: 5px;
         padding: 10px 0;
         border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
     }
      .csm-timeline-row:last-child { border-bottom: none; }

     .csm-timeline-col {
         width: 100%;
         justify-content: center !important;
         text-align: center !important;
         padding: 0 5px;
         min-height: auto;
         align-items: center;
         flex-direction: row; /* Foto y texto en fila */
         gap: 10px;
     }
      .csm-timeline-col:empty { display: none; }

     .csm-timeline-col-minute { order: -1; margin-bottom: 5px; }
     .csm-timeline-col-local, .csm-timeline-col-visitor { order: 0; }
     .csm-timeline-col-visitor { flex-direction: row-reverse; }
     .csm-timeline-text-content { align-items: center !important; text-align: center !important; }
     .csm-timeline-description { padding: 0 !important; text-align: center !important; }

     .csm-timeline-content-center { width: auto; }

    /* Ajustes responsive para las columnas de resumen (Goles/Tarjetas) */
    .csm-summary-events-columns {
        flex-direction: column; /* Apilar en pantallas pequeñas */
    }
    .csm-nav-button{
        font-size:10px;
    }
}

/* Styling for Goals and Cards summary columns as boxes */
.csm-summary-events-columns {
    display: flex; /* Use flexbox for columns */
    gap: 20px; /* Space between the columns */
    margin-top: 15px; /* Space above the columns */
    flex-wrap: wrap; /* Allow wrapping on smaller screens if needed */
}

.csm-summary-col {
    flex: 1; /* Each column takes equal space */
    min-width: 200px; /* Minimum width before wrapping */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Borde más sutil */
    padding: 15px; /* Add padding inside the box */
    background-color: rgba(255, 255, 255, 0.08); /* Fondo ligeramente diferente */
    border-radius: 6px; /* Rounded corners */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Sombra sutil */
}

.csm-summary-col h4 {
    margin-top: 0; /* Remove default top margin for heading */
    border-bottom: 1px solid rgba(255, 255, 255, 0.15); /* Separator line under heading */
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #f2c94c; /* Color amarillo para títulos */
    text-align: left; /* Alinear a la izquierda */
}

.csm-summary-item {
    margin-bottom: 8px; /* Space between items */
    display: flex; /* Align icon and text */
    align-items: center; /* Center items vertically */
    font-size: 0.95em;
    line-height: 1.4;
    color: #fff; /* Texto blanco */
}

.csm-summary-icon {
    margin-right: 8px; /* Space between icon and text */
    font-size: 1.1em; /* Slightly larger icon */
    min-width: 20px; /* Ensure space for icon */
    text-align: center;
    display: inline-block; /* Ensure width is respected */
}

.csm-summary-team-name {
    font-style: italic;
    color: rgba(255, 255, 255, 0.7); /* Color más tenue */
    margin-left: 5px;
    font-size: 0.9em;
}

.csm-no-summary-items {
    color: rgba(255, 255, 255, 0.6); /* Color más tenue */
    font-style: italic;
    font-size: 0.9em;
    padding: 10px 0;
}

/* Specific icon styling if needed */
.csm-event-icon-own-goal svg {
    fill: #ff7b7b; /* Color rojo para gol en contra */
}
