/* ============================================
   Comparativa - Vista de Comparación de Jugadores
   ============================================ */

.comparativa-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.comparativa-header {
    text-align: center;
    margin-bottom: 40px;
}

.comparativa-header h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
}

.comparativa-header p {
    color: #666;
    font-size: 16px;
}

/* Selector de jugadores */
.player-selector-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.player-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.player-selector label {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.player-select-dropdown {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.player-select-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Jugadores seleccionados */
.selected-players {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.no-players {
    color: #999;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.selected-player-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.player-color-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.player-color-2 {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.player-color-3 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.remove-player-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
}

.remove-player-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Tabla de comparación */
.comparison-table-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow-x: auto;
}

.info-message {
    text-align: center;
    color: #666;
    padding: 40px;
    font-size: 16px;
}

.comparison-table-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    table-layout: fixed; /* Forzar distribución equitativa */
    display: table; /* Asegurar comportamiento de tabla */
}

.comparison-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: table-header-group; /* Asegurar comportamiento correcto */
}

.comparison-table tbody {
    display: table-row-group; /* Asegurar comportamiento correcto */
}

.comparison-table tr {
    display: table-row; /* Asegurar comportamiento de fila */
}

.comparison-table th,
.comparison-table td {
    display: table-cell; /* CRÍTICO: Forzar comportamiento de celda */
    padding: 16px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    vertical-align: middle;
}

.comparison-table th {
    padding: 16px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
}

.comparison-table .metric-column {
    text-align: left;
    width: 30%; /* Ancho fijo para la columna de métricas */
}

.comparison-table .player-column {
    width: auto; /* Las columnas de jugadores se distribuyen el resto */
    text-align: center;
}

.comparison-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.comparison-table tbody tr:hover {
    background: #f9fafb;
}

.comparison-table tbody tr:last-child {
    border-bottom: none;
}

.comparison-table td {
    padding: 14px 16px;
    text-align: center;
    font-size: 14px;
    display: table-cell !important; /* FORZAR comportamiento de celda */
}

.comparison-table .metric-name {
    font-weight: 600;
    color: #333;
    text-align: left;
    display: table-cell !important; /* FORZAR comportamiento de celda */
}

.comparison-table .stat-value {
    color: #666;
    font-size: 15px;
    font-weight: 500;
    text-align: center; /* Asegurar centrado */
    display: table-cell !important; /* FORZAR comportamiento de celda */
}

.metric-name {
    font-weight: 600;
    color: #333;
    text-align: left !important;
}

.stat-value {
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

.best-stat {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
    font-weight: 700;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Gráficos */
.comparison-charts {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.chart-container {
    max-width: 800px;
    margin: 0 auto;
}

.chart-container h3 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
}

.chart-container canvas {
    max-height: 500px;
}

/* Responsive */
@media (max-width: 768px) {
    .comparativa-container {
        padding: 15px;
    }

    .comparativa-header h1 {
        font-size: 24px;
    }

    .player-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .player-select-dropdown {
        width: 100%;
    }

    .btn-primary {
        width: 100%;
    }

    .comparison-table-container {
        padding: 15px;
    }

    .comparison-table {
        font-size: 14px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
    }

    .metric-name {
        font-size: 13px;
    }

    .selected-player-card {
        width: 100%;
        justify-content: space-between;
    }

    .chart-container canvas {
        max-height: 300px;
    }
}
