/* ========================
   Contenedor principal de la tabla
   ======================== */
.pe-table-wrapper {
    width: 100%;             
    max-width: 1200px;       
    margin: 20px auto;       
    padding: 0 10px;         
    overflow-x: auto;        
    box-sizing: border-box;  
}

/* ========================
   Tabla de resultados moderna
   ======================== */
.pe-results-table {
    width: 100%;              
    border-collapse: separate; 
    border-spacing: 0;        
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    table-layout: auto;        
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ========================
   Encabezados
   ======================== */
.pe-results-table thead {
    background-color: #f7f7f7; 
}

.pe-results-table th {
    padding: 12px 10px;
    text-align: left;          
    font-weight: 600;          
    color: #333;               
    border-bottom: 2px solid #ddd; 
}

/* ========================
   Celdas
   ======================== */
.pe-results-table td {
    padding: 12px 10px;
    color: #555;               
    border-bottom: 1px solid #eee;
}

/* ========================
   Hover en las filas
   ======================== */
.pe-results-table tbody tr:hover {
    background-color: #f0f8ff; 
}

/* ========================
   Alternar color de filas
   ======================== */
.pe-results-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* ========================
   Resaltar primer lugar
   ======================== */
.pe-results-table tbody tr.first-place {
    background-color: #ffeaa7; 
}

/* ========================
   Primera columna (Lugar/Número) compacta
   ======================== */
.pe-results-table th:first-child,
.pe-results-table td:first-child {
    width: 50px;           
    text-align: center;    
    white-space: nowrap;   
}

/* ========================
   Columnas auto-expandibles (Nombre y Categoría)
   ======================== */
.pe-results-table th:nth-child(3),
.pe-results-table td:nth-child(3),
.pe-results-table th:nth-child(4),
.pe-results-table td:nth-child(4) {
    width: auto;
    white-space: nowrap;   
}

/* ========================
   Columnas de Tiempos y Equipo: solo ancho necesario
   ======================== */
.pe-results-table th:nth-child(5),
.pe-results-table td:nth-child(5),
.pe-results-table th:nth-child(6),
.pe-results-table td:nth-child(6),
.pe-results-table th:nth-child(7),
.pe-results-table td:nth-child(7) {
    width: 1%;             
    white-space: nowrap;
}

/* ========================
   Modal de resultados pantalla completa
   ======================== */
#event-results-modal {
    display: none;               
    position: fixed;             
    top: 10px;                   
    left: 10px;                  
    right: 10px;                 
    bottom: 10px;                
    padding: 20px;               
    background: #fff;            
    box-shadow: 0 4px 25px rgba(0,0,0,0.3); 
    border-radius: 8px;
    overflow: auto;              
    z-index: 9999;               
}

/* Botón Cerrar */
#event-results-modal .close-button {
    float: right;
    cursor: pointer;
    padding: 4px 8px;
    background: #ff4757;
    color: #fff;
    border: none;
    border-radius: 4px;
}

/* Contenedor de tabla dentro del modal */
#event-results-content {
    margin-top: 10px;            
}

/* ========================
   Botones de evento en [eventos_todos]
   ======================== */
#eventos-list button.event-button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: background 0.3s;
}

#eventos-list button.event-button:hover {
    background-color: #005177; 
}

#eventos-list button.event-button.active {
    background-color: #00b894; 
}

/* ========================
   Mensajes de estado (sin resultados / cargando)
   ======================== */
#event-results-content p {
    text-align: center;
    font-style: italic;
    color: #555;
}

/* ========================
   Paginación compacta
   ======================== */
#event-results-pagination {
    margin-top: 15px;
    text-align: center;
    font-family: Arial, sans-serif;
}

/* Botones de página y puntos suspensivos */
#event-results-pagination button,
#event-results-pagination span {
    margin: 0 3px;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    display: inline-block;
}

/* Botones de página */
#event-results-pagination button.page-num {
    background: #0073aa;
    color: #fff;
    border: none;
    transition: background 0.3s;
}

#event-results-pagination button.page-num:hover {
    background: #005177;
}

#event-results-pagination button.page-num.active {
    background: #00b894; /* Página actual resaltada */
    cursor: default;
}

/* Botones de anterior/siguiente */
#event-results-pagination button.prev-page,
#event-results-pagination button.next-page {
    background: #555;
    color: #fff;
    border: none;
    transition: background 0.3s;
}

#event-results-pagination button.prev-page:hover,
#event-results-pagination button.next-page:hover {
    background: #333;
}

/* Puntos suspensivos */
#event-results-pagination span {
    background: none;
    color: #555;
    cursor: default;
    padding: 4px 6px;
}

/* ========================
   Responsive: reducir padding en pantallas pequeñas
   ======================== */
@media screen and (max-width: 768px) {
    .pe-results-table th,
    .pe-results-table td {
        padding: 8px 6px;
    }

    #event-results-pagination button,
    #event-results-pagination span {
        padding: 3px 6px;
        font-size: 12px;
    }

    #event-results-modal {
        top: 5px;
        left: 5px;
        right: 5px;
        bottom: 5px;
        padding: 15px;
    }
}
