/* Estilos generales para la página de ranking */
.ranking-container {
    margin-top: 70px;
    background-color: rgba(255, 255, 255, 0.55);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Selector de ranking (General/Masculino/Femenino) */
.ranking-selector {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.ranking-tab {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #f0f0f0;
    color: #2c3e50;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 15px;
}

.ranking-tab:hover {
    background-color: #3498db;
    color: white;
    transform: translateY(-2px);
}

.ranking-tab.active {
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Contenido principal del ranking */
.ranking-content {
    margin-top: 30px;
}

/* Filtros */
.ranking-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex-grow: 1;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 15px;
}

.filter-group input,
.filter-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: #3498db;
    outline: none;
}

/* Filtros por torneo */
.tournament-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tournament-filter {
    padding: 8px 15px;
    border: 1px solid #3498db;
    border-radius: 4px;
    background-color: white;
    color: #3498db;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.tournament-filter:hover {
    background-color: #f0f8ff;
}

.tournament-filter.active {
    background-color: #3498db;
    color: white;
}

/* Tabla de ranking */
.ranking-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 15px;
}

.ranking-table th {
    background-color: #3498db;
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.ranking-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    color: #34495e;
    vertical-align: middle;
    overflow: visible !important;
}

/* Colores específicos para columnas */
.ranking-table td:nth-child(1) { /* Posición */
    color: #7f8c8d;
    font-weight: 500;
    width: 60px;
}

.ranking-table td:nth-child(2) { /* Jugador */
    color: #2c3e50;
    font-weight: 500;
    width: 180px;
}

.ranking-table td:nth-child(3) { /* Puntos totales */
    color: #3498db;
    font-weight: 600;
    width: 100px;
}

.ranking-table td:nth-child(4) { /* Categoría */
    color: #7f8c8d;
    font-weight: 500;
    width: 80px;
}

.ranking-table td:nth-child(5) { /* Punto de Oro */
    color: #3498db;
    font-weight: 600;
    width: 100px;
}

.ranking-table td:nth-child(6) { /* Arenas */
    color: #3498db;
    font-weight: 600;
    width: 80px;
}

.ranking-table td:nth-child(7) { /* 2do Set */
    color: #3498db;
    font-weight: 600;
    width: 80px;
}

/* Filas alternas */
.ranking-table tr:nth-child(even) {
    background-color: rgba(242, 242, 242, 0.6);
}

.ranking-table tr:hover td {
    background-color: rgba(230, 247, 255, 0.6);
    color: #2c3e50;
}

/* Primeros puestos destacados */
.ranking-table tr.top-1 {
    background-color: rgba(255, 215, 0, 0.1);
}

.ranking-table tr.top-1 td:nth-child(1) {
    color: #ffd700;
    font-weight: bold;
}

.ranking-table tr.top-2 {
    background-color: rgba(192, 192, 192, 0.1);
}

.ranking-table tr.top-2 td:nth-child(1) {
    color: #c0c0c0;
    font-weight: bold;
}

.ranking-table tr.top-3 {
    background-color: rgba(205, 127, 50, 0.1);
}

.ranking-table tr.top-3 td:nth-child(1) {
    color: #cd7f32;
    font-weight: bold;
}

/* Paginación */
.ranking-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.pagination-btn {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.pagination-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

#page-info {
    font-weight: bold;
    color: #2c3e50;
    min-width: 100px;
    text-align: center;
}

/* Loader y mensajes de error */
.loader {
    text-align: center;
    padding: 30px;
    color: #3498db;
    font-style: italic;
    display: none;
    font-size: 16px;
}

.loader.active {
    display: block;
}

.error {
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    padding: 30px;
    font-size: 16px;
}

/* Estilos para puntos por edición */
.edition-points {
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

/* Tooltip mejorado para mostrar ediciones */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: auto;
    max-width: 250px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
}

.tooltip .tooltiptext.bottom {
    bottom: auto;
    top: 100%;
    margin-top: 5px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Estilos responsivos */
@media (max-width: 992px) {
    .ranking-container {
        padding: 20px;
    }
    
    .ranking-filters {
        padding: 15px;
        gap: 15px;
    }
    
    .filter-group {
        min-width: 160px;
    }
}

@media (max-width: 768px) {
    .ranking-container {
        padding: 15px;
        margin-top: 60px;
    }
    
    .ranking-filters {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .ranking-table {
        font-size: 14px;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 10px 12px;
    }
    
    .ranking-table td:nth-child(1) { width: 50px; }
    .ranking-table td:nth-child(2) { width: 150px; }
    .ranking-table td:nth-child(3) { width: 90px; }
    .ranking-table td:nth-child(4) { width: 70px; }
    .ranking-table td:nth-child(5) { width: 90px; }
    .ranking-table td:nth-child(6) { width: 70px; }
    .ranking-table td:nth-child(7) { width: 70px; }
    
    /* Tooltip en móviles */
    .tooltip .tooltiptext {
        max-width: 180px;
        font-size: 12px;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .ranking-container {
        padding: 10px;
        margin: 10px;
        margin-top: 60px;
    }
    
    .ranking-table {
        font-size: 13px;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 8px 10px;
    }
    
/* Eliminar o comentar estas reglas que ocultan columnas */
/*
@media (max-width: 480px) {
    .ranking-table th:nth-child(5),
    .ranking-table td:nth-child(5),
    .ranking-table th:nth-child(6),
    .ranking-table td:nth-child(6),
    .ranking-table th:nth-child(7),
    .ranking-table td:nth-child(7) {
        display: none;
    }
}
*/

/* Reemplazar con estos nuevos estilos para móviles */
@media (max-width: 768px) {
    .ranking-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ranking-table {
        min-width: 600px; /* Ancho mínimo para asegurar que se muestren todas las columnas */
    }
    
    /* Ajustar tamaños de fuente y padding para móviles */
    .ranking-table th,
    .ranking-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    /* Asegurar que las celdas de ediciones sean visibles */
    .ranking-table th:nth-child(n+3),
    .ranking-table td:nth-child(n+3) {
        display: table-cell;
    }
    
    /* Estilos específicos para vista de torneo */
    .ranking-table.tournament-view th,
    .ranking-table.tournament-view td {
        min-width: 70px;
        text-align: center;
    }
    
    .ranking-table.tournament-view td:first-child,
    .ranking-table.tournament-view th:first-child {
        min-width: 50px;
    }
    
    .ranking-table.tournament-view td:nth-child(2),
    .ranking-table.tournament-view th:nth-child(2) {
        min-width: 150px;
        text-align: left;
    }
}



@media (max-width: 480px) {
    .ranking-table {
        min-width: 100%; /* Cambiar a 100% para mejor ajuste en móviles pequeños */
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    /* Asegurar que todas las columnas sean visibles con scroll horizontal */
    .ranking-table-container {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    
    /* Estilos para vista de torneo en móviles pequeños */
    .ranking-table.tournament-view {
        min-width: 650px; /* Ajustar según necesidad */
    }
    
    .ranking-table.tournament-view td,
    .ranking-table.tournament-view th {
        min-width: 60px;
    }
}}

/* Añadir al final del archivo */

/* Estilos específicos para móviles en vista general */
@media (max-width: 768px) {
    .ranking-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        display: block;
    }
    
    .ranking-table {
        min-width: 650px; /* Ancho mínimo mayor para acomodar todas las columnas */
    }
    
    /* Ajustar el tamaño de las celdas */
    .ranking-table th, 
    .ranking-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    /* Asegurar que todas las columnas sean visibles */
    .ranking-table th:nth-child(n+1),
    .ranking-table td:nth-child(n+1) {
        display: table-cell;
    }
    
    /* Estilos específicos para columnas */
    .ranking-table td:nth-child(1) { width: 50px; } /* Posición */
    .ranking-table td:nth-child(2) { width: 150px; } /* Jugador */
    .ranking-table td:nth-child(3) { width: 80px; } /* Puntos */
    .ranking-table td:nth-child(4) { width: 80px; } /* Categoría */
    .ranking-table td:nth-child(5) { width: 80px; } /* Género */
    .ranking-table td:nth-child(6) { width: 90px; } /* Punto de Oro */
    .ranking-table td:nth-child(7) { width: 80px; } /* Arenas */
    .ranking-table td:nth-child(8) { width: 80px; } /* 2do Set */
}

@media (max-width: 480px) {
    .ranking-table {
        min-width: 600px;
    }
    
    .ranking-table th, 
    .ranking-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    /* Tooltips más pequeños */
    .tooltip .tooltiptext {
        max-width: 150px;
        font-size: 11px;
        padding: 5px 8px;
    }
    
    /* Ajustar columnas específicas */
    .ranking-table td:nth-child(2) { width: 130px; } /* Jugador */
    .ranking-table td:nth-child(3) { width: 70px; } /* Puntos */
}
/* Estilos para el botón de compartir de Facebook */
.facebook-share-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background-color: #3b5998;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
    margin: 10px 0;
}

.facebook-share-button:hover {
    background-color: #2d4373;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.facebook-share-button i {
    margin-right: 8px;
    font-size: 1.2em;
}
/* Estilos para el botón de WhatsApp */
.whatsapp-share-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background-color: #25D366;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
    margin: 10px 0;
}

.whatsapp-share-button:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.whatsapp-share-button i {
    margin-right: 8px;
    font-size: 1.2em;
}